protected void btnDel_Click(object sender, EventArgs e)
    {
        LinkButton btnTemp = new LinkButton();

        btnTemp          = (LinkButton)sender;
        htInputParameter = new Hashtable();
        htInputParameter.Add(ConstantsManager.MESSAGE_ID, "");

        htInputParameter.Add("ObjectID", btnTemp.CommandArgument.ToString());
        UserGroupLibrary instanceUserGroupLibrary = new UserGroupLibrary();

        instanceUserGroupLibrary.DeleteRecordInfo(htInputParameter);

        //记录日志开始
        string strLogTypeID = "A02";

        strMessageParam[0] = (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME];
        strMessageParam[1] = "用户组信息";
        strMessageParam[2] = (string)htInputParameter["ObjectID"];
        strMessageParam[3] = "删除";
        string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, strMessageParam);

        LogLibrary.LogWrite(strLogTypeID, strLogContent, (string)htInputParameter["ObjectID"], null, null);
        //记录日志结束

        QueryRecordInfo();
    }
Esempio n. 2
0
    public bool Upload()
    {
        bool error = true;

        if (RadAsyncUploadControl.UploadedFiles.Count > 0)
        {
            string strVirtualPath;
            int    maxSize;
            strVirtualPath = ConstantsManager.UPLOAD_OTHER_DIR;
            maxSize        = ConstantsManager.UPLOAD_ALL_SIZE * 1024 * 1024;
            strVirtualPath = "{0}/{1}/{2}".FormatInvariantCulture(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR, strVirtualPath, IDGenerateManager.UploadDirectoryNameGenerate());
            var uploadPath = Server.MapPath(strVirtualPath);
            if (!Directory.Exists(uploadPath))
            {
                Directory.CreateDirectory(uploadPath);
            }
            foreach (UploadedFile uploadedFile in RadAsyncUploadControl.UploadedFiles)
            {
                var file = uploadedFile;
                if (file != null)
                {
                    var extName = file.GetExtension().ToLower();
                    //var existExtName = RadAsyncUploadControl.AllowedFileExtensions.Any(ext => extName.Equals(ext, StringComparison.OrdinalIgnoreCase));
                    //if (!existExtName)
                    //{
                    //    Message = "<p>文件{0}格式错误</p>".FormatInvariantCulture(file.FileName);
                    //    error = false;
                    //}
                    if (file.ContentLength >= maxSize)
                    {
                        Message = "<p>文件{0}大小限制在{1}MB之内</p>".FormatInvariantCulture(file.FileName, maxSize / (1024 * 1024));
                        error   = false;
                    }
                }
            }
            if (error)
            {
                Files = FileName.Value.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                foreach (UploadedFile uploadedFile in RadAsyncUploadControl.UploadedFiles)
                {
                    var file = uploadedFile;
                    if (file != null)
                    {
                        var extName        = file.GetExtension().ToLower();
                        var uploadFileName = "{0}_{1}{2}".FormatInvariantCulture(file.GetNameWithoutExtension(), DateTime.Now.ToString("yyMMddhhmmss"), extName);
                        var fullFileName   = Path.Combine(uploadPath, uploadFileName);
                        file.SaveAs(fullFileName, true);
                        var filename = "{0}{1}".FormatInvariantCulture(strVirtualPath, uploadFileName);
                        Files.Add(filename);
                    }
                }
                Text = string.Join(",", Files);
                //记录日志开始
                string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0013, new string[] { (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME], Text });
                LogLibrary.LogWrite("A01", strLogContent, null, null, null);
                //记录日志结束
            }
        }
        return(error);
    }
 protected bool ValidateUserIsLogined()
 {
     if (DataValidateManager.ValidateIsNull(Session[ConstantsManager.SESSION_USER_ID]) == false &&
         DataValidateManager.ValidateIsNull(Session[ConstantsManager.SESSION_USER_GROUP_ID]) == false &&
         DataValidateManager.ValidateIsNull(Session[ConstantsManager.SESSION_USER_NICK_NAME]) == false
         // && DataValidateManager.ValidateIsNull(Session[ConstantsManager.SESSION_SSDW_ID]) == false
         && DataValidateManager.ValidateIsNull(Session[ConstantsManager.SESSION_USER_LOGIN_NAME]) == false)
     {
         currentUserInfo = T_PM_UserInfoBusinessEntity.GetDataByKey(new T_PM_UserInfoApplicationData()
         {
             UserID = (string)Session[ConstantsManager.SESSION_USER_ID],
         });
         return(true);
     }
     if (!string.IsNullOrWhiteSpace(Request.QueryString["lcode"]))
     {
         currentUserInfo = T_PM_UserInfoBusinessEntity.GetDataByKey(new T_PM_UserInfoApplicationData()
         {
             UserID = (string)(new T_PM_UserInfoBusinessEntity()).GetValueByFixCondition("lcode", (string)Request.QueryString["lcode"], "UserID"),
         });
         Session[ConstantsManager.SESSION_USER_ID]         = currentUserInfo.UserID;
         Session[ConstantsManager.SESSION_USER_GROUP_ID]   = currentUserInfo.UserGroupID;
         Session[ConstantsManager.SESSION_USER_LOGIN_NAME] = currentUserInfo.UserLoginName;
         Session[ConstantsManager.SESSION_SSDW_ID]         = currentUserInfo.SubjectID;
         Session[ConstantsManager.SESSION_USER_NICK_NAME]  = currentUserInfo.UserNickName;
         return(true);
     }
     if (DataValidateManager.ValidateIsNull(Request.Cookies[ConstantsManager.COOKIE_USER_ID]) == false &&
         DataValidateManager.ValidateIsNull(Request.Cookies[ConstantsManager.COOKIE_USER_GROUP_ID]) == false &&
         DataValidateManager.ValidateIsNull(Request.Cookies[ConstantsManager.COOKIE_USER_NICK_NAME]) == false
         // && DataValidateManager.ValidateIsNull(Request.Cookies[ConstantsManager.COOKIE_SSDW_ID]) == false
         && DataValidateManager.ValidateIsNull(Request.Cookies[ConstantsManager.COOKIE_USER_LOGIN_NAME]) == false)
     {
         Session[ConstantsManager.SESSION_USER_ID]         = Server.UrlDecode(Request.Cookies[ConstantsManager.COOKIE_USER_ID].Value.ToString());
         Session[ConstantsManager.SESSION_USER_GROUP_ID]   = Server.UrlDecode(Request.Cookies[ConstantsManager.COOKIE_USER_GROUP_ID].Value.ToString());
         Session[ConstantsManager.SESSION_USER_LOGIN_NAME] = Server.UrlDecode(Request.Cookies[ConstantsManager.COOKIE_USER_LOGIN_NAME].Value.ToString());
         Session[ConstantsManager.SESSION_SSDW_ID]         = Server.UrlDecode(Request.Cookies[ConstantsManager.COOKIE_SSDW_ID].Value.ToString());
         Session[ConstantsManager.SESSION_USER_NICK_NAME]  = Server.UrlDecode(Request.Cookies[ConstantsManager.COOKIE_USER_NICK_NAME].Value.ToString());
         currentUserInfo = T_PM_UserInfoBusinessEntity.GetDataByKey(new T_PM_UserInfoApplicationData()
         {
             UserID = (string)Session[ConstantsManager.SESSION_USER_ID],
         });
         //记录日志开始
         string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0001, new string[] { currentUserInfo.UserLoginName });
         LogLibrary.LogWrite("A01", strLogContent, null, null, null);
         //记录日志结束
         return(true);
     }
     currentUserInfo = null;
     return(false);
 }
 protected virtual void ModifyRecord()
 {
     if (GetModifyInputParameter())
     {
         DictionaryTypeApplicationLogic instanceDictionaryTypeApplicationLogic
             = (DictionaryTypeApplicationLogic)CreateApplicationLogicInstance(typeof(DictionaryTypeApplicationLogic));
         // 主表修改
         appData = instanceDictionaryTypeApplicationLogic.Modify(appData);
         // 相关表批量修改
         RelatedTableModifyBatch();
         MessageContent = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0015, new string[] { "字典类型", "修改" }, strMessageInfo);
         string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, new string[] { (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME], "字典类型", appData.DM.ToString(), "修改" });
         LogLibrary.LogWrite("A02", strLogContent, null, null, null);
         Page.CloseWindow(true);
     }
 }
 protected virtual void DeleteRecord()
 {
     if (GetDeleteInputParameter())
     {
         DictionaryTypeApplicationLogic instanceDictionaryTypeApplicationLogic
                 = (DictionaryTypeApplicationLogic)CreateApplicationLogicInstance(typeof(DictionaryTypeApplicationLogic));
         appData = instanceDictionaryTypeApplicationLogic.Delete(appData);
         string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, new string[] { (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME], "字典类型", (string)appData.ObjectIDBatch, "删除" });
         LogLibrary.LogWrite("A02", strLogContent, null, null, null);
     }
     else
     {
         // 对错误消息进行处理
         MessageContent = strMessageInfo;
         Session[ConstantsManager.SESSION_MESSAGE_TYPE] = "FaildPre";
     }
 }
