• C# DataGridView 的UserDeletingRow事件,删除


     DialogResult dr = MessageBox.Show("确认删除记录吗?", "提示", MessageBoxButtons.YesNo);
                if (dr == DialogResult.Yes)
                {
                    DataSet deleRcom2 = Collections.FastSocket.get_ds("select o.id,b.dd_size,b.size_long,b.size_wide,b.size_high,o.goodsType,o.cname,o.pay_type,o.order_memo,o.address,o.RecipientCode,o.mobile,o.country_free,o.agencyFund,o.order_code,o.cforhmType,b.goods,b.kd_billcode,b.dd_weight,b.dd_weight2,b.member_id,b.username,b.goodsTyep goodsType2  from pmw_order o left join pmw_billcode b on o.order_code=b.order_code where isnull(o.DoubleCheck,0)=1 and isnull(b.lost_flag,0)=0 and isnull(b.is_outplace,0)=1 and  isnull(is_packed,0)=0 and isnull(packed_billcode,'')='' and o.order_code='" + this.tool_order_code.Text + "' and b.kd_billcode='" + e.Row.Cells["kd_billcode2"].Value + "'");
                    if (deleRcom2 != null && deleRcom2.Tables.Count > 0 && deleRcom2.Tables[0].Rows.Count > 0)
                    {

                        DataTable dt1 = (DataTable)rcomdgv1.DataSource;
                        DataRow drcalc = dt1.NewRow();
                        drcalc.ItemArray = deleRcom2.Tables[0].Rows[0].ItemArray;
                        dt1.Rows.Add(drcalc);
                        rcomdgv1.DataSource = dt1;
                    }
                    else
                    {
                        MessageBox.Show("无法获取该数据");
                        e.Cancel = true;
                    }
                }
                else
                {
                    e.Cancel = true;
                }

  • 相关阅读:
    xml配置文件使用-读取、转换
    .NET 4.0 缓存
    jQuery分页插件pagination.js 笔记
    Spring源码
    Shell编程(字符串篇)
    Linux DNS 相关
    Shell将命令执行结果写入文件
    Linux安装GCC
    Linux网络安全
    产品经理基础
  • 原文地址:https://www.cnblogs.com/LuoEast/p/7686024.html
Copyright © 2020-2023  润新知