private void Page_Load(object sender, EventArgs e)
        {
            this.LoadMenu();
            UserProfile userProfile = UserAuthorize.GetUserProfile(this);

            this.employeeID         = int.Parse(userProfile.EmployeeID.ToString());
            this.LblSuccess.Visible = false;
            if (!base.IsPostBack)
            {
                this.LoadEmployee(this.employeeID);
            }
        }
Example #2
0
        private void LoadUserInformation()
        {
            DataTable summary = SmartAdmin.Data.Employee.EmployeeList(UserAuthorize.GetUserProfile(this).EmployeeID);

            if (summary == null)
            {
                base.Response.Redirect(Pages.Url(this, Pages.HOME_PAGE));
            }
            DataRow item = summary.Rows[0];

            this.LblEmpID.Text       = item["EmployeeID"].ToString();
            this.LblEmpName.Text     = string.Concat(item["FirstName"].ToString(), " ", item["LastName"].ToString());
            this.LblEmpNickName.Text = item["NickName"].ToString();
            this.LblEmpSex.Text      = (item["Sex"].ToString() == "M" ? "Male" : "Female");
            this.LblEmpType.Text     = item["EmployeeTypeName"].ToString();
            this.LblEmpSocialID.Text = item["SocialID"].ToString();
            this.LblUserName.Text    = this.LblEmpName.Text;
            if (item["LastLogin"] is DBNull || item["LastLogin"] == null)
            {
                this.LblLastLoginText.Text = "This is your first login to smartAdmin.";
            }
            else
            {
                Label    lblLastLoginText = this.LblLastLoginText;
                DateTime dateTime         = (DateTime)item["LastLogin"];
                lblLastLoginText.Text = string.Concat("Your last login is ", dateTime.ToString("dd MMM yyyy HH:mm:ss", Home.ci));
            }
            summary = SmartAdmin.Data.Master.GetSummary();
            if (summary != null)
            {
                item = summary.Rows[0];
                this.LblEmployeeCnt.Text  = item["EmpCount"].ToString();
                this.LblMenuTypeCnt.Text  = item["MenuTypeCount"].ToString();
                this.LblMenuItemCnt.Text  = item["MenuItemCount"].ToString();
                this.LblPromotionCnt.Text = item["PromotionCount"].ToString();
                this.LblTableCnt.Text     = item["TableCount"].ToString();
                this.LblCustomerCnt.Text  = item["CustomerCount"].ToString();
            }
        }