Esempio n. 6
0
    //=====================================================================
    //  FunctionName : AddRecord
    /// <summary>
    /// 添加记录操作
    /// </summary>
    //=====================================================================
    protected override void AddRecord()
    {
        if (GetAddInputParameter())
        {
            T_PM_UserInfoApplicationLogic instanceT_PM_UserInfoApplicationLogic
                = (T_PM_UserInfoApplicationLogic)CreateApplicationLogicInstance(typeof(T_PM_UserInfoApplicationLogic));
            // 添加主表
            appData = instanceT_PM_UserInfoApplicationLogic.Add(appData);
            // 批量添加相关表
            RelatedTableAddBatch();
            if (appData.ResultCode == ApplicationDataBase.ResultState.Succeed)
            {
                // 对成功消息进行处理
                strMessageParam[0] = "用户信息";
                strMessageParam[1] = "添加";
                strMessageInfo     = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0015, strMessageParam, strMessageInfo);
                MessageContent     = strMessageInfo;

                // 记录日志开始
                string strLogTypeID = "A02";
                strMessageParam[0] = (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME];
                strMessageParam[1] = "用户信息";
                strMessageParam[2] = appData.UserLoginName.ToString();
                strMessageParam[3] = "添加";
                string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, strMessageParam);
                LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null);
                // 记录日志结束

                // 发送Email
                SendValidateMail(appData.UserLoginName, appData.UserNickName, DomainUrl, appData.vcode);

                // 成功后页面跳转
                Page.CloseWindow(true);
            }
            else
            {
                // 对失败消息进行处理
                strMessageParam[0] = "此编号";
                strMessageParam[1] = "用户信息";
                strMessageInfo     = MessageManager.GetMessageInfo(MessageManager.ERR_MSGID_0013, strMessageParam, strMessageInfo);
                MessageContent     = strMessageInfo;
                Session[ConstantsManager.SESSION_MESSAGE_TYPE] = "FaildPre";
            }
        }
    }
