Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     DataModel dm = new DataModel();
     lo = new LabOrder();
     if (Request.Params["week"] == null || Request.Params["week"] == "")
     {
         dm.ReturnJsonMsg(Response, 0, "未知周次!");
     }
     if (Request.Params["cls"] == null || Request.Params["cls"] == "")
     {
         dm.ReturnJsonMsg(Response, 0, "未知节次!");
     }
     if (Request.Params["wd"] == null || Request.Params["wd"] == "")
     {
         dm.ReturnJsonMsg(Response, 0, "未知工作日!");
     }
     if (Request.Params["lab"] == null || Request.Params["lab"] == "")
     {
         dm.ReturnJsonMsg(Response, 0, "未知实验室!");
     }
     lo.OrderCls = Convert.ToInt32(Request.Params["cls"]);
     lo.OrderWeek = Convert.ToInt32(Request.Params["week"]);
     lo.OrderWeekday = Convert.ToInt32(Request.Params["wd"]);
     //用户信息
     luser = dm.GetUser(Convert.ToInt32(Session["lxyLabUserID"]));
     //实验室信息
     lab = dm.GetLab(Convert.ToInt32(Request.Params["lab"]));
 }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lxyAuthor.validateAuthor(this);
            //lxyAuthor.validateAuthorJson(this);

            DataModel dm = new DataModel();
            defaultLab = dm.GetLab().LabID;
            Term term = dm.GetCurrntTerm();
            weeks = term.TermWeeks;
            currentWeek = (DateTime.Now - term.TermStartDay).Days / 7 + 1;
            us = dm.GetUser(Convert.ToInt32(Session["lxyLabUserID"]));
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            lxyAuthor.validateAuthorHtml(this);
            int userID =Convert.ToInt32( Session["lxyLabUserID"]);
            DataModel dm = new DataModel();

            lxyUser= dm.GetUser(userID);

            lxyUser = dm.GetUser(lxyUser.UserNumber);
            if (lxyUser.UserIdentity == 1)
            {
                //teacher
                userIdt = "教师";
                userNumLabel = "教工号";
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            lxyAuthor.validateAuthorJson(context);
            DataModel dm = new DataModel();
            int userID = Convert.ToInt32(context.Session["lxyLabUserID"]);
            LxyUser lxyUser = new LxyUser();
            lxyUser = dm.GetUser(userID);
            lxyUser.UserAccount = context.Request["UserAccount"];
            lxyUser.UserCollege = context.Request["UserCollege"];
            lxyUser.UserName = context.Request["UserName"];
            lxyUser.UserTel = context.Request["UserTel"];

            dm.SaveLxyUser(lxyUser);
            JsonData jd = new JsonData();
            jd["status"] = 1;
            jd["msg"] = "修改个人信息成功!";
            context.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            context.Response.Write(jd.ToJson());
            context.Response.End();
        }
        public void ProcessRequest(HttpContext context)
        {
            lxyAuthor.validateAuthorJson(context);
            int status = 0;
            string msg = "未知错误";

            if (context.Request["UserNewPwd"] != context.Request["UserComPwd"])
            {
                msg = "两次密码不一致!";
            }
            else
            {
                DataModel dm = new DataModel();
                int userID = Convert.ToInt32(context.Session["lxyLabUserID"]);
                LxyUser lxyUser = new LxyUser();
                lxyUser = dm.GetUser(userID);

                string oldPwd = context.Request.Params["UserOldPwd"];
                string newPwd = context.Request.Params["UserNewPwd"];
                if (lxyUser.UserPwd == SRLib.Des.EncryptDES(oldPwd, "SatanRabbit"))
                {

                    lxyUser.UserPwd = SRLib.Des.EncryptDES(newPwd, "SatanRabbit");
                    dm.SaveLxyUser(lxyUser);
                    status = 1;
                    msg = "修改密码成功!";
                }
                else
                {
                    msg = "原密码错误!";
                }
            }
            JsonData jd = new JsonData();
            jd["status"] = status;
            jd["msg"] = msg;
            context.Response.AddHeader("Content-Type", "text/html; charset=UTF-8");
            context.Response.Write(jd.ToJson());
            context.Response.End();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Params["id"] == null || Request.Params["id"].Trim() == "")
            {
                hasOrder = false;
            }
            else
            {
                DataModel dm=new DataModel();
                int id = Convert.ToInt32(Request.Params["id"].Trim());
                lo = dm.GetLabOrder(id);
                if (lo != null)
                {
                    luser = dm.GetUser(lo.OrderUser);
                    inos = dm.GetLabOrderInst(lo.OrderID);
                }
                else
                {
                    hasOrder = false;
                }

            }
        }
