Example #1
0
        protected bool validate()
        {
            int intUserID      = (int)CheckUserInfo.GetUserId();
            var obj            = entities.TBL_NGUOI_DUNG.Where(x => x.Id == intUserID).FirstOrDefault();
            var md5OldPassword = Formats.GetMD5(txtOldPassword.Text);

            if (md5OldPassword != obj.Password)
            {
                Commons.ValidationFuncs.errorMessage_TimeDelay("Wrong password", Page);
                return(false);
            }

            if (txtNewPassword.Text != txtRetypeNewPassword.Text)
            {
                Commons.ValidationFuncs.errorMessage_TimeDelay("Your Retype Password does not match", Page);
                return(false);
            }

            return(true);
        }
Example #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (!validate())
            {
                return;
            }

            TBL_NGUOI_DUNG objUser;
            int            intUserID = (int)CheckUserInfo.GetUserId();

            objUser          = entities.TBL_NGUOI_DUNG.Where(x => x.Id == intUserID).FirstOrDefault();
            objUser.Password = Formats.GetMD5(txtNewPassword.Text);

            entities.SaveChanges();

            Commons.ValidationFuncs.displayMessage_UpdateSuccessfully("Password Changed!", Page);

            // sign out
            Session.Clear();
            //Response.Redirect("/SignIn.aspx");
        }
        public static CheckUserInfo  CheckInOut(int userID, int type)
        {
            CheckUserInfo tmp       = null;
            string        sqlString = " select  b.TestNotes as 'note', b.DoDate as 'doDate', a.OrderNo as 'orderNo', b.specimenid as 'sID' "
                                      + " from [LISSerV].[his].[dbo].LabOrder a join [LISSerV].[his].[dbo].labspecimen b on a.OrderNo = b.OrderNo "
                                      + " where a.Mrn = @MRN  and b.DoDate >= @DATESTART and b.DoDate <=@DATEEND and b.DoState >= '5' ";

            //       INSERT INTO CHECKINOUT
            //      (USERID,CHECKTIME,CHECKTYPE,VERIFYCODE,SENSORID,Memoinfo ,WorkCode,sn ,UserExtFmt)
            //VALUES
            //      (319,getdate(),'I',15,103,null,0,'3262155100034',1)


            SqlParameter[] cmdParms = new SqlParameter[] {
                new SqlParameter("@MRN", SqlDbType.Int),
                new SqlParameter("@DATESTART", SqlDbType.Int),
                new SqlParameter("@DATEEND", SqlDbType.Int)
            };
            cmdParms[0].Value = mrn;
            cmdParms[1].Value = dateStart;
            cmdParms[2].Value = dataEnd;

            DataSet ds = DbHelperSQL_18.Query(sqlString, cmdParms);

            DataTable dt = ds.Tables["ds"];

            //遍历行
            foreach (DataRow dr in dt.Rows)
            {
                //遍历列
                tmp          = new LabTest();
                tmp.testNote = dr["note"].ToString().Trim();
                tmp.doDate   = (int)dr["doDate"];
                tmp.sID      = int.Parse(dr["sID"].ToString().Trim());
                tmp.orderNo  = int.Parse(dr["orderNo"].ToString().Trim());
                rtnList.Add(tmp);
            }

            return(tmp);
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //If user is an anonymous
                if (ATCL_Consts.NUMBER_ANONYMOUS_USER_ID.ToString().Equals((String)Session[ATCL_Consts.SESSION_NAME_USER_ID]))
                {
                    return;
                }

                //Otherwise, get user's info
                CheckUserInfo.CheckLogin();
                int intUserID = (int)CheckUserInfo.GetUserId();
                var obj       = entities.TBL_NGUOI_DUNG.Where(x => x.Id == intUserID).FirstOrDefault();
                txtFullName.Text = String.Format(Commons.TitleConst.getTitleConst("WELCOME_USER"), obj.UserName);

                //get Menus
                SystemMenus objSysMenus = new SystemMenus();
                objSysMenus.getAdministratorMenus(lbMenus);

                //get Departments by UserID
                ATCL_Commons.getDropDownList_Departments_ByUserID(drpDepartments, intUserID, Session, entities);
            }
        }