Esempio n. 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //记录日志开始
        string strLogTypeID = "A01";

        strMessageParam[0] = (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME];
        string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0010, strMessageParam);

        LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null);
        //记录日志结束
        Request.Cookies.Remove(ConstantsManager.COOKIE_USER_ID);
        Response.Cookies[ConstantsManager.COOKIE_USER_ID].Expires = DateTime.Now.AddDays(-1);
        Request.Cookies.Remove(ConstantsManager.COOKIE_PASSWORD);
        Response.Cookies[ConstantsManager.COOKIE_PASSWORD].Expires = DateTime.Now.AddDays(-1);
        Request.Cookies.Remove(ConstantsManager.COOKIE_SAVE_LOGIN_STATUS);
        Response.Cookies[ConstantsManager.COOKIE_SAVE_LOGIN_STATUS].Expires = DateTime.Now.AddDays(-1);
        Session.Abandon();
        Response.Redirect("Login.Aspx");
    }
 protected virtual void AddRecord()
 {
     if (GetAddInputParameter())
     {
         DictionaryTypeApplicationLogic instanceDictionaryTypeApplicationLogic
             = (DictionaryTypeApplicationLogic)CreateApplicationLogicInstance(typeof(DictionaryTypeApplicationLogic));
         // 添加主表
         appData = instanceDictionaryTypeApplicationLogic.Add(appData);
         // 批量添加相关表
         RelatedTableAddBatch();
         if (appData.ResultCode == ApplicationDataBase.ResultState.Succeed)
         {
             MessageContent = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0015, new string[] { "字典类型", "添加" }, strMessageInfo);
             string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, new string[] { (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME], "字典类型", appData.DM.ToString(), "添加" });
             LogLibrary.LogWrite("A02", strLogContent, null, null, null);
             Page.CloseWindow(true);
         }
         else
         {
             MessageContent = MessageManager.GetMessageInfo(MessageManager.ERR_MSGID_0013, new string[] { "此编号", "字典类型" }, strMessageInfo);
             Session[ConstantsManager.SESSION_MESSAGE_TYPE] = "FaildPre";
         }
     }
 }
