public override SqlParameter[] GetParameters() { M_Shop_MoneyRegular model = this; if (model.CDate <= DateTime.MinValue) { model.CDate = DateTime.Now; } if (model.EditDate <= DateTime.MinValue) { model.EditDate = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.Min; sp[2].Value = model.Purse; sp[3].Value = model.Sicon; sp[4].Value = model.Point; sp[5].Value = model.UserRemind; sp[6].Value = model.AdminRemind; sp[7].Value = model.AdminID; sp[8].Value = model.EditDate; sp[9].Value = model.CDate; sp[10].Value = model.StoreID; sp[11].Value = model.Alias; return(sp); }
public M_Shop_MoneyRegular GetModelFromReader(DbDataReader rdr) { M_Shop_MoneyRegular model = new M_Shop_MoneyRegular(); model.ID = Convert.ToInt32(rdr["ID"]); model.Min = ConverToDouble(rdr["Min"]); model.Purse = ConverToDouble(rdr["Purse"]); model.Sicon = ConverToDouble(rdr["Sicon"]); model.Point = ConverToDouble(rdr["Point"]); model.UserRemind = ConverToStr(rdr["UserRemind"]); model.AdminRemind = ConverToStr(rdr["AdminRemind"]); model.AdminID = ConvertToInt(rdr["AdminID"]); model.EditDate = ConvertToDate(rdr["EditDate"]); model.CDate = ConvertToDate(rdr["CDate"]); model.StoreID = ConvertToInt(rdr["StoreID"]); model.Alias = ConverToStr(rdr["Alias"]); rdr.Close(); return(model); }