public static int Delete(Userinfo model,object trans) { if(model != null && trans !=null ) return baseOperate.Delete(model,trans); else throw new ApplicationException("在dbo.UserInfo中删除一条记录时,传递的参数model,trans有错误!"); }
public static int Delete(Userinfo model) { if(model != null) return baseOperate.Delete(model); else throw new ApplicationException("在dbo.UserInfo中删除一条记录时,传递的参数model为Null!");; }
public static int Insert(Userinfo model) { if(model != null) return baseOperate.Insert(model); else throw new ApplicationException("在dbo.UserInfo中增加一条记录时,传递的参数model为Null!"); }
protected void btnInsertUserInfo_Click(object sender, EventArgs e) { //插入学生信息 string ciStr = ""; foreach (Classinfo ci in BizClassinfo.GetList()) { ciStr += ci.Bjid + ","; } ciStr = ciStr.Substring(0, ciStr.Length - 1); string njStr = ""; foreach (Gradeinfo nj in BizGradeinfo.GetList()) { njStr += nj.Njid + ","; } njStr = njStr.Substring(0, njStr.Length - 1); string[] ciArray = ciStr.Split(','); string[] njArray = njStr.Split(','); for (int i = 0; i < 33; i++) { Userinfo userObj = new Userinfo(); userObj.Bjid = ciArray[new Random().Next(0, ciArray.Length - 1)]; userObj.Csrq = "1987-11-18"; userObj.Dh = "1387311184" + i.ToString().Substring(0, 1); userObj.Dz = "湖南长沙"; userObj.Mm = "123456"; userObj.Njid = njArray[new Random().Next(0, ciArray.Length - 1)]; userObj.Qq = "99550677" + i.ToString().Substring(0, 1); userObj.Sfz = "43012219871118671" + i.ToString().Substring(0, 1); userObj.Xb = (i % 2).ToString(); userObj.Xh = "0665303" + (i + 32).ToString(); userObj.Xl = new Random().Next(0, 3).ToString(); userObj.Xm = "刘巨" + i.ToString(); userObj.Xsid = Guid.NewGuid().ToString(); userObj.Yx = "*****@*****.**"; userObj.Zp = "sys.jpg"; BizUserinfo.Insert(userObj); } LABMsg.Text = "插入学生信息成功"; }
public static bool Exists(Userinfo model) { if(model != null ) return baseOperate.Exists(model); else throw new ApplicationException("在dbo.UserInfo中查询某条记录是否存在时,传递的参数model为Null!"); }
public static Userinfo GetModel(Userinfo model) { if(model != null ) return baseOperate.GetModel(model); else throw new ApplicationException("根据主键获取dbo.UserInfo中的一条记录时,传递的参数model为Null!"); }