Exemple #7
0
 public List<LxyUser> GetUsers()
 {
     List<LxyUser> users = new List<LxyUser>();
     InitCommand();
     cmd.CommandText = "select * from User_tb";
     dr = cmd.ExecuteReader();
     while (dr.Read())
     {
         LxyUser lt = new LxyUser();
         lt.UserAccount = dr["UserAccount"].ToString();
         lt.UserCollege = dr["UserCollege"].ToString();
         lt.UserName = dr["UserName"].ToString();
         lt.UserNumber = dr["UserNumber"].ToString();
         lt.UserTel = dr["UserTel"].ToString();
         lt.UserID = Convert.ToInt32(dr["UserID"]);
         lt.UserIdentity = Convert.ToInt32(dr["UserIdentity"]);
         users.Add(lt);
     }
     // lts.Find(delegate(LabChType lct) { return lct.LabChID == 1; });
     dr.Close();
     conn.Close();
     return users;
 }
Exemple #8
0
 public LxyUser GetUser(int id)
 {
     LxyUser lxyUser=new LxyUser();
     InitCommand();
     string cmdText = "select * from User_tb where UserID = @UserID";
     cmd.CommandText = cmdText;
     cmd.Parameters.AddWithValue("@UserID", id);
     dr = cmd.ExecuteReader();
     if (dr.Read())
     {
         lxyUser.UserAccount = dr["UserAccount"].ToString();
         lxyUser.UserCollege = dr["UserCollege"].ToString();
         lxyUser.UserIdentity = Convert.ToInt32(dr["UserIdentity"]);
         lxyUser.UserName = dr["UserName"].ToString();
         lxyUser.UserNumber = dr["UserNumber"].ToString(); ;
         lxyUser.UserPwd = dr["UserPwd"].ToString();
         lxyUser.UserTel = dr["UserTel"].ToString();
         lxyUser.UserID = Convert.ToInt32(dr["UserID"]);
     }
     conn.Close();
     return lxyUser;
 }
Exemple #9
0
 public int SaveLxyUser(LxyUser user)
 {
     InitCommand();
     if (user.UserID == 0)
     {
         //Insert new user
         cmd.CommandText = "INSERT INTO User_tb (UserName,UserPwd,UserAccount,UserNumber,UserTel,UserIdentity,UserCollege) VALUES (@userName,@userPwd,@userAccount,@userNumber,@userTel,@userIdentity,@userCollege)";
         cmd.Parameters.Clear();
         cmd.Parameters.AddWithValue("@userName", user.UserName);
         cmd.Parameters.AddWithValue("@userPwd", user.UserPwd);
         cmd.Parameters.AddWithValue("@userAccount", user.UserAccount);
         cmd.Parameters.AddWithValue("@userNumber", user.UserNumber);
         cmd.Parameters.AddWithValue("@userTel", user.UserTel);
         cmd.Parameters.AddWithValue("@userIdentity", user.UserIdentity);
         cmd.Parameters.AddWithValue("@userCollege", user.UserCollege);
         cmd.ExecuteNonQuery();
         cmd.CommandText = "SELECT @@Identity ";
         user.UserID = (int)cmd.ExecuteScalar();
     }
     else
     {
         cmd = new OleDbCommand();
         cmd.Connection = conn;
         cmd.CommandText = "UPDATE User_tb SET  " +
         " UserName=@userName,UserPwd=@userPwd,UserAccount=@userAccount,UserNumber=@userNumber,UserTel=@userTel,"+
        " UserIdentity=@userIdentity,UserCollege=@userCollege where UserID=@userID";
         cmd.Parameters.Clear();
         cmd.Parameters.AddWithValue("@userName", user.UserName);
         cmd.Parameters.AddWithValue("@userPwd", user.UserPwd);
         cmd.Parameters.AddWithValue("@userAccount", user.UserAccount);
         cmd.Parameters.AddWithValue("@userNumber", user.UserNumber);
         cmd.Parameters.AddWithValue("@userTel", user.UserTel);
         cmd.Parameters.AddWithValue("@userIdentity", user.UserIdentity);
         cmd.Parameters.AddWithValue("@userCollege", user.UserCollege);
         cmd.Parameters.AddWithValue("@userID", user.UserID);
         cmd.ExecuteNonQuery();
     }
     conn.Close();
     return user.UserID;
 }