示例#1
0
        protected bool save()
        {
            Dictionary <int, Dictionary <string, object> > modifiedDict = GridGoodsList.GetModifiedDict();
            List <CommandInfo> cmdList = new List <CommandInfo>();

            foreach (int rowIndex in modifiedDict.Keys)
            {
                string rowID = GridGoodsList.DataKeys[rowIndex][1].ToString();
                string Seqno = GridGoodsList.DataKeys[rowIndex][0].ToString();
                if (GridGoodsList.DataKeys[rowIndex][2].ToString() == "定数申领" && modifiedDict[rowIndex]["FPSL"].ToString() != "0" && modifiedDict[rowIndex]["FPSL"].ToString() != GridGoodsList.DataKeys[rowIndex][3].ToString())
                {
                    Alert.Show("单号【" + Seqno + "】为定数申领单,分配数量只能维护成0或申领数量");
                    return(false);
                }
                cmdList.Add(new CommandInfo(string.Format("UPDATE DAT_SL_COM SET FPSL = '{0}',FPUSER = '******',FPDATE = SYSDATE WHERE SEQNO ='{1}' AND ROWNO = {2}", modifiedDict[rowIndex]["FPSL"], Seqno, rowID, UserAction.UserID), null));
                cmdList.Add(new CommandInfo(string.Format("UPDATE DAT_CK_COM SET FPSL = '{0}',FPUSER = '******',FPDATE = SYSDATE WHERE SEQNO ='{1}' AND ROWNO = {2}", modifiedDict[rowIndex]["FPSL"], Seqno, rowID, UserAction.UserID), null));
                OperLog("库存分配", "修改单据【" + Seqno + "】出库数量");
            }
            if (cmdList.Count > 0)
            {
                DbHelperOra.ExecuteSqlTran(cmdList);
            }
            return(true);
        }