void LoadLibrary()
    {
        ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]);

        try
        {
            this.ddlLibrary.DataSource     = BLLLibrary.GetLibraryList(user.OrgID, 1, 'N');
            this.ddlLibrary.DataTextField  = "LibraryName";
            this.ddlLibrary.DataValueField = "LibraryID";
            this.ddlLibrary.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
예제 #2
0
    void LoadLibrary()
    {
        ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]);

        try
        {
            this.ddlLibrary.DataSource     = BLLLibrary.GetLibraryList(int.Parse(this.ddlOrg.SelectedValue), null, 'Y');
            this.ddlLibrary.DataTextField  = "LibraryName";
            this.ddlLibrary.DataValueField = "LibraryID";
            this.ddlLibrary.DataBind();
        }
        catch (Exception ex)
        {
            this.lblStatus.Text = ex.Message;
        }
    }
    void LoadLibrary()
    {
        try
        {
            Session["Library_LibraryList"] = BLLLibrary.GetLibraryList(int.Parse(this.ddlOrg_Rqd.SelectedValue), null, 'N');

            this.lslLibrary.DataSource     = (List <ATTLibrary>)Session["Library_LibraryList"];
            this.lslLibrary.DataTextField  = "LibraryName";
            this.lslLibrary.DataValueField = "LibraryID";

            this.lslLibrary.DataBind();
        }
        catch (Exception ex)
        {
            this.lblStatus.Text = ex.Message;
        }
    }
    public void LoadOrganisation()
    {
        try
        {
            Session["OrgList"] = BLLOrganization.GetOrganizationNameList();
            this.drpOrganisation.DataSource     = (List <ATTOrganization>)Session["OrgList"];
            this.drpOrganisation.DataTextField  = "OrgName";
            this.drpOrganisation.DataValueField = "OrgId";
            this.drpOrganisation.DataBind();

            ListItem a = new ListItem();
            a.Selected = true;
            a.Text     = "Select Organisation";
            a.Value    = "0";
            drpOrganisation.Items.Insert(0, a);

            Session["LibList"] = BLLLibrary.GetLibraryNameList();
        }
        catch (Exception ex)
        {
            lblStatus.Text = ex.Message;
        }
    }
    protected void btnAddLibrary_Click(object sender, EventArgs e)
    {
        ATTLibrary objLib = new ATTLibrary
                            (
            0,
            int.Parse(this.ddlOrg_Rqd.SelectedValue),
            this.txtLibraryName.Text,
            this.txtLibraryLocation.Text,
            ((ATTUserLogin)Session["Login_User_Detail"]).UserName,
            DateTime.Now
                            );

        ObjectValidation OV = BLLLibrary.Validate(objLib);

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

        List <ATTLibrary> ltLibrary = (List <ATTLibrary>)Session["Library_LibraryList"];
        ATTUserLogin      user      = ((ATTUserLogin)Session["Login_User_Detail"]);

        try
        {
            if (this.lslLibrary.SelectedIndex < 0)
            {
                if (this.lslLibrary.Items.Count > 1)
                {
                    this.lblStatus.Text = "More then one library cannot be create.";
                    return;
                }

                if (user.MenuList["4,1,1"] == null || user.MenuList["4,1,1"].PAdd == "N")
                {
                    this.lblStatus.Text = Utilities.PreviledgeMsg + " add Library.";
                    return;
                }
                Previlege pobj = new Previlege(user.UserName, "4,1,1", int.Parse(((HiddenField)this.Master.FindControl("hdnApplicationID")).Value), Previlege.PrevilegeType.P_ADD);


                BLLLibrary.AddLibrary(objLib, pobj);
                ltLibrary.Add(objLib);
            }
            else
            {
                objLib.LibraryID = int.Parse(this.lslLibrary.SelectedValue);

                if (user.MenuList["4,1,1"] == null || user.MenuList["4,1,1"].PEdit == "N")
                {
                    this.lblStatus.Text = Utilities.PreviledgeMsg + " add Currency.";
                    return;
                }
                Previlege pobj = new Previlege(user.UserName, "4,1,1", int.Parse(((HiddenField)this.Master.FindControl("hdnApplicationID")).Value), Previlege.PrevilegeType.P_EDIT);
                BLLLibrary.EditLibrary(objLib, pobj);

                ltLibrary[this.lslLibrary.SelectedIndex] = objLib;
            }


            this.lslLibrary.DataSource     = ltLibrary;
            this.lslLibrary.DataTextField  = "LibraryName";
            this.lslLibrary.DataValueField = "LibraryID";

            this.lslLibrary.DataBind();

            this.ClearLibraryControl();
        }
        catch (Exception ex)
        {
            this.lblStatus.Text = ex.Message;
        }
    }