WPF添加一行

来源:互联网 时间:1970-01-01

public static void insert(){
            string savesql = "select * from ComplainInfo";
            DataSet dscomplanI = gs.GetDataBySql(savesql);
            DataRow drs = dscomplanI.Tables[0].NewRow();      
            drs["cust_id"] =txtCustomerCode.Text.Trim();
            drs["member"] = txtWebCustomer.Text.Trim();
            drs["complaints type"]=cboComplaintType.Text.Trim();
           
            drs["complaintstime"] = rdpComplaintDate.SelectedDate.Value;
            

      
            if (txtSummary.Text.Trim() != "")
            {
                try
                {
                    decimal monery = Convert.ToDecimal(this.txtSummary.Text.Trim());
                }
                catch (Exception)
                {

                    MessageBox.Show("必须输入金额数字!");
                    return;
                }
                drs["buy amount"] = Convert.ToDecimal(txtSummary.Text.Trim());
            }
            drs["Accept custservice"]=txtAgent.Text.Trim();
            drs["complaintsremark"] = rtbComplaintRemark.Text.Trim();
            drs["createby"] = createby;
            drs["lastdate"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            dscomplanI.Tables[0].Rows.Add(drs);

         int result1=gs.DataAdapterSave(dscomplanI);

本文来自miyabaobeii博客,转载请标明出处:http://blog.csdn.net/miyabaobeii/archive/2011/06/13/6541140.aspx


相关阅读:
Top