Example #1
0
        private void SetUserInfo()
        {
            DbLanguage language = DbLanguageQuery.FindByIdentity(UserAccount.CurrentLanguageID);
            //UserEngine.SetLanguage(language.Languageid);
            //ctlFlagImage.ImageUrl = DbParameterQuery.getParameterByGroupNo_SeqNo("1","7").ToString()+language.ImagePath;

            //if (UserAccount.CurrentLanguageCode.ToString().Equals("th") || UserAccount.CurrentLanguageCode.ToString().Equals("th-TH") || UserAccount.CurrentLanguageCode.ToString().Equals("THA"))
            // ctl_Loged_FullName_Label.Text = UserAccount.FirstName + "   "+ UserAccount.LastName;// "อภิเดช วงษา";
            // else
            //     ctl_Loged_FullName_Label.Text = "Apidesh Wongsa";

            //TODO:
            // Change UserAccount.FirstName + "  " + UserAccount.LastName to UserAccount name by language
        }
Example #2
0
        private SuUser GetSuUserInfo(SuUser user)
        {
            TextBox      ctlUserName     = ctlUserForm.FindControl("ctlUserName") as TextBox;
            TextBox      ctlPassword     = ctlUserForm.FindControl("ctlPassword") as TextBox;
            TextBox      ctlFailTime     = ctlUserForm.FindControl("ctlFailTime") as TextBox;
            TextBox      ctlComment      = ctlUserForm.FindControl("ctlComment") as TextBox;
            DropDownList ctlOrganization = ctlUserForm.FindControl("ctlOrganization") as DropDownList;
            DropDownList ctlDivision     = ctlUserForm.FindControl("ctlDivision") as DropDownList;
            DropDownList ctlLanguage     = ctlUserForm.FindControl("ctlLanguage") as DropDownList;

            UserControls.Calendar ctlEffDate = ctlUserForm.FindControl("ctlEffDate") as UserControls.Calendar;
            UserControls.Calendar ctlEndDate = ctlUserForm.FindControl("ctlEndDate") as UserControls.Calendar;
            CheckBox ctlChangePassword       = ctlUserForm.FindControl("ctlChangePassword") as CheckBox;
            CheckBox chkActive = ctlUserForm.FindControl("chkActive") as CheckBox;

            user.UserName = ctlUserName.Text;
            user.Password = "";
            //user.Password = UserEngine.Md5Hash(user.Password);
            //user.EffDate = UIHelper.ParseDate(ctlEffDate.DateValue, Helper.Constant.DateFormat).Value;
            //user.EndDate = UIHelper.ParseDate(ctlEndDate.DateValue, Helper.Constant.DateFormat).Value;
            user.FailTime       = UIHelper.ParseShort(ctlFailTime.Text);
            user.SetFailTime    = 0;
            user.Comment        = ctlComment.Text;
            user.ChangePassword = ctlChangePassword.Checked;
            user.Active         = chkActive.Checked;
            //user.Organization = SuOrganizationQuery.FindByIdentity(UIHelper.ParseShort(ctlOrganization.SelectedValue));
            //user.Division = SuDivisionQuery.FindByIdentity(UIHelper.ParseShort(ctlDivision.SelectedValue));
            user.Language = DbLanguageQuery.FindByIdentity(UIHelper.ParseShort(ctlLanguage.SelectedValue));

            user.CreBy   = UserAccount.UserID; //null;//UserAccount.UserID;
            user.CreDate = DateTime.Now.Date;
            user.UpdBy   = UserAccount.UserID; //"";  //UserAccount.UserID;
            user.UpdDate = DateTime.Now.Date;
            user.UpdPgm  = ProgramCode;

            return(user);
        }