public M_CRMS_Client GetModelFromReader(DataRow rdr) { M_CRMS_Client model = new M_CRMS_Client(); model.ID = ConvertToInt(rdr["ID"]); model.Flow = ConverToStr(rdr["Flow"]); model.ClientName = ConverToStr(rdr["ClientName"]); model.ClientLevel = ConverToStr(rdr["ClientLevel"]); model.ClientClass = ConverToStr(rdr["ClientClass"]); model.ClientType = ConverToStr(rdr["ClientType"]); model.ClientStatus = ConvertToInt(rdr["ClientStatus"]); model.WebSiteUrl = ConverToStr(rdr["WebSiteUrl"]); model.MicroBlogUrl = ConverToStr(rdr["MicroBlogUrl"]); model.Province = ConverToStr(rdr["Province"]); model.City = ConverToStr(rdr["City"]); model.County = ConverToStr(rdr["County"]); model.Address = ConverToStr(rdr["Address"]); model.ZipCode = ConverToStr(rdr["ZipCode"]); model.Fax = ConverToStr(rdr["Fax"]); model.Phone = ConverToStr(rdr["Phone"]); model.FUserID = ConvertToInt(rdr["FUserID"]); model.FUserName = ConverToStr(rdr["FUserName"]); model.FRemind = ConverToStr(rdr["FRemind"]); model.CAdminID = ConvertToInt(rdr["CAdminID"]); model.CUserID = ConvertToInt(rdr["CUserID"]); model.CDate = ConvertToDate(rdr["CDate"]); model.Remind = ConverToStr(rdr["Remind"]); model.ModelID = ConvertToInt(rdr["ModelID"]); model.ModelTable = ConverToStr(rdr["ModelTable"]); model.ItemID = ConvertToInt(rdr["ItemID"]); model.LinkIds = ConverToStr(rdr["LinkIds"]); return(model); }
public override SqlParameter[] GetParameters() { M_CRMS_Client model = this; SqlParameter[] sp = GetSP(); if (model.CDate <= DateTime.MinValue) { model.CDate = DateTime.Now; } sp[0].Value = model.ID; sp[1].Value = model.Flow; sp[2].Value = model.ClientName; sp[3].Value = model.ClientLevel; sp[4].Value = model.ClientClass; sp[5].Value = model.ClientType; sp[6].Value = model.ClientStatus; sp[7].Value = model.WebSiteUrl; sp[8].Value = model.MicroBlogUrl; sp[9].Value = model.Province; sp[10].Value = model.City; sp[11].Value = model.County; sp[12].Value = model.Address; sp[13].Value = model.ZipCode; sp[14].Value = model.Fax; sp[15].Value = model.Phone; sp[16].Value = model.FUserID; sp[17].Value = model.FUserName; sp[18].Value = model.FRemind; sp[19].Value = model.CAdminID; sp[20].Value = model.CUserID; sp[21].Value = model.CDate; sp[22].Value = model.Remind; sp[23].Value = model.ModelID; sp[24].Value = model.ModelTable; sp[25].Value = model.ItemID; sp[26].Value = model.LinkIds; return(sp); }