//办证业务提交 public List <object> SubmitBanzheng(string userid) { Maticsoft.Model.申请表 newinfo = new Maticsoft.Model.申请表(); Maticsoft.BLL.申请表 SQLOption = new Maticsoft.BLL.申请表(); Maticsoft.Model.学生表 XueshengInfo = new Maticsoft.Model.学生表(); Maticsoft.BLL.学生表 SQLXueshengInfo = new Maticsoft.BLL.学生表(); Maticsoft.Model.学生证表 Cardinfo = new Maticsoft.Model.学生证表(); Maticsoft.BLL.学生证表 SQLCardOp = new Maticsoft.BLL.学生证表(); XueshengInfo = SQLXueshengInfo.GetModel(userid, ""); Cardinfo.姓名 = XueshengInfo.姓名; Cardinfo.学号 = XueshengInfo.学号; //生成随机数 long tick = DateTime.Now.Ticks; Random ran = new Random((int)(tick & 0xffffffffL) | (int)(tick >> 32)); int iResult; int iUp = 100000; int iDown = 0; iResult = ran.Next(iDown, iUp); Cardinfo.学生证号 = "0020000021" + string.Format("{0:000000}", iResult); Cardinfo.学校地址 = "沈阳"; Cardinfo.发证日期 = DateTime.Now; Cardinfo.家庭地址 = ""; Cardinfo.效期 = DateTime.Now; newinfo.学号 = userid; newinfo.申请状态 = "未受理"; var data = new List <object>(); if (SQLOption.Add(newinfo) && SQLCardOp.Add(Cardinfo)) { data = new List <object>() { new { success = "true", message = "受理成功", }, }; } else { data = new List <object>() { new { success = "false", message = "受理失败", }, }; }; return(data); }
//得到学生证基本信息 public List <object> getUserCardInfo(string userid) { Maticsoft.Model.学生证表 newinfo = new Maticsoft.Model.学生证表(); Maticsoft.BLL.学生证表 SQLOption = new Maticsoft.BLL.学生证表(); Maticsoft.Model.申请表 ShenqingInfo = new Maticsoft.Model.申请表(); Maticsoft.BLL.申请表 SQLSHENOption = new Maticsoft.BLL.申请表(); Maticsoft.Model.学生表 XueshengInfo = new Maticsoft.Model.学生表(); Maticsoft.BLL.学生表 SQLXueshengInfo = new Maticsoft.BLL.学生表(); var data = new List <object>(); if (SQLXueshengInfo.Exists(userid, "")) { newinfo = SQLOption.GetModel(userid); //得到实体类 ShenqingInfo = SQLSHENOption.GetModel(userid); //得到申请信息 XueshengInfo = SQLXueshengInfo.GetModel(userid, ""); //得到学生信息 } if (newinfo == null || ShenqingInfo == null || XueshengInfo == null) { newinfo = new Maticsoft.Model.学生证表(); ShenqingInfo = new Maticsoft.Model.申请表(); //XueshengInfo = new Maticsoft.Model.学生表(); data = new List <object>() { new { CardId = newinfo.学生证号, StuId = newinfo.学号, Name = XueshengInfo.姓名, Status = ShenqingInfo.申请状态, Option = "测试", }, }; } data = new List <object>() { new { CardId = newinfo.学生证号, StuId = newinfo.学号, Name = XueshengInfo.姓名, Status = ShenqingInfo.申请状态, Option = "测试", }, }; return(data); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Maticsoft.Model.申请表 model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool Add(Maticsoft.Model.申请表 model) { return(dal.Add(model)); }