示例#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
        }
示例#2
0
 public void BindLanguage()
 {
     if (ctlUserForm.CurrentMode != FormViewMode.ReadOnly)
     {
         DropDownList ctlLanguage = ctlUserForm.FindControl("ctlLanguage") as DropDownList;
         ctlLanguage.DataSource     = DbLanguageQuery.FindAll();
         ctlLanguage.DataTextField  = "LanguageID";
         ctlLanguage.DataValueField = "LanguageName";
         //ctlLanguage.DataBind();
     }
     //bllLang LanguageEntity = new bllLang();
     //List<SU_LANG> LanguageList = LanguageEntity.ListLang(true);
     //ddlLanguage.DataSource = LanguageList;
     //ddlLanguage.DataBind();
     //ddlLanguage.Items.Insert(0, new ListItem(lblSelectLanguage.Text, "0"));
 }
示例#3
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);
        }