public override SqlParameter[] GetParameters() { M_API_JsonP model = this; if (model.CDate <= DateTime.MinValue) { model.CDate = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.Alias; sp[2].Value = model.MyPK; sp[3].Value = model.Fields; sp[4].Value = model.T1; sp[5].Value = model.T2; sp[6].Value = model.WhereStr; sp[7].Value = model.ONStr; sp[8].Value = model.OrderStr; sp[9].Value = model.Params; sp[10].Value = model.MyState; sp[11].Value = model.Remind; sp[12].Value = model.AdminID; sp[13].Value = model.CDate; sp[14].Value = model.Remark; return(sp); }
public M_API_JsonP GetModelFromReader(SqlDataReader rdr) { M_API_JsonP model = new M_API_JsonP(); model.ID = Convert.ToInt32(rdr["ID"]); model.Alias = ConverToStr(rdr["Alias"]); model.MyPK = ConverToStr(rdr["PK"]); model.Fields = ConverToStr(rdr["Fields"]); model.T1 = ConverToStr(rdr["T1"]); model.T2 = ConverToStr(rdr["T2"]); model.WhereStr = ConverToStr(rdr["WhereStr"]); model.ONStr = ConverToStr(rdr["ONStr"]); model.OrderStr = ConverToStr(rdr["OrderStr"]); model.Params = ConverToStr(rdr["Params"]); model.MyState = ConvertToInt(rdr["MyState"]); model.Remind = ConverToStr(rdr["Remind"]); model.AdminID = ConvertToInt(rdr["AdminID"]); model.CDate = ConvertToDate(rdr["CDate"]); model.Remark = ConverToStr(rdr["Remark"]); rdr.Close(); return(model); }