Example #1
0
 void LoadUnit()
 {
     try
     {
         this.grdUnit.DataSource = BLLUnit.GetUnitList(null, false);
         this.grdUnit.DataBind();
     }
     catch (Exception ex)
     {
         this.lblStatusMessage.Text = ex.Message;
         this.programmaticModalPopup.Show();
     }
 }
 void LoadUnit()
 {
     try
     {
         this.ddlUnit.DataSource     = BLLUnit.GetUnitList(null, true);
         this.ddlUnit.DataTextField  = "UnitName";
         this.ddlUnit.DataValueField = "UnitID";
         this.ddlUnit.DataBind();
     }
     catch (Exception ex)
     {
         this.lblStatus.Text = ex.Message;
     }
 }
 void LoadUnit()
 {
     try
     {
         this.ddlUnit.DataSource     = BLLUnit.GetUnitList("", true);
         this.ddlUnit.DataTextField  = "UnitName";
         this.ddlUnit.DataValueField = "UnitID";
         this.ddlUnit.DataBind();
     }
     catch (Exception ex)
     {
         this.lblStatusMessage.Text = ex.Message;
         this.programmaticModalPopup.Show();
     }
 }
Example #4
0
    void LoadUnit()
    {
        try
        {
            List <ATTUnit> lst = BLLUnit.GetUnitList(null, true);

            this.ddlUnit.DataSource     = lst;
            this.ddlUnit.DataTextField  = "UnitName";
            this.ddlUnit.DataValueField = "UnitID";
            this.ddlUnit.DataBind();
        }
        catch (Exception ex)
        {
            this.ShowMessage(ex, null);
        }
    }
Example #5
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.txtName_Rqd.Text == "")
        {
            this.lblStatusMessage.Text = "Please enter unit name.";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.txtAddress_Rqd.Text == "")
        {
            this.lblStatusMessage.Text = "Please enter unit address.";
            this.programmaticModalPopup.Show();
            return;
        }

        if (this.txtPhone_Rqd.Text == "")
        {
            this.lblStatusMessage.Text = "Please enter unit phone number.";
            this.programmaticModalPopup.Show();
            return;
        }

        ATTUnit unit = new ATTUnit();

        unit.UnitID      = 0;
        unit.UnitName    = this.txtName_Rqd.Text;
        unit.UnitAddress = this.txtAddress_Rqd.Text;
        unit.UnitPhone   = this.txtPhone_Rqd.Text;
        unit.Active      = this.cnkActive.Checked == true ? "Y" : "N";
        unit.Action      = "A";

        if (this.grdUnit.SelectedIndex >= 0)
        {
            unit.UnitID = int.Parse(this.grdUnit.SelectedRow.Cells[0].Text);
            unit.Action = "E";
        }

        if (this.grdUnit.SelectedIndex < 0)
        {
            if (this.User.MenuList[this.MenuName] == null || this.User.MenuList[this.MenuName].PAdd == "N")
            {
                string s = Utilities.PreviledgeMsg + " add lawyer unit.";
                this.ShowMessage(null, s);
                return;
            }
        }
        else
        {
            if (this.User.MenuList[this.MenuName] == null || this.User.MenuList[this.MenuName].PEdit == "N")
            {
                string s = Utilities.PreviledgeMsg + " edit lawyer unit.";
                this.ShowMessage(null, s);
                return;
            }
        }

        try
        {
            BLLUnit.AddUnit(unit);
            this.Clear();
            this.LoadUnit();
            this.lblStatusMessage.Text = "Unit has been saved successfully.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }