码迷,mamicode.com
首页 > 其他好文 > 详细

单元格编辑后级联汇总刷新

时间:2018-08-30 16:44:08      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:false   单元格编辑   select   pdb   级联   edit   rpd   erp   new   

单元格编辑 级联刷新

PDERPDB db = new PDERPDB();

int conid = 0;
int pid = 0;

string sql = "";
string sqlC = "";

if (int.TryParse(Pid, out pid))
{
sql = string.Format(@" UPDATE JL_Project set PCMoney={0} where Pid={1};", pcmoney, Pid);
}

if (sql.Length > 0)
{
db.ExecuteCommand(sql);
}

if (int.TryParse(Conid, out conid))
{
decimal? sum = ((from row in db.JL_Project
where row.Conid == conid
select row.PCMoney).Sum());
if (sum.HasValue)
{
sqlC = string.Format(@" UPDATE JL_Contract set Cmoney={0} where Conid={1}", sum.Value, conid);
txtcmoney.Text = sum.Value.ToString();
}
else
{
sqlC = string.Format(@" UPDATE JL_Contract set Cmoney=0 where Conid={0}",conid);
txtcmoney.Text = "0";
}
}
if (sqlC.Length > 0)
{
db.ExecuteCommand(sqlC);
}

 

 

页面上 js


var gridPCBeforeEdit = function (e) {
return true;
}

var gridPCAfterEdit = function (e) {

var row = gridProject.getSelectionModel().getSelected();
var ProjectID = e.record.data.Pid;
var Conid = e.record.data.Conid;
var value = e.value;

SCM.DoSaveProCon(hidPCID.getValue(), ProjectID, value,
{
success: function (result) {
e.record.commit();
storeTPJ.reload();
AfterSave();
},
failure: function (result) {
Ext.Msg.alert(‘系统提示‘, ‘数据更新失败!‘ + result);
e.record.reject(false);
}
});
}

单元格编辑后级联汇总刷新

标签:false   单元格编辑   select   pdb   级联   edit   rpd   erp   new   

原文地址:https://www.cnblogs.com/wusirAaron/p/9560609.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!