コード例 #1
0
        protected void btpageUpdate_Click(object sender, System.EventArgs e)
        {
            try
            {
                PageFormUI objPageFormUI = new PageFormUI();
                objPageFormUI.PageMappingX = txtPageMappingX.Text.Trim();
                objPageFormUI.UpdatedOn    = DateTime.Now;
                //objsecurityProfileFormUI.createdBySystemUser = "******";
                //objsecurityProfileFormUI.updatedBySystemUser = "******";

                if (objPageFormBAL.UpdatePage(objPageFormUI, RowId = URLMessage.GetParam(PageCode, 0)) == -1)
                {
                    //Response.Redirect("OrganizationList.aspx");
                    msgcool.Visible = true;
                    lbsuccess.Text  = "Profile name has been updated";
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "clearform", "ClearForm();", true);
                }
                else
                {
                    lblMsg.Text      = "Could not process the request, Please try again";
                    msgalert.Visible = true;
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "clearform", "ClearForm();", true);
                }
            }
            catch (Exception exp)
            {
                //logExcpUIobj.MethodName = "btprofileUpdate_Click()";
                //logExcpUIobj.ResourceName = "System_Security_SecurityProfileEdit.CS";
                //logExcpUIobj.RecordId = "";
                //logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
                //logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

                //log.Error("[System_Security_SecurityProfileEditForm : btprofileUpdate_Click] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
            }
        }
コード例 #2
0
        private void BindPageList(int aPageNumber)
        {
            DataTable dtb = objPageListBAL.GetPageList();

            if (dtb.Rows.Count > 0 && dtb != null)
            {
                dtb.Columns.Add("JumpParam");
                foreach (DataRow item in dtb.Rows)
                {
                    item["JumpParam"] = "PageMappingView.aspx?" + URLMessage.Encrypt("PageMapping=" + item["PageMapping"]);
                }
                grdPage.DataSource = dtb;
                grdPage.DataBind();
                grdPage.CurrentPageIndex = aPageNumber > grdPage.PageCount ? 0 : aPageNumber;
                grdPage.DataBind();
                SessionContext.GridPage = grdPage.CurrentPageIndex;
                msgalert.Visible        = false;
            }
            else
            {
                msgalert.Visible = true;
                lbmsg.Text       = "No Records Found";
                grdPage.Visible  = false;
            }
        }
コード例 #3
0
        //定义了向Collection中加入URL的排序规则(插入排序)
        private void AddListViewItem(URLMessage message)
        {
            if (message.IsHTML())
            {
                return;
            }

            if (URLMessageCollection.Count == 0)
            {
                URLMessageCollection.Add(message);
                return;
            }

            for (int i = 0; i < URLMessageCollection.Count; ++i)
            {
                var cur = URLMessageCollection[i];
                if (cur.URL.Equals(message.URL))
                {
                    return;
                }
                if (message.StreamSize > cur.StreamSize)
                {
                    URLMessageCollection.Insert(i, message);
                    return;
                }
            }

            URLMessageCollection.Append(message);
        }
コード例 #4
0
        protected void btdeleteControl_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (objPageControlFormBAL.DeleteControl(RowId = URLMessage.GetParam(PageCode, 0)) == -1)
                {
                    //Response.Redirect("OrganizationList.aspx");
                    msgcool.Visible = true;
                    lbsuccess.Text  = "Control has been deleted";
                    txtControlMappingCode.Visible = false;
                    txtControlMappingX.Visible    = false;
                }
                else
                {
                    lblMsg.Text      = "Could not process the request, Please try again";
                    msgalert.Visible = true;
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "clearform", "ClearForm();", true);
                }
            }
            catch (Exception exp)
            {
                //logExcpUIobj.MethodName = "btprofileUpdate_Click()";
                //logExcpUIobj.ResourceName = "System_Security_SecurityProfileEdit.CS";
                //logExcpUIobj.RecordId = "";
                //logExcpUIobj.ExceptionDetails = "Error Occured. System Generated Error is: " + exp.ToString();
                //logExcpDALobj.SaveExceptionToDB(logExcpUIobj);

                //log.Error("[System_Security_SecurityProfileEditForm : btprofileUpdate_Click] An error occured in the processing of Record Details : [" + exp.ToString() + "]");
            }
        }
コード例 #5
0
        protected void lnkEdit_Click(object sender, System.EventArgs e)
        {
            string id = (sender as LinkButton).CommandArgument;

            if (!id.Equals("0"))
            {
                Response.Redirect("../SecurityProfile/SecurityProfileEdit.aspx?" + URLMessage.Encrypt("action=" + URLAction.update.ToString() + "&SecurityProfile=" + id));
            }
        }
