Exemplo n.º 1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ATTMemberPosition MP = new ATTMemberPosition();

        MP.PositionName = this.txtPosition.Text;

        if (this.lstMemberPosition.SelectedIndex < 0)
        {
            MP.Action     = "A";
            MP.PositionID = 0;
        }
        else
        {
            MP.Action     = "E";
            MP.PositionID = ((List <ATTMemberPosition>)Session["MemberPositionLst"])[this.lstMemberPosition.SelectedIndex].PositionID;
        }

        ObjectValidation result = BLLMemberPosition.Validate(MP);

        if (result.IsValid == false)
        {
            this.lblStatusMessage.Text = result.ErrorMessage;
            this.programmaticModalPopup.Show();
            return;
        }

        try
        {
            BLLMemberPosition.AddMemberPosition(MP);
            List <ATTMemberPosition> lst = ((List <ATTMemberPosition>)Session["MemberPositionLst"]);

            if (MP.Action == "A")
            {
                lst.Add(MP);
            }
            else
            {
                lst[this.lstMemberPosition.SelectedIndex] = MP;
            }

            this.lstMemberPosition.DataSource     = lst;
            this.lstMemberPosition.DataTextField  = "PositionName";
            this.lstMemberPosition.DataValueField = "PositionID";
            this.lstMemberPosition.DataBind();

            this.ClearME();
            this.lstMemberPosition.SelectedIndex = -1;

            this.lblStatusMessage.Text = "Member position sucessfully saved.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
Exemplo n.º 2
0
 void LoadCommitteePost()
 {
     try
     {
         this.ddlCommitteePost.DataSource     = BLLMemberPosition.GetMemberPositionList(null, true);
         this.ddlCommitteePost.DataTextField  = "PositionName";
         this.ddlCommitteePost.DataValueField = "PositionID";
         this.ddlCommitteePost.DataBind();
     }
     catch (Exception ex)
     {
         this.lblStatusMessage.Text = ex.Message;
         this.programmaticModalPopup.Show();
     }
 }
Exemplo n.º 3
0
 void LoadMemberPosition()
 {
     try
     {
         Session["MemberPositionLst"]          = BLLMemberPosition.GetMemberPositionList(null, false);
         this.lstMemberPosition.DataSource     = Session["MemberPositionLst"];
         this.lstMemberPosition.DataTextField  = "PositionName";
         this.lstMemberPosition.DataValueField = "PositionID";
         this.lstMemberPosition.DataBind();
     }
     catch (Exception ex)
     {
         this.lblStatusMessage.Text = ex.Message;
         this.programmaticModalPopup.Show();
     }
 }