/// <summary> /// 批量 /// </summary> public bool Update_batch(XHD.Model.CRM_order model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update CRM_order set "); strSql.Append("F_dep_id=@F_dep_id,"); strSql.Append("F_dep_name=@F_dep_name,"); strSql.Append("F_emp_id=@F_emp_id,"); strSql.Append("F_emp_name=@F_emp_name"); strSql.Append(" where F_emp_id=@create_id"); MySqlParameter[] parameters = { new MySqlParameter("@F_dep_id", MySqlDbType.Int32, 4), new MySqlParameter("@F_dep_name", MySqlDbType.VarChar, 250), new MySqlParameter("@F_emp_id", MySqlDbType.Int32, 4), new MySqlParameter("@F_emp_name", MySqlDbType.VarChar, 250), new MySqlParameter("@create_id", MySqlDbType.Int32, 4) }; parameters[0].Value = model.F_dep_id; parameters[1].Value = model.F_dep_name; parameters[2].Value = model.F_emp_id; parameters[3].Value = model.F_emp_name; parameters[4].Value = model.create_id; int rows = DbHelperMySQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(XHD.Model.CRM_order model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into CRM_order("); strSql.Append("Serialnumber,Customer_id,Customer_name,Order_date,pay_type_id,pay_type,Order_details,Order_status_id,Order_status,Order_amount,create_id,create_date,C_dep_id,C_dep_name,C_emp_id,C_emp_name,F_dep_id,F_dep_name,F_emp_id,F_emp_name,receive_money,arrears_money,invoice_money,arrears_invoice,isDelete,Delete_time)"); strSql.Append(" values ("); strSql.Append("@Serialnumber,@Customer_id,@Customer_name,@Order_date,@pay_type_id,@pay_type,@Order_details,@Order_status_id,@Order_status,@Order_amount,@create_id,@create_date,@C_dep_id,@C_dep_name,@C_emp_id,@C_emp_name,@F_dep_id,@F_dep_name,@F_emp_id,@F_emp_name,@receive_money,@arrears_money,@invoice_money,@arrears_invoice,@isDelete,@Delete_time)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Serialnumber", SqlDbType.VarChar, 250), new SqlParameter("@Customer_id", SqlDbType.Int, 4), new SqlParameter("@Customer_name", SqlDbType.VarChar, 250), new SqlParameter("@Order_date", SqlDbType.DateTime), new SqlParameter("@pay_type_id", SqlDbType.Int, 4), new SqlParameter("@pay_type", SqlDbType.VarChar, 250), new SqlParameter("@Order_details", SqlDbType.VarChar), new SqlParameter("@Order_status_id", SqlDbType.Int, 4), new SqlParameter("@Order_status", SqlDbType.VarChar, 250), new SqlParameter("@Order_amount", SqlDbType.Float, 8), new SqlParameter("@create_id", SqlDbType.Int, 4), new SqlParameter("@create_date", SqlDbType.DateTime), new SqlParameter("@C_dep_id", SqlDbType.Int, 4), new SqlParameter("@C_dep_name", SqlDbType.VarChar, 250), new SqlParameter("@C_emp_id", SqlDbType.Int, 4), new SqlParameter("@C_emp_name", SqlDbType.VarChar, 250), new SqlParameter("@F_dep_id", SqlDbType.Int, 4), new SqlParameter("@F_dep_name", SqlDbType.VarChar, 250), new SqlParameter("@F_emp_id", SqlDbType.Int, 4), new SqlParameter("@F_emp_name", SqlDbType.VarChar, 250), new SqlParameter("@receive_money", SqlDbType.Float, 8), new SqlParameter("@arrears_money", SqlDbType.Float, 8), new SqlParameter("@invoice_money", SqlDbType.Float, 8), new SqlParameter("@arrears_invoice", SqlDbType.Float, 8), new SqlParameter("@isDelete", SqlDbType.Int, 4), new SqlParameter("@Delete_time", SqlDbType.DateTime) }; parameters[0].Value = model.Serialnumber; parameters[1].Value = model.Customer_id; parameters[2].Value = model.Customer_name; parameters[3].Value = model.Order_date; parameters[4].Value = model.pay_type_id; parameters[5].Value = model.pay_type; parameters[6].Value = model.Order_details; parameters[7].Value = model.Order_status_id; parameters[8].Value = model.Order_status; parameters[9].Value = model.Order_amount; parameters[10].Value = model.create_id; parameters[11].Value = model.create_date; parameters[12].Value = model.C_dep_id; parameters[13].Value = model.C_dep_name; parameters[14].Value = model.C_emp_id; parameters[15].Value = model.C_emp_name; parameters[16].Value = model.F_dep_id; parameters[17].Value = model.F_dep_name; parameters[18].Value = model.F_emp_id; parameters[19].Value = model.F_emp_name; parameters[20].Value = model.receive_money; parameters[21].Value = model.arrears_money; parameters[22].Value = model.invoice_money; parameters[23].Value = model.arrears_invoice; parameters[24].Value = model.isDelete; parameters[25].Value = model.Delete_time; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 得到一个对象实体 /// </summary> public XHD.Model.CRM_order GetModel(int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 id,Serialnumber,Customer_id,Customer_name,Order_date,pay_type_id,pay_type,Order_details,Order_status_id,Order_status,Order_amount,create_id,create_date,C_dep_id,C_dep_name,C_emp_id,C_emp_name,F_dep_id,F_dep_name,F_emp_id,F_emp_name,receive_money,arrears_money,invoice_money,arrears_invoice,isDelete,Delete_time from CRM_order "); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4) }; parameters[0].Value = id; XHD.Model.CRM_order model = new XHD.Model.CRM_order(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["id"] != null && ds.Tables[0].Rows[0]["id"].ToString() != "") { model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } if (ds.Tables[0].Rows[0]["Serialnumber"] != null && ds.Tables[0].Rows[0]["Serialnumber"].ToString() != "") { model.Serialnumber = ds.Tables[0].Rows[0]["Serialnumber"].ToString(); } if (ds.Tables[0].Rows[0]["Customer_id"] != null && ds.Tables[0].Rows[0]["Customer_id"].ToString() != "") { model.Customer_id = int.Parse(ds.Tables[0].Rows[0]["Customer_id"].ToString()); } if (ds.Tables[0].Rows[0]["Customer_name"] != null && ds.Tables[0].Rows[0]["Customer_name"].ToString() != "") { model.Customer_name = ds.Tables[0].Rows[0]["Customer_name"].ToString(); } if (ds.Tables[0].Rows[0]["Order_date"] != null && ds.Tables[0].Rows[0]["Order_date"].ToString() != "") { model.Order_date = DateTime.Parse(ds.Tables[0].Rows[0]["Order_date"].ToString()); } if (ds.Tables[0].Rows[0]["pay_type_id"] != null && ds.Tables[0].Rows[0]["pay_type_id"].ToString() != "") { model.pay_type_id = int.Parse(ds.Tables[0].Rows[0]["pay_type_id"].ToString()); } if (ds.Tables[0].Rows[0]["pay_type"] != null && ds.Tables[0].Rows[0]["pay_type"].ToString() != "") { model.pay_type = ds.Tables[0].Rows[0]["pay_type"].ToString(); } if (ds.Tables[0].Rows[0]["Order_details"] != null && ds.Tables[0].Rows[0]["Order_details"].ToString() != "") { model.Order_details = ds.Tables[0].Rows[0]["Order_details"].ToString(); } if (ds.Tables[0].Rows[0]["Order_status_id"] != null && ds.Tables[0].Rows[0]["Order_status_id"].ToString() != "") { model.Order_status_id = int.Parse(ds.Tables[0].Rows[0]["Order_status_id"].ToString()); } if (ds.Tables[0].Rows[0]["Order_status"] != null && ds.Tables[0].Rows[0]["Order_status"].ToString() != "") { model.Order_status = ds.Tables[0].Rows[0]["Order_status"].ToString(); } if (ds.Tables[0].Rows[0]["Order_amount"] != null && ds.Tables[0].Rows[0]["Order_amount"].ToString() != "") { model.Order_amount = decimal.Parse(ds.Tables[0].Rows[0]["Order_amount"].ToString()); } if (ds.Tables[0].Rows[0]["create_id"] != null && ds.Tables[0].Rows[0]["create_id"].ToString() != "") { model.create_id = int.Parse(ds.Tables[0].Rows[0]["create_id"].ToString()); } if (ds.Tables[0].Rows[0]["create_date"] != null && ds.Tables[0].Rows[0]["create_date"].ToString() != "") { model.create_date = DateTime.Parse(ds.Tables[0].Rows[0]["create_date"].ToString()); } if (ds.Tables[0].Rows[0]["C_dep_id"] != null && ds.Tables[0].Rows[0]["C_dep_id"].ToString() != "") { model.C_dep_id = int.Parse(ds.Tables[0].Rows[0]["C_dep_id"].ToString()); } if (ds.Tables[0].Rows[0]["C_dep_name"] != null && ds.Tables[0].Rows[0]["C_dep_name"].ToString() != "") { model.C_dep_name = ds.Tables[0].Rows[0]["C_dep_name"].ToString(); } if (ds.Tables[0].Rows[0]["C_emp_id"] != null && ds.Tables[0].Rows[0]["C_emp_id"].ToString() != "") { model.C_emp_id = int.Parse(ds.Tables[0].Rows[0]["C_emp_id"].ToString()); } if (ds.Tables[0].Rows[0]["C_emp_name"] != null && ds.Tables[0].Rows[0]["C_emp_name"].ToString() != "") { model.C_emp_name = ds.Tables[0].Rows[0]["C_emp_name"].ToString(); } if (ds.Tables[0].Rows[0]["F_dep_id"] != null && ds.Tables[0].Rows[0]["F_dep_id"].ToString() != "") { model.F_dep_id = int.Parse(ds.Tables[0].Rows[0]["F_dep_id"].ToString()); } if (ds.Tables[0].Rows[0]["F_dep_name"] != null && ds.Tables[0].Rows[0]["F_dep_name"].ToString() != "") { model.F_dep_name = ds.Tables[0].Rows[0]["F_dep_name"].ToString(); } if (ds.Tables[0].Rows[0]["F_emp_id"] != null && ds.Tables[0].Rows[0]["F_emp_id"].ToString() != "") { model.F_emp_id = int.Parse(ds.Tables[0].Rows[0]["F_emp_id"].ToString()); } if (ds.Tables[0].Rows[0]["F_emp_name"] != null && ds.Tables[0].Rows[0]["F_emp_name"].ToString() != "") { model.F_emp_name = ds.Tables[0].Rows[0]["F_emp_name"].ToString(); } if (ds.Tables[0].Rows[0]["receive_money"] != null && ds.Tables[0].Rows[0]["receive_money"].ToString() != "") { model.receive_money = decimal.Parse(ds.Tables[0].Rows[0]["receive_money"].ToString()); } if (ds.Tables[0].Rows[0]["arrears_money"] != null && ds.Tables[0].Rows[0]["arrears_money"].ToString() != "") { model.arrears_money = decimal.Parse(ds.Tables[0].Rows[0]["arrears_money"].ToString()); } if (ds.Tables[0].Rows[0]["invoice_money"] != null && ds.Tables[0].Rows[0]["invoice_money"].ToString() != "") { model.invoice_money = decimal.Parse(ds.Tables[0].Rows[0]["invoice_money"].ToString()); } if (ds.Tables[0].Rows[0]["arrears_invoice"] != null && ds.Tables[0].Rows[0]["arrears_invoice"].ToString() != "") { model.arrears_invoice = decimal.Parse(ds.Tables[0].Rows[0]["arrears_invoice"].ToString()); } if (ds.Tables[0].Rows[0]["isDelete"] != null && ds.Tables[0].Rows[0]["isDelete"].ToString() != "") { model.isDelete = int.Parse(ds.Tables[0].Rows[0]["isDelete"].ToString()); } if (ds.Tables[0].Rows[0]["Delete_time"] != null && ds.Tables[0].Rows[0]["Delete_time"].ToString() != "") { model.Delete_time = DateTime.Parse(ds.Tables[0].Rows[0]["Delete_time"].ToString()); } return(model); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(XHD.Model.CRM_order model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update CRM_order set "); strSql.Append("Serialnumber=@Serialnumber,"); strSql.Append("Customer_id=@Customer_id,"); strSql.Append("Customer_name=@Customer_name,"); strSql.Append("Order_date=@Order_date,"); strSql.Append("pay_type_id=@pay_type_id,"); strSql.Append("pay_type=@pay_type,"); strSql.Append("Order_details=@Order_details,"); strSql.Append("Order_status_id=@Order_status_id,"); strSql.Append("Order_status=@Order_status,"); strSql.Append("Order_amount=@Order_amount,"); strSql.Append("create_id=@create_id,"); strSql.Append("create_date=@create_date,"); strSql.Append("C_dep_id=@C_dep_id,"); strSql.Append("C_dep_name=@C_dep_name,"); strSql.Append("C_emp_id=@C_emp_id,"); strSql.Append("C_emp_name=@C_emp_name,"); strSql.Append("F_dep_id=@F_dep_id,"); strSql.Append("F_dep_name=@F_dep_name,"); strSql.Append("F_emp_id=@F_emp_id,"); strSql.Append("F_emp_name=@F_emp_name,"); strSql.Append("receive_money=@receive_money,"); strSql.Append("arrears_money=@arrears_money,"); strSql.Append("invoice_money=@invoice_money,"); strSql.Append("arrears_invoice=@arrears_invoice,"); strSql.Append("isDelete=@isDelete,"); strSql.Append("Delete_time=@Delete_time"); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@Serialnumber", SqlDbType.VarChar, 250), new SqlParameter("@Customer_id", SqlDbType.Int, 4), new SqlParameter("@Customer_name", SqlDbType.VarChar, 250), new SqlParameter("@Order_date", SqlDbType.DateTime), new SqlParameter("@pay_type_id", SqlDbType.Int, 4), new SqlParameter("@pay_type", SqlDbType.VarChar, 250), new SqlParameter("@Order_details", SqlDbType.VarChar), new SqlParameter("@Order_status_id", SqlDbType.Int, 4), new SqlParameter("@Order_status", SqlDbType.VarChar, 250), new SqlParameter("@Order_amount", SqlDbType.Float, 8), new SqlParameter("@create_id", SqlDbType.Int, 4), new SqlParameter("@create_date", SqlDbType.DateTime), new SqlParameter("@C_dep_id", SqlDbType.Int, 4), new SqlParameter("@C_dep_name", SqlDbType.VarChar, 250), new SqlParameter("@C_emp_id", SqlDbType.Int, 4), new SqlParameter("@C_emp_name", SqlDbType.VarChar, 250), new SqlParameter("@F_dep_id", SqlDbType.Int, 4), new SqlParameter("@F_dep_name", SqlDbType.VarChar, 250), new SqlParameter("@F_emp_id", SqlDbType.Int, 4), new SqlParameter("@F_emp_name", SqlDbType.VarChar, 250), new SqlParameter("@receive_money", SqlDbType.Float, 8), new SqlParameter("@arrears_money", SqlDbType.Float, 8), new SqlParameter("@invoice_money", SqlDbType.Float, 8), new SqlParameter("@arrears_invoice", SqlDbType.Float, 8), new SqlParameter("@isDelete", SqlDbType.Int, 4), new SqlParameter("@Delete_time", SqlDbType.DateTime), new SqlParameter("@id", SqlDbType.Int, 4) }; parameters[0].Value = model.Serialnumber; parameters[1].Value = model.Customer_id; parameters[2].Value = model.Customer_name; parameters[3].Value = model.Order_date; parameters[4].Value = model.pay_type_id; parameters[5].Value = model.pay_type; parameters[6].Value = model.Order_details; parameters[7].Value = model.Order_status_id; parameters[8].Value = model.Order_status; parameters[9].Value = model.Order_amount; parameters[10].Value = model.create_id; parameters[11].Value = model.create_date; parameters[12].Value = model.C_dep_id; parameters[13].Value = model.C_dep_name; parameters[14].Value = model.C_emp_id; parameters[15].Value = model.C_emp_name; parameters[16].Value = model.F_dep_id; parameters[17].Value = model.F_dep_name; parameters[18].Value = model.F_emp_id; parameters[19].Value = model.F_emp_name; parameters[20].Value = model.receive_money; parameters[21].Value = model.arrears_money; parameters[22].Value = model.invoice_money; parameters[23].Value = model.arrears_invoice; parameters[24].Value = model.isDelete; parameters[25].Value = model.Delete_time; parameters[26].Value = model.id; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// �õ�һ������ʵ�� /// </summary> public XHD.Model.CRM_order GetModel(int id) { StringBuilder strSql=new StringBuilder(); strSql.Append("select top 1 id,Serialnumber,Customer_id,Customer_name,Order_date,pay_type_id,pay_type,Order_details,Order_status_id,Order_status,Order_amount,create_id,create_date,C_dep_id,C_dep_name,C_emp_id,C_emp_name,F_dep_id,F_dep_name,F_emp_id,F_emp_name,receive_money,arrears_money,invoice_money,arrears_invoice,isDelete,Delete_time,Pass_status_id,Pass_status,Pass_details,Follow_up_dep,Follow_up from CRM_order "); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int,4) }; parameters[0].Value = id; XHD.Model.CRM_order model=new XHD.Model.CRM_order(); DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters); if(ds.Tables[0].Rows.Count>0) { if(ds.Tables[0].Rows[0]["id"]!=null && ds.Tables[0].Rows[0]["id"].ToString()!="") { model.id=int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } if(ds.Tables[0].Rows[0]["Serialnumber"]!=null && ds.Tables[0].Rows[0]["Serialnumber"].ToString()!="") { model.Serialnumber=ds.Tables[0].Rows[0]["Serialnumber"].ToString(); } if(ds.Tables[0].Rows[0]["Customer_id"]!=null && ds.Tables[0].Rows[0]["Customer_id"].ToString()!="") { model.Customer_id=int.Parse(ds.Tables[0].Rows[0]["Customer_id"].ToString()); } if(ds.Tables[0].Rows[0]["Customer_name"]!=null && ds.Tables[0].Rows[0]["Customer_name"].ToString()!="") { model.Customer_name=ds.Tables[0].Rows[0]["Customer_name"].ToString(); } if(ds.Tables[0].Rows[0]["Order_date"]!=null && ds.Tables[0].Rows[0]["Order_date"].ToString()!="") { model.Order_date=DateTime.Parse(ds.Tables[0].Rows[0]["Order_date"].ToString()); } if(ds.Tables[0].Rows[0]["pay_type_id"]!=null && ds.Tables[0].Rows[0]["pay_type_id"].ToString()!="") { model.pay_type_id=int.Parse(ds.Tables[0].Rows[0]["pay_type_id"].ToString()); } if(ds.Tables[0].Rows[0]["pay_type"]!=null && ds.Tables[0].Rows[0]["pay_type"].ToString()!="") { model.pay_type=ds.Tables[0].Rows[0]["pay_type"].ToString(); } if(ds.Tables[0].Rows[0]["Order_details"]!=null && ds.Tables[0].Rows[0]["Order_details"].ToString()!="") { model.Order_details=ds.Tables[0].Rows[0]["Order_details"].ToString(); } if(ds.Tables[0].Rows[0]["Order_status_id"]!=null && ds.Tables[0].Rows[0]["Order_status_id"].ToString()!="") { model.Order_status_id=int.Parse(ds.Tables[0].Rows[0]["Order_status_id"].ToString()); } if(ds.Tables[0].Rows[0]["Order_status"]!=null && ds.Tables[0].Rows[0]["Order_status"].ToString()!="") { model.Order_status=ds.Tables[0].Rows[0]["Order_status"].ToString(); } if(ds.Tables[0].Rows[0]["Order_amount"]!=null && ds.Tables[0].Rows[0]["Order_amount"].ToString()!="") { model.Order_amount=decimal.Parse(ds.Tables[0].Rows[0]["Order_amount"].ToString()); } if(ds.Tables[0].Rows[0]["create_id"]!=null && ds.Tables[0].Rows[0]["create_id"].ToString()!="") { model.create_id=int.Parse(ds.Tables[0].Rows[0]["create_id"].ToString()); } if(ds.Tables[0].Rows[0]["create_date"]!=null && ds.Tables[0].Rows[0]["create_date"].ToString()!="") { model.create_date=DateTime.Parse(ds.Tables[0].Rows[0]["create_date"].ToString()); } if(ds.Tables[0].Rows[0]["C_dep_id"]!=null && ds.Tables[0].Rows[0]["C_dep_id"].ToString()!="") { model.C_dep_id=int.Parse(ds.Tables[0].Rows[0]["C_dep_id"].ToString()); } if(ds.Tables[0].Rows[0]["C_dep_name"]!=null && ds.Tables[0].Rows[0]["C_dep_name"].ToString()!="") { model.C_dep_name=ds.Tables[0].Rows[0]["C_dep_name"].ToString(); } if(ds.Tables[0].Rows[0]["C_emp_id"]!=null && ds.Tables[0].Rows[0]["C_emp_id"].ToString()!="") { model.C_emp_id=int.Parse(ds.Tables[0].Rows[0]["C_emp_id"].ToString()); } if(ds.Tables[0].Rows[0]["C_emp_name"]!=null && ds.Tables[0].Rows[0]["C_emp_name"].ToString()!="") { model.C_emp_name=ds.Tables[0].Rows[0]["C_emp_name"].ToString(); } if(ds.Tables[0].Rows[0]["F_dep_id"]!=null && ds.Tables[0].Rows[0]["F_dep_id"].ToString()!="") { model.F_dep_id=int.Parse(ds.Tables[0].Rows[0]["F_dep_id"].ToString()); } if(ds.Tables[0].Rows[0]["F_dep_name"]!=null && ds.Tables[0].Rows[0]["F_dep_name"].ToString()!="") { model.F_dep_name=ds.Tables[0].Rows[0]["F_dep_name"].ToString(); } if(ds.Tables[0].Rows[0]["F_emp_id"]!=null && ds.Tables[0].Rows[0]["F_emp_id"].ToString()!="") { model.F_emp_id=int.Parse(ds.Tables[0].Rows[0]["F_emp_id"].ToString()); } if(ds.Tables[0].Rows[0]["F_emp_name"]!=null && ds.Tables[0].Rows[0]["F_emp_name"].ToString()!="") { model.F_emp_name=ds.Tables[0].Rows[0]["F_emp_name"].ToString(); } if(ds.Tables[0].Rows[0]["receive_money"]!=null && ds.Tables[0].Rows[0]["receive_money"].ToString()!="") { model.receive_money=decimal.Parse(ds.Tables[0].Rows[0]["receive_money"].ToString()); } if(ds.Tables[0].Rows[0]["arrears_money"]!=null && ds.Tables[0].Rows[0]["arrears_money"].ToString()!="") { model.arrears_money=decimal.Parse(ds.Tables[0].Rows[0]["arrears_money"].ToString()); } if(ds.Tables[0].Rows[0]["invoice_money"]!=null && ds.Tables[0].Rows[0]["invoice_money"].ToString()!="") { model.invoice_money=decimal.Parse(ds.Tables[0].Rows[0]["invoice_money"].ToString()); } if(ds.Tables[0].Rows[0]["arrears_invoice"]!=null && ds.Tables[0].Rows[0]["arrears_invoice"].ToString()!="") { model.arrears_invoice=decimal.Parse(ds.Tables[0].Rows[0]["arrears_invoice"].ToString()); } if(ds.Tables[0].Rows[0]["isDelete"]!=null && ds.Tables[0].Rows[0]["isDelete"].ToString()!="") { model.isDelete=int.Parse(ds.Tables[0].Rows[0]["isDelete"].ToString()); } if(ds.Tables[0].Rows[0]["Delete_time"]!=null && ds.Tables[0].Rows[0]["Delete_time"].ToString()!="") { model.Delete_time=DateTime.Parse(ds.Tables[0].Rows[0]["Delete_time"].ToString()); } if (ds.Tables[0].Rows[0]["Pass_status_id"] != null && ds.Tables[0].Rows[0]["Pass_status_id"].ToString() != "") { model.Pass_status_id = int.Parse(ds.Tables[0].Rows[0]["Pass_status_id"].ToString()); } if (ds.Tables[0].Rows[0]["Pass_status"] != null && ds.Tables[0].Rows[0]["Pass_status"].ToString() != "") { model.Pass_status = ds.Tables[0].Rows[0]["Pass_status"].ToString(); } if (ds.Tables[0].Rows[0]["Pass_details"] != null && ds.Tables[0].Rows[0]["Pass_details"].ToString() != "") { model.Pass_details = ds.Tables[0].Rows[0]["Pass_details"].ToString(); } if (ds.Tables[0].Rows[0]["Follow_up_dep"] != null && ds.Tables[0].Rows[0]["Follow_up_dep"].ToString() != "") { model.Follow_up_dep = ds.Tables[0].Rows[0]["Follow_up_dep"].ToString(); } if (ds.Tables[0].Rows[0]["Follow_up"] != null && ds.Tables[0].Rows[0]["Follow_up"].ToString() != "") { model.Follow_up = ds.Tables[0].Rows[0]["Follow_up"].ToString(); } return model; } else { return null; } }