コード例 #6
0
        protected void lnkEdit_Click(object sender, System.EventArgs e)
        {
            string id = URLMessage.GetParam(PageCode, "0");

            if (!id.Equals("0"))
            {
                Response.Redirect(PageCode + "Edit.aspx?" + URLMessage.Encrypt("action=" + URLAction.update.ToString() + "&" + PageCode + "=" + id));
            }
        }
コード例 #7
0
 private void PrepCreate()
 {
     lblPageName.Text = "Add New Control";
     btDelete.Visible = false;
     btUpdate.Visible = false;
     txtControlMappingCode.Enabled = true;
     RowId    = int.MinValue;
     ParentId = URLMessage.GetParam("PageMapping", -1);
 }
コード例 #8
0
        private void GetControlListEdit()
        {
            DataTable dtb = objPrivilegesDetailsBAL.GetPrivilegesDetails(URLMessage.GetParam("SecurityProfile", -1), URLMessage.GetParam("PageMapping", -1));

            if (dtb.Rows.Count > 0 && dtb != null)
            {
                lblSearchHeaderText.Text     = dtb.Rows[0]["RoleName"].ToString() + " > " + dtb.Rows[0]["PageName"].ToString() + " > Edit Controls";
                grdSecurityDetail.DataSource = dtb;
                grdSecurityDetail.DataBind();
            }
            else
            {
                msgalert.Visible = true;
            }
        }
コード例 #9
0
        private void PrepUpdate()
        {
            lblSearchHeaderText.Text = "Edit Page";
            btnclear.Visible         = false;
            btSave.Visible           = false;
            RowId = URLMessage.GetParam(PageCode, 0);
            DataTable dtb = new DataTable();

            RowId = URLMessage.GetParam(PageCode, 0);
            dtb   = objPageListBAL.GetPage(RowId);

            if (dtb.Rows.Count > 0)
            {
                txtPageMappingX.Text = dtb.Rows[0]["PageMappingX"].ToString();
            }
            else
            {
                msgalert.Visible = true;
                lblMsg.Text      = "Could not process the request, Please try again";
            }
        }
コード例 #10
0
        private void PrepUpdate()
        {
            btDelete.Visible = true;
            btnclear.Visible = false;
            btSave.Visible   = false;

            DataTable dtb = new DataTable();

            RowId = URLMessage.GetParam(PageCode, 0);
            dtb   = objSecurityProfileListBAL.GetSecurityProfile(RowId);

            if (dtb.Rows.Count > 0)
            {
                txtSecurityProfileX.Text = dtb.Rows[0]["SecurityProfileX"].ToString();
            }
            else
            {
                msgalert.Visible = true;
                lbmsg.Text       = "Could not process the request, Please try again";
            }
        }
コード例 #11
0
        //得到了一个新URL,分析其文件名,文件大小
        private async void AddURL(string URL)
        {
            AbstractAnalyser analyser = Converters.UrlConverter.GetAnalyser(URL);
            await analyser.SetURLAsync(URL);

            if (analyser.IsLegal())
            {
                URLMessage message = new URLMessage();
                message.URL                 = analyser.URL;
                message.StreamSize          = analyser.GetStreamSize();
                message.RecommendedFileName = analyser.GetRecommendedName();
                if (message.RecommendedFileName == null)
                {
                    message.RecommendedFileName = string.Empty;
                }
                message.StreamSizeToString = Converters.StringConverter.GetPrintSize(analyser.GetStreamSize());
                AddListViewItem(message);
                LimitListLength();
            }
            analyser.Dispose();
        }
コード例 #12
0
        protected void btnSavePageControlMapping_Click(object sender, System.EventArgs e)
        {
            if (objPrivilegesDetailsBAL.RemoveProfilePageControlMapping(URLMessage.GetParam("SecurityProfile", -1), URLMessage.GetParam("PageMapping", -1)) == -1)
            {
                for (int i = 0; i < grdSecurityDetail.Items.Count; i++)
                {
                    RadioButtonList rblShippers = (RadioButtonList)grdSecurityDetail.Items[i].Cells[0].FindControl("optControlState");

                    string ControlId = grdSecurityDetail.Items[i].Cells[0].Text;
                    if (objPrivilegesDetailsBAL.AddProfilePageControlMapping(URLMessage.GetParam("SecurityProfile", -1), URLMessage.GetParam("PageMapping", -1), Convert.ToInt32(ControlId), rblShippers.SelectedValue) == 1)
                    {
                        msgcool.Visible = true;
                        lbsuccess.Text  = "Profile Page Control Mapping completed successfully";
                    }
                    else
                    {
                        msgalert.Visible = true;
                        lblmsg.Text      = "Could not process your request, Please try again";
                    }
                }
            }
        }
