Exemplo n.º 1
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        ATTApplication appObj = new ATTApplication(0, txtShortName_Rqd.Text, this.txtApplication_Rqd.Text, this.txtAppDesc.Text, "A");

        ObjectValidation OV = BLLApplication.Validate(appObj);

        if (OV.IsValid == false)
        {
            this.lblStatus.Text = OV.ErrorMessage;
            return;
        }

        List <ATTApplication> lst = (List <ATTApplication>)Session["LstApp"];

        try
        {
            BLLApplication.AddApplication(appObj);
            lst.Add(appObj);

            lst.Sort(delegate(ATTApplication a1, ATTApplication a2) { return(a1.ApplicationFullName.CompareTo(a2.ApplicationFullName)); });

            this.lstApplication.DataSource     = lst;
            this.lstApplication.DataTextField  = "ApplicationFullName";
            this.lstApplication.DataValueField = "ApplicationID";

            this.lstApplication.DataBind();

            this.ClearApplication();
        }
        catch (Exception ex)
        {
            this.lblStatus.Text = ex.Message;
        }
    }
 private void LoadApplications()
 {
     chklstApplications.DataSource     = BLLApplication.GetApplicationList(1);
     chklstApplications.DataValueField = "ApplicationId";
     chklstApplications.DataTextField  = "ApplicationFullName";
     chklstApplications.DataBind();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsPostBack == false)
        {
            Session["lstAppFM"] = BLLApplication.GetApplicationListWithFormNMenu();
            this.ddlApplication_Rqd.DataSource     = (List <ATTApplication>)Session["lstAppFM"];
            this.ddlApplication_Rqd.DataTextField  = "ApplicationFullName";
            this.ddlApplication_Rqd.DataValueField = "ApplicationID";

            this.ddlApplication_Rqd.DataBind();
        }
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.RedirectLocation = "sss";
        if (this.IsPostBack == false)
        {
            Session["LstApp"] = BLLApplication.GetApplicationList(1);

            this.lstApplication.DataSource     = (List <ATTApplication>)Session["LstApp"];
            this.lstApplication.DataTextField  = "ApplicationFullName";
            this.lstApplication.DataValueField = "ApplicationID";

            this.lstApplication.DataBind();
        }
    }
 void LoadApplications()
 {
     try
     {
         List <ATTApplication> orgApplicationLST = BLLApplication.GetApplication(null, null, null, 0);
         Session["Applications"]       = orgApplicationLST;
         lstApplication.DataSource     = orgApplicationLST;
         lstApplication.DataValueField = "ApplicationID";
         lstApplication.DataTextField  = "ApplicationName";
         lstApplication.DataBind();
     }
     catch (Exception ex)
     {
         this.lblStatusMessage.Text = "Error Loading Applications<BR>" + ex.Message;
         this.programmaticModalPopup.Show();
     }
 }
Exemplo n.º 6
0
 private void GetApplicationsList()
 {
     try
     {
         List <ATTApplication> lstApplicationsDetails;
         lstApplicationsDetails = BLLApplication.GetApplicationListWithFormNMenuNRolesNRoleMenus();
         Session["ApplicationsRolesMenusList"]  = lstApplicationsDetails;
         this.ddlApplication_Rqd.DataSource     = lstApplicationsDetails;
         this.ddlApplication_Rqd.DataTextField  = "ApplicationFullName";
         this.ddlApplication_Rqd.DataValueField = "ApplicationID";
         this.ddlApplication_Rqd.SelectedIndex  = 0;
         this.ddlApplication_Rqd.DataBind();
     }
     catch (Exception ex)
     {
         this.lblStatusMessage.Text = ex.Message;
         this.programmaticModalPopup.Show();
     }
 }
Exemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Login_User_Detail"] == null)
     {
         Response.Redirect("~/MODULES/Login.aspx", true);
     }
     else
     {
         ATTUserLogin user = (ATTUserLogin)Session["Login_User_Detail"];
         System.Collections.Generic.List <ATTApplication> lst = BLLApplication.GetUserApplicationList(user.UserName);
         lst.RemoveAll(
             delegate(ATTApplication appl)
         {
             return(appl.ApplicationID == 8);
         }
             );
         this.dListUserApplication.DataSource = lst;
         this.dListUserApplication.DataBind();
     }
 }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        List <ATTApplication> ApplicationLST = (List <ATTApplication>)Session["Applications"];


        int i = -1;

        if (this.lstApplication.SelectedIndex > -1)
        {
            i = ApplicationLST.FindIndex(delegate(ATTApplication obj)
            {
                return(this.txtApplication_RQD.Text.ToUpper() == obj.ApplicationName.ToUpper() && this.lstApplication.SelectedItem.Text.ToUpper() != this.txtApplication_RQD.Text.ToUpper());
            });
        }
        else
        {
            i = ApplicationLST.FindIndex(delegate(ATTApplication obj)
            {
                return(this.txtApplication_RQD.Text.ToUpper() == obj.ApplicationName.ToUpper());
            });
        }

        if (i > -1)
        {
            this.lblStatusMessage.Text = "Application Already Exists";
            this.programmaticModalPopup.Show();
            return;
        }



        if (this.txtApplication_RQD.Text == "")
        {
            this.lblStatusMessage.Text = "Application Can't Be Left Blank";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.ddlApplicationType.SelectedValue == "0")
        {
            this.lblStatusMessage.Text = "Please Select Application Type";
            this.programmaticModalPopup.Show();
            return;
        }


        ATTApplication objApplication = new ATTApplication();

        objApplication.ApplicationID   = lstApplication.SelectedIndex == -1 ? 0 : int.Parse(lstApplication.SelectedValue);
        objApplication.ApplicationName = this.txtApplication_RQD.Text;
        objApplication.ApplicationType = this.ddlApplicationType.SelectedValue;
        objApplication.Active          = this.chkApplicationActive.Checked == true ? "Y" : "N";
        objApplication.EntryBy         = "manoz";
        objApplication.Action          = lstApplication.SelectedIndex == -1 ? "A" : "E";

        CheckBox cb;

        foreach (GridViewRow gvRow in this.grdOrganization.Rows)
        {
            ATTOrgApplication objOrgAppl = new ATTOrgApplication();
            cb = (CheckBox)gvRow.FindControl("chkSelect");
            if (cb.Checked == true || CheckNull.NullString(gvRow.Cells[3].Text) != "")
            {
                objOrgAppl.OrgID         = int.Parse(gvRow.Cells[1].Text);
                objOrgAppl.ApplicationID = (lstApplication.SelectedIndex > -1) ? int.Parse(lstApplication.SelectedValue) : 0;
                if (CheckNull.NullString(gvRow.Cells[3].Text) == "" && cb.Checked == true)
                {
                    objOrgAppl.Active = "Y";
                    objOrgAppl.Action = "A";
                }
                if ((CheckNull.NullString(gvRow.Cells[3].Text) == "Y" && cb.Checked == false))
                {
                    objOrgAppl.Active = "N";
                    objOrgAppl.Action = "E";
                }

                if ((CheckNull.NullString(gvRow.Cells[3].Text) == "N" && cb.Checked == true) || (CheckNull.NullString(gvRow.Cells[3].Text) == "Y" && cb.Checked == true))
                {
                    objOrgAppl.Active = "Y";
                    objOrgAppl.Action = "E";
                }


                objOrgAppl.EntryBy = "manoz";

                objApplication.OrgApplicationLST.Add(objOrgAppl);
            }
        }

        try
        {
            if (BLLApplication.SaveApplication(objApplication) == true)
            {
                if (lstApplication.SelectedIndex == -1)
                {
                    ApplicationLST.Add(objApplication);
                }
                else
                {
                    ApplicationLST.RemoveAt(lstApplication.SelectedIndex);
                    ApplicationLST.Add(objApplication);
                }
                this.lstApplication.DataSource     = ApplicationLST;
                this.lstApplication.DataValueField = "ApplicationID";
                this.lstApplication.DataTextField  = "ApplicationName";
                this.lstApplication.DataBind();


                ClearAll();
            }
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = "Error in Saving Application<BR>" + ex.Message;
            this.programmaticModalPopup.Show();
        }
    }