zoukankan      html  css  js  c++  java
  • 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;
                }

  • 相关阅读:
    LeetCode: Trapping Rain Water
    LeetCode: Text Justification
    LeetCode: Unique Paths
    LeetCode: Unique Binary Search Trees
    向Google、Yahoo!和百度提交Sitemap网站地图
    Paypal IPN&PDT变量列表
    SQL查询和删除重复字段的内容
    [C#]基于.net技术的 Rss 订阅开发
    验证码识别流程
    c# string.Format 格式化日期
  • 原文地址:https://www.cnblogs.com/LuoEast/p/7686024.html
Copyright © 2011-2022 走看看