public override SqlParameter[] GetParameters() { M_WX_RedPacket model = this; if (model.CDate <= DateTime.MinValue) { model.CDate = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.Remind; sp[2].Value = model.CDate; sp[3].Value = model.SDate; sp[4].Value = model.EDate; sp[5].Value = model.RedNum; sp[6].Value = model.AdminID; sp[7].Value = model.ZStatus; sp[8].Value = model.Name; sp[9].Value = model.Wishing; sp[10].Value = model.AmountRange; sp[11].Value = model.CodeFormat; sp[12].Value = model.AppID; sp[13].Value = model.Flow; return(sp); }
public M_WX_RedPacket GetModelFromReader(DbDataReader rdr) { M_WX_RedPacket model = new M_WX_RedPacket(); model.ID = ConvertToInt(rdr["ID"]); model.Remind = ConverToStr(rdr["Remind"]); model.CDate = ConvertToDate(rdr["CDate"]); model.SDate = ConvertToDate(rdr["SDate"]); model.EDate = ConvertToDate(rdr["EDate"]); model.RedNum = ConvertToInt(rdr["RedNum"]); model.AdminID = ConvertToInt(rdr["AdminID"]); model.ZStatus = ConvertToInt(rdr["ZStatus"]); model.Name = ConverToStr(rdr["Name"]); model.Wishing = ConverToStr(rdr["Wishing"]); model.AmountRange = ConverToStr(rdr["AmountRange"]); model.CodeFormat = ConverToStr(rdr["CodeFormat"]); model.AppID = ConvertToInt(rdr["AppID"]); model.Flow = ConverToStr(rdr["Flow"]); rdr.Close(); return(model); }