void LoadAuthor()
 {
     try
     {
         this.lstAuthor.DataSource     = BLLAuthor.GetAuthorList(null);
         this.lstAuthor.DataTextField  = "AuthorName";
         this.lstAuthor.DataValueField = "AuthorID";
         this.lstAuthor.DataBind();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #2
0
    public void LoadAuthor()
    {
        try
        {
            Session["AuthorList"] = BLLAuthor.GetAuthorList(null);

            this.grdAuthor.DataSource = (List <ATTAuthor>)Session["AuthorList"];
            this.grdAuthor.DataBind();
        }
        catch (Exception ex)
        {
            lblStatus.Text = ex.Message;
        }
    }
Exemple #3
0
    /// <summary>
    /// Load author list in dropdown control
    /// </summary>
    void LoadAuthor()
    {
        try
        {
            Session["Author_AuthorList"]  = BLLAuthor.GetAuthorList(null);
            this.lstAuthor.DataSource     = (List <ATTAuthor>)Session["Author_AuthorList"];
            this.lstAuthor.DataTextField  = "AuthorName";
            this.lstAuthor.DataValueField = "AuthorID";

            this.lstAuthor.DataBind();
        }
        catch (Exception ex)
        {
            this.lblStatus.Text = ex.Message;
        }
    }
    void LoadAuthor()
    {
        try
        {
            List <ATTAuthor> lst = BLLAuthor.GetAuthorList(null);
            lst.Insert(0, new ATTAuthor(-1, "--- Select Author ---"));
            this.ddlAuthor.DataSource     = lst;
            this.ddlAuthor.DataTextField  = "AuthorName";
            this.ddlAuthor.DataValueField = "AuthorID";

            this.ddlAuthor.DataBind();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Exemple #5
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ATTAuthor authorObj = new ATTAuthor
                              (
            0,
            this.txtAuthorName_Rqd.Text,
            ((ATTUserLogin)Session["Login_User_Detail"]).UserName,
            DateTime.Now
                              );

        ObjectValidation OV = BLLAuthor.Validate(authorObj);

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

        List <ATTAuthor> lstAuth = (List <ATTAuthor>)Session["Author_AuthorList"];

        ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]);

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

                BLLAuthor.AddAuthor(authorObj, pobj);
                lstAuth.Add(authorObj);
            }
            else
            {
                if (user.MenuList["4,4,1"] == null || user.MenuList["4,4,1"].PEdit == "N")
                {
                    this.lblStatus.Text = Utilities.PreviledgeMsg + " update Author.";
                    return;
                }
                Previlege pobj = new Previlege(user.UserName, "4,4,1", int.Parse(((HiddenField)this.Master.FindControl("hdnApplicationID")).Value), Previlege.PrevilegeType.P_EDIT);

                authorObj.AuthorID = int.Parse(this.lstAuthor.SelectedValue);

                BLLAuthor.EditAuthor(authorObj, pobj);
                lstAuth[this.lstAuthor.SelectedIndex] = authorObj;
            }


            this.lstAuthor.DataSource     = lstAuth;
            this.lstAuthor.DataTextField  = "AuthorName";
            this.lstAuthor.DataValueField = "AuthorID";

            this.lstAuthor.DataBind();

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