コード例 #13
0
 private void BindPageControlList()
 {
     RowId = URLMessage.GetParam(PageCode, 0);
     dtb   = objPageControlListBAL.getPageControlList(RowId);
     if (dtb.Rows.Count > 0 && dtb != null)
     {
         lblPageMappingX.Text = dtb.Rows[0]["PageMappingX"].ToString().Replace(".aspx", " Page Control List");
         dtb.Columns.Add("JumpParam");
         foreach (DataRow item in dtb.Rows)
         {
             item["JumpParam"] = "ControlMappingEdit.aspx?" + URLMessage.Encrypt("action=update&ControlMapping=" + item["ControlMapping"]);
         }
         grdControlMapping.DataSource = dtb;
         grdControlMapping.DataBind();
         msgalert.Visible = false;
     }
     else
     {
         msgalert.Visible          = true;
         lblmsg.Text               = "No Records Found";
         grdControlMapping.Visible = false;
     }
 }
コード例 #14
0
        private void BindSecurityProfileList(int aPageNumber)
        {
            DataTable dtb = objSecurityProfileList.GetSecurityProfileList();

            if (dtb.Rows.Count > 0 && dtb != null)
            {
                dtb.Columns.Add("JumpParam");
                foreach (DataRow item in dtb.Rows)
                {
                    item["JumpParam"] = "../PageMapping/RolePageMappingList.aspx?" + URLMessage.Encrypt("SecurityProfile=" + item["SecurityProfile"] + "&Name=" + item["SecurityProfileX"].ToString());
                }
                grdPage.DataSource = dtb;
                grdPage.DataBind();
                grdPage.CurrentPageIndex = aPageNumber > grdPage.PageCount ? 0 : aPageNumber;
                grdPage.DataBind();
                SessionContext.GridPage = grdPage.CurrentPageIndex;
                msgalert.Visible        = false;
            }
            else
            {
                msgalert.Visible = true;
                grdPage.Visible  = false;
            }
        }
コード例 #15
0
        private void PrepUpdate()
        {
            btDelete.Visible = true;
            btnclear.Visible = false;
            btSave.Visible   = false;

            DataTable dtb = new DataTable();

            RowId = URLMessage.GetParam("ControlMapping", 0);

            dtb = objPageControlListBAL.getPageControl(RowId);

            if (dtb.Rows.Count > 0)
            {
                ParentId = (int)dtb.Rows[0]["PageMapping"];
                txtControlMappingX.Text    = dtb.Rows[0]["ControlMappingX"].ToString();
                txtControlMappingCode.Text = dtb.Rows[0]["ControlMappingCode"].ToString();
            }
            else
            {
                msgalert.Visible = true;
                lblMsg.Text      = "Could not process the request, Please try again";
            }
        }
コード例 #16
0
 protected void btCreate_Click(object sender, System.EventArgs e)
 {
     Response.Redirect("ControlMappingEdit.aspx?" + URLMessage.Encrypt("action=create&PageMapping=" + RowId));
 }
コード例 #17
0
 protected void btnBack_Click(object sender, System.EventArgs e)
 {
     Response.Redirect("../PageMapping/RolePageMappingList.aspx?" + URLMessage.Encrypt("action=view&SecurityProfile=" + URLMessage.GetParam("SecurityProfile", "0") + "&Name=" + URLMessage.GetParam("Name", "")));
 }
コード例 #18
0
 protected void btprofileCreate_Click(object sender, EventArgs e)
 {
     Response.Redirect(PageCode + "Edit.aspx?" + URLMessage.Encrypt("action=create"));
 }
コード例 #19
0
 protected void btnManageProfile_Click(object sender, System.EventArgs e)
 {
     Response.Redirect("../PageMapping/RolePageMappingList.aspx?" + URLMessage.Encrypt("SecurityProfile = " + ProfileId.Value + " & Name = " + ProfileName.Value));
 }
コード例 #20
0
 protected void btnBack_Click(object sender, System.EventArgs e)
 {
     Response.Redirect("PageMappingView.aspx?" + URLMessage.Encrypt("PageMapping=" + ParentId));
 }
コード例 #21
0
 protected void lnkEdit_Click1(object sender, EventArgs e)
 {
     Response.Redirect(PageCode + "Edit.aspx?" + URLMessage.Encrypt("action=" + URLAction.update.ToString() + "&" + PageCode + "=" + RowId));
 }