public M_User_Cloud GetModelFromReader(DbDataReader rdr) { M_User_Cloud model = new M_User_Cloud(); model.Guid = ConverToStr(rdr["Guid"]); model.ID = Convert.ToInt32(rdr["ID"]); model.UserID = Convert.ToInt32(rdr["UserID"]); model.FileName = ConverToStr(rdr["FileName"]); model.VPath = ConverToStr(rdr["VPath"]); model.SFileName = ConverToStr(rdr["SFileName"]); model.FileType = ConvertToInt(rdr["FileType"]); model.CDate = ConvertToDate(rdr["CDate"]); model.FileSize = ConverToStr(rdr["FileSize"]); model.UpdateDate = ConvertToDate(rdr["UpdateDate"]); rdr.Close(); return(model); }
public override SqlParameter[] GetParameters() { M_User_Cloud model = this; SqlParameter[] sp = GetSP(); if (model.CDate <= DateTime.MinValue) { model.CDate = DateTime.Now; } if (model.UpdateDate <= DateTime.MinValue) { model.UpdateDate = DateTime.Now; } sp[0].Value = model.Guid; sp[1].Value = model.UserID; sp[2].Value = model.FileName; sp[3].Value = model.VPath; sp[4].Value = model.SFileName; sp[5].Value = model.FileType; sp[6].Value = model.CDate; sp[7].Value = model.FileSize; sp[8].Value = model.UpdateDate; return(sp); }