/// <summary> /// 更新一条数据 /// </summary> public bool Update(XHD.Model.CRM_Contact model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(XHD.Model.CRM_Contact model) { return(dal.Add(model)); }
/// <summary> /// ��������б� /// </summary> public List<XHD.Model.CRM_Contact> DataTableToList(DataTable dt) { List<XHD.Model.CRM_Contact> modelList = new List<XHD.Model.CRM_Contact>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { XHD.Model.CRM_Contact model; for (int n = 0; n < rowsCount; n++) { model = new XHD.Model.CRM_Contact(); if(dt.Rows[n]["id"]!=null && dt.Rows[n]["id"].ToString()!="") { model.id=int.Parse(dt.Rows[n]["id"].ToString()); } if(dt.Rows[n]["C_name"]!=null && dt.Rows[n]["C_name"].ToString()!="") { model.C_name=dt.Rows[n]["C_name"].ToString(); } if(dt.Rows[n]["C_sex"]!=null && dt.Rows[n]["C_sex"].ToString()!="") { model.C_sex=dt.Rows[n]["C_sex"].ToString(); } if(dt.Rows[n]["C_department"]!=null && dt.Rows[n]["C_department"].ToString()!="") { model.C_department=dt.Rows[n]["C_department"].ToString(); } if(dt.Rows[n]["C_position"]!=null && dt.Rows[n]["C_position"].ToString()!="") { model.C_position=dt.Rows[n]["C_position"].ToString(); } if(dt.Rows[n]["C_birthday"]!=null && dt.Rows[n]["C_birthday"].ToString()!="") { model.C_birthday=dt.Rows[n]["C_birthday"].ToString(); } if(dt.Rows[n]["C_tel"]!=null && dt.Rows[n]["C_tel"].ToString()!="") { model.C_tel=dt.Rows[n]["C_tel"].ToString(); } if(dt.Rows[n]["C_fax"]!=null && dt.Rows[n]["C_fax"].ToString()!="") { model.C_fax=dt.Rows[n]["C_fax"].ToString(); } if(dt.Rows[n]["C_email"]!=null && dt.Rows[n]["C_email"].ToString()!="") { model.C_email=dt.Rows[n]["C_email"].ToString(); } if(dt.Rows[n]["C_mob"]!=null && dt.Rows[n]["C_mob"].ToString()!="") { model.C_mob=dt.Rows[n]["C_mob"].ToString(); } if(dt.Rows[n]["C_QQ"]!=null && dt.Rows[n]["C_QQ"].ToString()!="") { model.C_QQ=dt.Rows[n]["C_QQ"].ToString(); } if(dt.Rows[n]["C_add"]!=null && dt.Rows[n]["C_add"].ToString()!="") { model.C_add=dt.Rows[n]["C_add"].ToString(); } if(dt.Rows[n]["C_hobby"]!=null && dt.Rows[n]["C_hobby"].ToString()!="") { model.C_hobby=dt.Rows[n]["C_hobby"].ToString(); } if(dt.Rows[n]["C_remarks"]!=null && dt.Rows[n]["C_remarks"].ToString()!="") { model.C_remarks=dt.Rows[n]["C_remarks"].ToString(); } if(dt.Rows[n]["C_customerid"]!=null && dt.Rows[n]["C_customerid"].ToString()!="") { model.C_customerid=int.Parse(dt.Rows[n]["C_customerid"].ToString()); } if(dt.Rows[n]["C_customername"]!=null && dt.Rows[n]["C_customername"].ToString()!="") { model.C_customername=dt.Rows[n]["C_customername"].ToString(); } if(dt.Rows[n]["C_createId"]!=null && dt.Rows[n]["C_createId"].ToString()!="") { model.C_createId=int.Parse(dt.Rows[n]["C_createId"].ToString()); } if(dt.Rows[n]["C_createDate"]!=null && dt.Rows[n]["C_createDate"].ToString()!="") { model.C_createDate=DateTime.Parse(dt.Rows[n]["C_createDate"].ToString()); } if(dt.Rows[n]["isDelete"]!=null && dt.Rows[n]["isDelete"].ToString()!="") { model.isDelete=int.Parse(dt.Rows[n]["isDelete"].ToString()); } if(dt.Rows[n]["Delete_time"]!=null && dt.Rows[n]["Delete_time"].ToString()!="") { model.Delete_time=DateTime.Parse(dt.Rows[n]["Delete_time"].ToString()); } modelList.Add(model); } } return modelList; }
/// <summary> /// 获得数据列表 /// </summary> public List <XHD.Model.CRM_Contact> DataTableToList(DataTable dt) { List <XHD.Model.CRM_Contact> modelList = new List <XHD.Model.CRM_Contact>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { XHD.Model.CRM_Contact model; for (int n = 0; n < rowsCount; n++) { model = new XHD.Model.CRM_Contact(); if (dt.Rows[n]["id"] != null && dt.Rows[n]["id"].ToString() != "") { model.id = int.Parse(dt.Rows[n]["id"].ToString()); } if (dt.Rows[n]["C_name"] != null && dt.Rows[n]["C_name"].ToString() != "") { model.C_name = dt.Rows[n]["C_name"].ToString(); } if (dt.Rows[n]["C_sex"] != null && dt.Rows[n]["C_sex"].ToString() != "") { model.C_sex = dt.Rows[n]["C_sex"].ToString(); } if (dt.Rows[n]["C_department"] != null && dt.Rows[n]["C_department"].ToString() != "") { model.C_department = dt.Rows[n]["C_department"].ToString(); } if (dt.Rows[n]["C_position"] != null && dt.Rows[n]["C_position"].ToString() != "") { model.C_position = dt.Rows[n]["C_position"].ToString(); } if (dt.Rows[n]["C_birthday"] != null && dt.Rows[n]["C_birthday"].ToString() != "") { model.C_birthday = dt.Rows[n]["C_birthday"].ToString(); } if (dt.Rows[n]["C_tel"] != null && dt.Rows[n]["C_tel"].ToString() != "") { model.C_tel = dt.Rows[n]["C_tel"].ToString(); } if (dt.Rows[n]["C_fax"] != null && dt.Rows[n]["C_fax"].ToString() != "") { model.C_fax = dt.Rows[n]["C_fax"].ToString(); } if (dt.Rows[n]["C_email"] != null && dt.Rows[n]["C_email"].ToString() != "") { model.C_email = dt.Rows[n]["C_email"].ToString(); } if (dt.Rows[n]["C_mob"] != null && dt.Rows[n]["C_mob"].ToString() != "") { model.C_mob = dt.Rows[n]["C_mob"].ToString(); } if (dt.Rows[n]["C_QQ"] != null && dt.Rows[n]["C_QQ"].ToString() != "") { model.C_QQ = dt.Rows[n]["C_QQ"].ToString(); } if (dt.Rows[n]["C_add"] != null && dt.Rows[n]["C_add"].ToString() != "") { model.C_add = dt.Rows[n]["C_add"].ToString(); } if (dt.Rows[n]["C_hobby"] != null && dt.Rows[n]["C_hobby"].ToString() != "") { model.C_hobby = dt.Rows[n]["C_hobby"].ToString(); } if (dt.Rows[n]["C_remarks"] != null && dt.Rows[n]["C_remarks"].ToString() != "") { model.C_remarks = dt.Rows[n]["C_remarks"].ToString(); } if (dt.Rows[n]["C_customerid"] != null && dt.Rows[n]["C_customerid"].ToString() != "") { model.C_customerid = int.Parse(dt.Rows[n]["C_customerid"].ToString()); } if (dt.Rows[n]["C_customername"] != null && dt.Rows[n]["C_customername"].ToString() != "") { model.C_customername = dt.Rows[n]["C_customername"].ToString(); } if (dt.Rows[n]["C_createId"] != null && dt.Rows[n]["C_createId"].ToString() != "") { model.C_createId = int.Parse(dt.Rows[n]["C_createId"].ToString()); } if (dt.Rows[n]["C_createDate"] != null && dt.Rows[n]["C_createDate"].ToString() != "") { model.C_createDate = DateTime.Parse(dt.Rows[n]["C_createDate"].ToString()); } if (dt.Rows[n]["isDelete"] != null && dt.Rows[n]["isDelete"].ToString() != "") { model.isDelete = int.Parse(dt.Rows[n]["isDelete"].ToString()); } if (dt.Rows[n]["Delete_time"] != null && dt.Rows[n]["Delete_time"].ToString() != "") { model.Delete_time = DateTime.Parse(dt.Rows[n]["Delete_time"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool UpdateContact(XHD.Model.CRM_Contact model, int userId) { return(dal.UpdateContact(model, userId)); }