Esempio n. 9
0
        protected virtual void Page_Init(object sender, EventArgs e)
        {
            if (CurrentPageFileName.Equals(WEBUI_SEARCH_FILENAME, StringComparison.OrdinalIgnoreCase))
            {
                Session[ConstantsManager.SESSION_CURRENT_PAGE] = CURRENT_PATH + "/" + WEBUI_SEARCH_FILENAME;
                CurrentAccessPermission = GetWebUISearchAccessPurviewID();
                SetCurrentAccessPermission();
                MessageContent = string.Empty;
                if (IsPostBack)
                {
                    if (string.Equals(Request.Params["__EVENTTARGET"], "ctl00$MainContentPlaceHolder$btnOperate", StringComparison.OrdinalIgnoreCase))
                    {
                        switch (Request["ctl00$MainContentPlaceHolder$ddlOperation"].ToLower())
                        {
                        case "remove":
                            CurrentAccessPermission = GetOperationDeletePurviewID();
                            break;

                        default:
                            break;
                        }
                    }
                    else if (string.Equals(Request.Params["__EVENTTARGET"], "ctl00$MainContentPlaceHolder$btnExportAllToFile", StringComparison.OrdinalIgnoreCase))
                    {
                        CurrentAccessPermission = OPERATION_EXPORTALL_PURVIEW_ID;
                    }
                }
            }
            else if (CurrentPageFileName.Equals(WEBUI_ADD_FILENAME, StringComparison.OrdinalIgnoreCase))
            {
                Session[ConstantsManager.SESSION_CURRENT_PAGE] = CURRENT_PATH + "/" + WEBUI_ADD_FILENAME;
                if (EditMode)
                {
                    CurrentAccessPermission = GetWebUIModifyAccessPurviewID();
                }
                else if (ViewMode)
                {
                    CurrentAccessPermission = GetWebUIDetailAccessPurviewID();
                }
                else if (AddMode)
                {
                    CurrentAccessPermission = GetWebUIAddAccessPurviewID();
                }
                else if (ImportDocMode)
                {
                    CurrentAccessPermission = OPERATION_IMPORT_PURVIEW_ID;
                }
                else if (ImportDSMode)
                {
                    CurrentAccessPermission = OPERATION_IMPORT_DS_PURVIEW_ID;
                }
                else
                {
                    CurrentAccessPermission = NO_ACCESS_PURVIEW_ID;
                }
                MessageContent = string.Empty;
            }
            else if (CurrentPageFileName.Equals(WEBUI_DETAIL_FILENAME, StringComparison.OrdinalIgnoreCase) ||
                     CurrentPageFileName.Equals(WEBUI_IMAGE_FILENAME, StringComparison.OrdinalIgnoreCase))
            {
                Session[ConstantsManager.SESSION_CURRENT_PAGE] = CURRENT_PATH + "/" + WEBUI_DETAIL_FILENAME;
                CurrentAccessPermission = GetWebUIDetailAccessPurviewID();
            }
            else if (CurrentPageFileName.Equals(WEBUI_STATISTIC_FILENAME, StringComparison.OrdinalIgnoreCase))
            {
                Session[ConstantsManager.SESSION_CURRENT_PAGE] = CURRENT_PATH + "/" + WEBUI_STATISTIC_FILENAME;
                CurrentAccessPermission = WEBUI_STATISTIC_ACCESS_PURVIEW_ID;
            }

            if (NeedLogin)
            {
                if (!ValidateUserIsLogined())
                {
                    // 未登录处理
                    strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0016, strMessageInfo);
                    //MessageContent = strMessageInfo;
                    Response.Redirect(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR + "/Administrator/Login.aspx");
                }
                //权限验证
                if (!DataValidateManager.ValidateIsNull(CurrentAccessPermission))
                {
                    AccessPermission = ValidateUserPagePurview();
                    if (!AccessPermission)
                    {
                        //记录日志
                        string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0004, new string[] { (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME], (string)CurrentAccessPermission });
                        LogLibrary.LogWrite("A03", strLogContent, null, null, null);

                        //对权限验证错误消息进行处理
                        MessageContent = strMessageInfo;
                        Session.Remove(ConstantsManager.SESSION_CURRENT_PURVIEW);
                    }
                }
            }
            // 页面中加入AJAX脚本
            String cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData", "context");
            String callbackScript;

            callbackScript = "function CallServerById(arg, context)"
                             + "{ document.getElementById(context).innerHTML = '信息读取中...';if(document.getElementById(arg).value != null){arg = document.getElementById(arg).value}else{arg = document.getElementById(arg).innerText};" + cbReference + ";}";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CallServerById", callbackScript, true);
            callbackScript = "function CallServer(arg, context)" + "{ " + cbReference + ";}";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true);
            callbackScript = "function ReceiveServerData(rValue, context){document.getElementById(context).innerHTML = rValue;}";
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "ReceiveServerData", callbackScript, true);
            if (MainContentPlaceHolder != null)
            {
                ProcessUIControlsInit();
            }
        }
        protected virtual Boolean GetCountInputParameter()
        {
            Boolean boolReturn = true;

            // 验证输入参数
            if (ValidateRequestParamter() == true)
            {
                if (DataValidateManager.ValidateIsNull(Request["CountField"]) == false)
                {
                    if (DataValidateManager.ValidateStringLengthRange(Request["CountField"].ToString(), 1, 50) == false)
                    {
                        strMessageParam[0] = "统计方式";
                        strMessageParam[1] = "1";
                        strMessageParam[2] = "50";
                        strMessageInfo     = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0004, strMessageParam, strMessageInfo);
                        boolReturn         = false;
                    }
                    else
                    {
                        appData.CountField = Request["CountField"].ToString();
                    }
                }
                else
                {
                    strMessageParam[0] = "统计方式";
                    strMessageInfo     = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0002, strMessageParam, strMessageInfo);
                    boolReturn         = false;
                }

                if (DataValidateManager.ValidateIsNull(ViewState["Sort"]) == false)
                {
                    if (DataValidateManager.ValidateBooleanFormat(ViewState["Sort"].ToString()) == false)
                    {
                        appData.Sort = DEFAULT_SORT;
                    }
                    else
                    {
                        appData.Sort = Convert.ToBoolean(ViewState["Sort"].ToString());
                    }
                }
                else
                {
                    appData.Sort = DEFAULT_SORT;
                }

                if (DataValidateManager.ValidateIsNull(ViewState["SortField"]) == false)
                {
                    if (DataValidateManager.ValidateStringFormat(ViewState["SortField"].ToString()) == false)
                    {
                        appData.SortField = "RecordID";
                    }
                    else
                    {
                        appData.SortField = ViewState["SortField"].ToString();
                    }
                }
                else
                {
                    appData.SortField = "RecordID";
                }
            }
            else
            {
                // 记录日志开始
                string strLogTypeID = "A04";
                strMessageParam[0] = (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME];
                string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0009, strMessageParam);
                LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null);
                // 记录日志结束

                // 对错误消息进行处理
                strMessageInfo = MessageManager.GetMessageInfo(MessageManager.ERR_MSGID_0027, strMessageInfo);
                MessageContent = strMessageInfo;
                Session[ConstantsManager.SESSION_MESSAGE_TYPE] = "FaildPre";
                Response.Redirect(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR + "/ErrorPage/CommonErrorPage.aspx");
                Response.End();
            }
            return(boolReturn);
        }
