public M_MailIdiograph GetModelFromReader(DbDataReader rdr) { M_MailIdiograph model = new M_MailIdiograph(); model.ID = Convert.ToInt32(rdr["ID"]); model.Name = ConverToStr(rdr["Name"]); model.CDate = ConvertToDate(rdr["CDate"]); model.State = ConvertToInt(rdr["State"]); model.Context = ConverToStr(rdr["Context"]); model.ZType = ConvertToInt(rdr["ZType"]); model.UserID = ConvertToInt(rdr["UserID"]); model.AdminID = ConvertToInt(rdr["AdminID"]); rdr.Close(); rdr.Dispose(); return(model); }
public override SqlParameter[] GetParameters() { M_MailIdiograph model = this; if (model.CDate <= DateTime.MinValue) { model.CDate = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.Name; sp[2].Value = model.CDate; sp[3].Value = model.State; sp[4].Value = model.Context; sp[5].Value = model.ZType; sp[6].Value = model.UserID; sp[7].Value = model.AdminID; return(sp); }