protected void btnSave_Click(object sender, EventArgs e)
        {
            if (ViewState["userMDL"] != null)
            {
                T_UsersInfo_MDL userMDL = ViewState["userMDL"] as T_UsersInfo_MDL;

                userMDL.UserName = UserName.Text;
                userMDL.Mobile   = Mobile.Text;
                userMDL.Fax      = Fax.Text;
                userMDL.Tel      = Tel.Text;
                userMDL.Passwd   = DESEncrypt.Encrypt(newPasswd2.Text);
                userinfoBLL.Update(userMDL);

                PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat(" T_UsersInfo;key=", userMDL.UserID,
                                                                                            ";UserName="******";LoginName=", userMDL.LoginName, ";ChangePassword.aspx密码重置"));


                if (ViewState["companyMDL"] != null)
                {
                    T_Company_MDL companyMDL = ViewState["companyMDL"] as T_Company_MDL;
                    companyMDL.CompanyName = CompanyName.Text.Trim();
                    companyBLL.Update(companyMDL);

                    PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat(" T_Company_MDL;key=", companyMDL.CompanyID,
                                                                                                ";CompanyName=", companyMDL.CompanyName, ";ChangePassword.aspx管理员更新档案馆名称"));
                }
                Common.MessageBox.FnLayerAlert(this.Page, "保存成功,新密码重新登录才有效!");
            }
        }
Exemple #2
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            T_Company_MDL model = new T_Company_MDL();

            if ((CommonEnum.PageState)ViewState["ps"] == CommonEnum.PageState.ADD)
            {
                model = ctrlCompanyBaseInfo1.GetModule(0);
                if (model != null)
                {
                    if (ConvertEx.ToInt(ctrlCompanyBaseInfo1.CompanyTypeID) == SystemSet._ARCHIVE)
                    {
                        model.IsCompany = false;                                    //这是档案馆,不是建设等单位
                    }
                    else
                    {
                        model.IsCompany = true;
                    }

                    model.CreateDate   = System.DateTime.Now;
                    model.CreateIP     = DNTRequest.GetIP();
                    model.CreateUserID = Common.Session.GetSessionInt("UserID"); //公司创建人

                    int CompanyID = companyBLL.Add(model);                       //单位ID

                    T_UsersInfo_MDL uiMdl = new T_UsersInfo_MDL();
                    uiMdl.UserName   = txtLogName.Text.Trim();
                    uiMdl.LoginName  = txtLogName.Text.Trim();
                    uiMdl.Passwd     = DESEncrypt.Encrypt(txtPwd.Text);
                    uiMdl.UserType   = SystemSet.EumUserType.SignatureUser.ToString();              //签章用户
                    uiMdl.TrainCount = 0;
                    uiMdl.Createdate = DateTime.Now;
                    uiMdl.Createdby  = "由" + Common.Session.GetSession("UserName") + "创建";
                    uiMdl.IsValid    = true;
                    uiMdl.RoleID     = ConvertEx.ToInt(ctrlSignatureRole.SelectValue);               //签章单位角色ID
                    uiMdl.CompanyID  = CompanyID;                                                    //所属单位
                    userBLL.Add(uiMdl);

                    PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_Company;key=", model.CompanyID,
                                                                                                ";CompanyCode=", model.CompanyCode, ";CompanyType=", model.CompanyType, ";CompanyName=", model.CompanyName, ";签章单位"));
                    PublicModel.writeLog(SystemSet.EumLogType.AddData.ToString(), string.Concat("T_UsersInfo;key=", uiMdl.UserID,
                                                                                                ";CompanyID=", uiMdl.CompanyID, ";UserName="******";LoginName=", uiMdl.LoginName, ";UserType=", uiMdl.UserType));
                }
            }
            if ((CommonEnum.PageState)ViewState["ps"] == CommonEnum.PageState.EDIT)
            {
                model = ctrlCompanyBaseInfo1.GetModule(ConvertEx.ToInt(ID));

                if (ViewState["UserID"] != null)
                {
                    T_UsersInfo_MDL User = userBLL.GetModel(ConvertEx.ToInt(ViewState["UserID"]));
                    if (User != null)
                    {
                        User.RoleID    = ConvertEx.ToInt(ctrlSignatureRole.SelectValue);                //签章单位角色ID
                        User.LoginName = txtLogName.Text.Trim();
                        User.Passwd    = DESEncrypt.Encrypt(txtPwd.Text.Trim());
                        userBLL.Update(User);

                        PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_UsersInfo;key=", User.UserID,
                                                                                                    ";CompanyID=", User.CompanyID, ";UserName="******";LoginName=", User.LoginName, ";UserType=", User.UserType));
                    }
                }
                if (model != null)
                {
                    companyBLL.Update(model);
                    PublicModel.writeLog(SystemSet.EumLogType.UpdData.ToString(), string.Concat("T_Company;key=", model.CompanyID,
                                                                                                ";CompanyCode=", model.CompanyCode, ";CompanyType=", model.CompanyType, ";CompanyName=", model.CompanyName, ";签章单位"));
                }
            }
            Common.MessageBox.CloseLayerOpenWeb(this.Page);
        }