Esempio n. 11
0
    private void ValidateUserLogin()
    {
        htInputParameter = new Hashtable();
        htInputParameter.Add("UserLoginName", txtUserLoginName.Text);
        htInputParameter.Add("Password", txtPassword.Text);
        htInputParameter.Add("LastLoginIP", Request.ServerVariables["REMOTE_ADDR"]);
        htInputParameter.Add("lcodeFromUrl", Request.QueryString["lcode"]);
        htInputParameter.Add("UserID", null);
        htInputParameter.Add("UserGroupID", null);
        htInputParameter.Add("UserNickName", null);

        //对输入参数进行检验
        if (ValidateInputParameter() || !DataValidateManager.ValidateIsNull(Request.Cookies[ConstantsManager.COOKIE_SAVE_LOGIN_STATUS]))
        {
            if (((string)htInputParameter["Password"]).Length != 32)
            {
                htInputParameter["Password"] = SecurityManager.MD5(htInputParameter["Password"].ToString(), 32);
            }
            htOutputParameter = SystemValidateLibrary.ValidateUserLogin(htInputParameter);
            if (htOutputParameter[ConstantsManager.MESSAGE_ID] == DBNull.Value)
            {
                //初始化用户登录数据登录
                Session[ConstantsManager.SESSION_USER_ID]         = htOutputParameter["UserID"].ToString();
                Session[ConstantsManager.SESSION_USER_GROUP_ID]   = htOutputParameter["UserGroupID"].ToString();
                Session[ConstantsManager.SESSION_USER_LOGIN_NAME] = htOutputParameter["UserLoginName"].ToString();
                Session[ConstantsManager.SESSION_USER_NICK_NAME]  = htOutputParameter["UserNickName"].ToString();
                Session[ConstantsManager.SESSION_SSDW_ID]         = htOutputParameter["SubjectID"].ToString();
                Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_USER_ID, Server.UrlEncode(htOutputParameter["UserID"].ToString())));
                Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_USER_GROUP_ID, Server.UrlEncode(htOutputParameter["UserGroupID"].ToString())));
                Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_USER_LOGIN_NAME, Server.UrlEncode(htOutputParameter["UserLoginName"].ToString())));
                Response.Cookies[ConstantsManager.COOKIE_USER_LOGIN_NAME].Expires = DateTime.Now.AddDays(20);
                Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_USER_NICK_NAME, Server.UrlEncode(htOutputParameter["UserNickName"].ToString())));
                Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_SSDW_ID, Server.UrlEncode(htOutputParameter["SubjectID"].ToString())));
                if (chkSaveLoginStatus.Checked)
                {
                    Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_PASSWORD, Server.UrlEncode((string)htInputParameter["Password"])));
                    Response.Cookies[ConstantsManager.COOKIE_PASSWORD].Expires = DateTime.Now.AddDays(180);
                    Response.Cookies.Add(new HttpCookie(ConstantsManager.COOKIE_SAVE_LOGIN_STATUS, Server.UrlEncode("true")));
                    Response.Cookies[ConstantsManager.COOKIE_SAVE_LOGIN_STATUS].Expires = DateTime.Now.AddDays(180);
                }
                //得到登录成功消息
                strMessageInfo = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0001, strMessageInfo);

                //记录日志开始
                string strLogTypeID = "A01";
                strMessageParam[0] = htOutputParameter["UserLoginName"].ToString();
                string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0001, strMessageParam);
                LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null);
                //记录日志结束

                //添加用户在线信息开始
                //                RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationData appData = new RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationData();
                //                RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationLogic instanceT_PM_UserOnlineInfoApplicationLogic
                //= (RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationLogic)CreateApplicationLogicInstance(typeof(RICH.Common.BM.T_PM_UserOnlineInfo.T_PM_UserOnlineInfoApplicationLogic));
                //                appData.UserID = (string)Session[ConstantsManager.SESSION_USER_ID];
                //                appData.OPCode = RICH.Common.Base.ApplicationData.ApplicationDataBase.OPType.PK;
                //                instanceT_PM_UserOnlineInfoApplicationLogic.Delete(appData);
                //                appData.AccessDate = DateTime.Now;
                //                appData.AccessIP = RICH.Common.IM.IPAddessLibrary.GetRemoteTrueIP();
                //                //appData.AccessLocation = RICH.Common.IM.IPAddessLibrary.GetLocationFromIP(appData.AccessIP.ToString());
                //                appData = instanceT_PM_UserOnlineInfoApplicationLogic.Add(appData);
                //添加用户在线信息结束

                //对正确消息进行处理
                Response.Write(strMessageInfo);
                Response.Redirect(this.IsMobileDevice() && chkSaveLoginStatus.Checked
                                      ? "Default.aspx?lcode={0}".FormatInvariantCulture(htOutputParameter["lcode"])
                                      : "Default.aspx");
            }
            else
            {
                //记录日志开始
                string strLogTypeID = "A01";
                strMessageParam[0] = htOutputParameter["UserLoginName"].ToString();
                string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0002, strMessageParam);
                LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null);
                //记录日志结束

                strMessageInfo = MessageManager.GetMessageInfo((string)htOutputParameter[ConstantsManager.MESSAGE_ID], strMessageInfo);
                //对错误消息进行处理
                Session.Remove(ConstantsManager.SESSION_CURRENT_PURVIEW);
                MessageLabel.Text = strMessageInfo;
            }
        }
        else
        {
            //对错误消息进行处理
            Session.Remove(ConstantsManager.SESSION_CURRENT_PURVIEW);
            MessageLabel.Text = strMessageInfo;
        }
    }
    public bool Upload()
    {
        bool error = true;

        if (RadAsyncUploadControl.UploadedFiles.Count > 0)
        {
            string strVirtualPath;
            int    maxSize;
            switch (UploadFileType)
            {
            case FileUploadLibrary.UploadFileType.IMAGE_FILE_TYPE:
                strVirtualPath = ConstantsManager.UPLOAD_IMAGE_DIR;
                maxSize        = ConstantsManager.UPLOAD_IMAGE_SIZE * 1024 * 1024;
                break;

            case FileUploadLibrary.UploadFileType.MEDIA_FILE_TYPE:
                strVirtualPath = ConstantsManager.UPLOAD_VIDEO_DIR;
                maxSize        = ConstantsManager.UPLOAD_MEDIA_SIZE * 1024 * 1024;
                break;

            case FileUploadLibrary.UploadFileType.DOC_FILE_TYPE:
                strVirtualPath = ConstantsManager.UPLOAD_DOC_DIR;
                maxSize        = ConstantsManager.UPLOAD_DOC_SIZE * 1024 * 1024;
                break;

            case FileUploadLibrary.UploadFileType.ALL_FILE_TYPE:
            default:
                strVirtualPath = ConstantsManager.UPLOAD_OTHER_DIR;
                maxSize        = ConstantsManager.UPLOAD_ALL_SIZE * 1024 * 1024;
                break;
            }
            strVirtualPath = "{0}/{1}/{2}".FormatInvariantCulture(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR, strVirtualPath, IDGenerateManager.UploadDirectoryNameGenerate());
            var uploadPath = Server.MapPath(strVirtualPath);
            if (!Directory.Exists(uploadPath))
            {
                Directory.CreateDirectory(uploadPath);
            }
            foreach (UploadedFile uploadedFile in RadAsyncUploadControl.UploadedFiles)
            {
                var file = uploadedFile;
                if (file != null)
                {
                    var extName      = file.GetExtension().ToLower();
                    var existExtName = RadAsyncUploadControl.AllowedFileExtensions.Any(ext => extName.Equals(ext, StringComparison.OrdinalIgnoreCase));
                    if (!existExtName)
                    {
                        Message = "文件{0}格式错误".FormatInvariantCulture(file.FileName);
                        error   = false;
                    }
                    if (file.ContentLength >= maxSize)
                    {
                        Message = "文件{0}大小限制在{1}MB之内".FormatInvariantCulture(file.FileName, maxSize / (1024 * 1024));
                        error   = false;
                    }
                    else
                    {
                        var uploadFileName = "{0}.{1}".FormatInvariantCulture(IDGenerateManager.UploadFileNameGenerate(), extName);
                        var fullFileName   = Path.Combine(uploadPath, uploadFileName);
                        file.SaveAs(fullFileName, true);
                        Text = "{0}{1}".FormatInvariantCulture(strVirtualPath, uploadFileName);
                        //记录日志开始
                        string[] strMessageParam = { string.Empty, string.Empty, string.Empty, string.Empty };
                        string   strLogTypeID    = "A01";
                        strMessageParam[0] = Session[ConstantsManager.SESSION_USER_LOGIN_NAME].ToString();
                        strMessageParam[1] = Text;
                        string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0013, strMessageParam);
                        LogLibrary.LogWrite(strLogTypeID, strLogContent, null, null, null);
                        //记录日志结束
                    }
                }
            }
        }
        return(error);
    }
    protected void btnSetPurview_Click(object sender, EventArgs e)
    {
        string   strPurview, strDeletePurview;
        CheckBox chkTemp = new CheckBox();

        strPurview       = "";
        strDeletePurview = "";
        foreach (TableRow trTemp in FindControl("tbPurviewInfo").Controls)
        {
            foreach (TableCell tcTemp in trTemp.Controls)
            {
                foreach (Object ctlTemp in tcTemp.Controls)
                {
                    if (ctlTemp.GetType().ToString() == typeof(CheckBox).ToString())
                    {
                        chkTemp = (CheckBox)ctlTemp;
                        if (chkTemp.Checked == true)
                        {
                            strPurview = strPurview + "," + chkTemp.ID.ToString();
                        }
                        else
                        {
                            strDeletePurview = strDeletePurview + "," + chkTemp.ID.ToString();
                        }
                    }
                }
            }
        }
        htInputParameter = new Hashtable();
        dsRecordInfo     = new DataSet();
        htInputParameter.Add(ConstantsManager.QUERY_DATASET_NAME, dsRecordInfo);
        htInputParameter.Add(ConstantsManager.MESSAGE_ID, "");
        htInputParameter.Add("UserGroupID", lblUserGroupID.Text);
        htInputParameter.Add("UserGroupPurview", strPurview);
        htInputParameter.Add("UserGroupDeletePurview", strDeletePurview);
        UserGroupPurviewLibrary instanceUserGroupPurviewLibrary = new UserGroupPurviewLibrary();

        instanceUserGroupPurviewLibrary.SetUserGroupPurviewInfo(htInputParameter);

        //对成功消息进行处理
        strMessageParam[0] = "用户组权限";
        strMessageParam[1] = "修改";
        strMessageInfo     = MessageManager.GetMessageInfo(MessageManager.HINT_MSGID_0015, strMessageParam, strMessageInfo);
        //MessageContent = strMessageInfo;
        Session[ConstantsManager.SESSION_REDIRECT_PAGE] = CURRENT_PATH + "/" + REDIRECT_PAGE;

        //记录日志开始
        string strLogTypeID = "A02";

        strMessageParam[0] = (string)Session[ConstantsManager.SESSION_USER_LOGIN_NAME];
        strMessageParam[1] = "用户组权限";
        strMessageParam[2] = lblUserGroupID.Text;
        strMessageParam[3] = "修改";
        string strLogContent = MessageManager.GetMessageInfo(MessageManager.LOG_MSGID_0003, strMessageParam);

        LogLibrary.LogWrite(strLogTypeID, strLogContent, (string)htInputParameter["ObjectID"], null, null);
        //记录日志结束

        //成功后页面跳转
        Response.Redirect(ConstantsManager.WEBSITE_VIRTUAL_ROOT_DIR + "/Administrator/A_BM/APMUserGroupList.aspx");
        Response.End();
    }