예제 #1
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (this.lblErrorMessage.Text.Length != 0)
        {
            this.lblErrorMessage.Text = "";
        }

        if (this.txtBT_Name.Text.Length == 0)
        {
            this.lblErrorMessage.Text = "Branch type name field can not be blank.";
            this.txtBT_Name.Focus();
            return;
        }

        BranchTypeInfoDTO btdto = Populate();

        try
        {
            Facade            facade            = Facade.GetInstance();
            IBranchTypeInfoBL oBranchTypeInfoBL = facade.createBranchTypeBL();
            oBranchTypeInfoBL.addNewBranchTypeRecord(btdto);
            this.lblErrorMessage.Text = "Data Save Successfully.";
        }
        catch (Exception Exp)
        {
            lblErrorMessage.Text = cls.ErrorString(Exp);
        }
        GridView1.DataBind();
        ControlState_Refresh();
    }
예제 #2
0
    private void DropDownListBrnachType(Facade facade)
    {
        IBranchTypeInfoBL        BranchTypeList  = facade.createBranchTypeBL();
        List <BranchTypeInfoDTO> oBranchTypeList = BranchTypeList.showDataBranchTypeInfo();


        int i = 0;

        ddlBranchType.Items.Clear();
        ddlBranchType.Items.Add("(Select branch type.)");
        this.ddlBranchType.Items[i].Value = "";
        foreach (BranchTypeInfoDTO newDto in oBranchTypeList)
        {
            i++;
            this.ddlBranchType.Items.Add(newDto.BT_Name);
            this.ddlBranchType.Items[i].Value = newDto.PrimaryKey.ToString();
        }
    }