protected override void billSave() { List <Dictionary <string, object> > newDict = GridList.GetNewAddedList(); MyTable mtTypeMx = new MyTable("doc_mygoods"); List <CommandInfo> cmdList = new List <CommandInfo>(); string Sql = string.Empty; string GETdeptid = ""; string GETgdseq = ""; for (int i = 0; i < newDict.Count; i++) { GETdeptid = newDict[i]["DEPTID"].ToString(); GETgdseq = newDict[i]["GDSEQ"].ToString(); if (DbHelperOra.Exists("select 1 from DOC_MYGOODS where DEPTID='" + GETdeptid + "' and GDSEQ ='" + GETgdseq + "'")) { Sql = "DELETE FROM DOC_MYGOODS WHERE DEPTID = '" + GETdeptid + "' and GDSEQ = '" + GETgdseq + "'"; cmdList.Add(new CommandInfo(Sql, null)); } mtTypeMx.ColRow = PubFunc.GridDataGet(newDict[i]); mtTypeMx.ColRow.Remove("DEPTIDNAME"); mtTypeMx.ColRow.Remove("GDNAME"); mtTypeMx.ColRow.Remove("GDSPEC"); mtTypeMx.ColRow.Remove("UNITNAME"); mtTypeMx.ColRow.Remove("BZHL"); mtTypeMx.ColRow.Remove("ZDKC"); mtTypeMx.ColRow.Remove("ZGKC"); mtTypeMx.ColRow.Remove("DSNUM"); mtTypeMx.ColRow.Remove("NUM1"); mtTypeMx.ColRow.Remove("NUM2"); mtTypeMx.ColRow.Remove("NUM3"); mtTypeMx.ColRow.Remove("OPERDATE"); cmdList.Add(mtTypeMx.Insert()); } if (DbHelperOra.ExecuteSqlTran(cmdList)) { Alert.Show("保存成功!"); } else { Alert.Show("保存失败!"); } }
protected override void billDelRow() { if (GridList.Rows.Count == 0) { return; } if (GridList.SelectedCell == null) { return; } string GETdeptid = ""; string GETgdseq = ""; List <Dictionary <string, object> > newDict = GridList.GetNewAddedList(); int rowIndex = GridList.SelectedRowIndex; if ((GridList.DataKeys.Count - 1) < rowIndex) { Alert.Show("该商品未收藏"); return; } else { GETdeptid = GridList.DataKeys[rowIndex][0].ToString(); GETgdseq = GridList.DataKeys[rowIndex][1].ToString(); if (DbHelperOra.Exists("select 1 from DOC_MYGOODS where DEPTID='" + GETdeptid + "' and GDSEQ ='" + GETgdseq + "'")) { string Sql = string.Empty; Sql = "DELETE FROM DOC_MYGOODS WHERE DEPTID = '" + GETdeptid + "' and GDSEQ = '" + GETgdseq + "'"; DbHelperOra.ExecuteSql(Sql); Alert.Show("已取消收藏"); PageContext.RegisterStartupScript(GridList.GetDeleteRowReference(rowIndex)); //billSearch(); } else { Alert.Show("未保存商品无需删除"); return; } } }