Example #1
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            if (GridList.SelectedRowIndexArray.Length < 1)
            {
                return;
            }
            int rowIndex = GridList.SelectedRowIndexArray[0];

            if (GridList.DataKeys[rowIndex][0].ToString() != "N")
            {
                Alert.Show("此发票已被使用,不允许删除!");
                return;
            }
            DbHelperOra.ExecuteSql("DELETE FROM dat_jsd_fp WHERE SEQNO='" + GridList.DataKeys[rowIndex][1] + "' AND FLAG='N'");
            PageContext.RegisterStartupScript(GridList.GetDeleteRowReference(rowIndex));
        }
        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;
                }
            }
        }