Beispiel #1
0
        //得到学生详细信息
        public List <object> getUserCardInfoDetails(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.学生表();


            if (SQLOption.Exists(userid))
            {
                newinfo = SQLOption.GetModel(userid);                //得到学生证实体类

                XueshengInfo = SQLXueshengInfo.GetModel(userid, ""); //得到学生信息
            }

            var data = new List <object>()
            {
                new { StuName        = newinfo.姓名, StuSex = XueshengInfo.性别, StuBirth = XueshengInfo.生日,
                      StuInstitution = XueshengInfo.学院,
                      StuPro         = XueshengInfo.专业,
                      StuClass       = XueshengInfo.班级,
                      StuId          = newinfo.学号,
                      StuFazhengTime = newinfo.发证日期,
                      StuYouxiaoTime = newinfo.效期,

                      Option = "测试", },
            };


            return(data);
        }
Beispiel #2
0
        //办证业务提交
        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);
        }
Beispiel #3
0
        //得到学生证基本信息
        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));
 }
        //学生注册信息

        public JObject SingupInfo(JObject info)
        {
            JObject reV        = new JObject();
            bool    StuAdd     = false;
            bool    SignUpExit = true;

            Maticsoft.BLL.学生表   StuSQL = new Maticsoft.BLL.学生表();
            Maticsoft.Model.学生表 newStu = new Maticsoft.Model.学生表();

            Maticsoft.BLL.登录表   SignupSQL = new Maticsoft.BLL.登录表();
            Maticsoft.Model.登录表 newSign   = new Maticsoft.Model.登录表();
            newStu.班级 = info["banji"].ToString();
            newStu.生日 = DateTime.ParseExact(info["stuBirth"].ToString(), "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture);
            newStu.性别 = info["stuGender"].ToString();
            newStu.姓名 = info["stuName"].ToString();
            newStu.学号 = info["stuId"].ToString();
            newStu.学院 = info["xueyuan"].ToString();
            newStu.专业 = info["zhuanye"].ToString();
            newStu.邮箱 = info["stuEmail"].ToString();


            newSign.账号 = info["stuId"].ToString();
            newSign.密码 = info["stuPs"].ToString();
            newSign.职务 = "学生";

            SignupSQL.Add(newSign);
            if (SignupSQL.Exists(newSign.账号))
            {
                if (!StuSQL.Exists(newStu.学号, newStu.邮箱))
                {
                    StuAdd = StuSQL.Add(newStu); //添加学生信息状态
                }
                else
                {
                    reV.Add("success", "false");
                    reV.Add("message", "学号已经注册");
                    return(reV);
                }
            }
            else
            {
                SignUpExit = false; //登录表不存在信息

                reV.Add("success", "false");
                reV.Add("message", "学号尚未录入无法注册");

                return(reV);
            }

            if (StuAdd)
            {
                reV.Add("success", "true");
                reV.Add("message", "注册成功");
            }
            else
            {
                reV.Add("success", "false");
                reV.Add("message", "注册失败");
            }

            return(reV);
        }