public M_Ucenter GetModelFromReader(DbDataReader rdr) { M_Ucenter model = new M_Ucenter(); model.ID = Convert.ToInt32(rdr["ID"]); model.WebSite = rdr["WebSite"].ToString(); model.UserAuth = ConverToStr(rdr["UserAuth"]); model.AskAuth = ConverToStr(rdr["AskAuth"]); model.ConAuth = ConverToStr(rdr["ConAuth"]); model.OtherAuth = ConverToStr(rdr["OtherAuth"]); model.AddTime = ConvertToDate(rdr["AddTime"]); model.Key = ConverToStr(rdr["Key"]); model.Status = ConvertToInt(rdr["Status"]); model.DBUName = ConverToStr(rdr["DBUName"]); model.DBPwd = ConverToStr(rdr["DBPwd"]); model.Alias = ConverToStr(rdr["Alias"]); model.Desc = ConverToStr(rdr["Desc"]); rdr.Close(); return(model); }
public override SqlParameter[] GetParameters() { M_Ucenter model = this; if (AddTime <= DateTime.MinValue) { AddTime = DateTime.Now; } SqlParameter[] sp = GetSP(); sp[0].Value = model.ID; sp[1].Value = model.WebSite; sp[2].Value = model.UserAuth; sp[3].Value = model.AskAuth; sp[4].Value = model.ConAuth; sp[5].Value = model.OtherAuth; sp[6].Value = model.AddTime; sp[7].Value = model.Key; sp[8].Value = model.Status; sp[9].Value = model.DBUName; sp[10].Value = model.DBPwd; sp[11].Value = model.Alias; sp[12].Value = model.Desc; return(sp); }