protected void btnSave_Click(object sender, EventArgs e)
    {
        Branch    oBranch    = new Branch();
        BranchDAL oBranchDAL = new BranchDAL();

        oBranch.BranchID   = Request[txtBranchID.UniqueID].Trim().ToUpper();
        txtBranchID.Text   = Request[txtBranchID.UniqueID].Trim().ToUpper();
        oBranch.BranchName = txtBranchName.Text.ToUpper();
        oBranch.BbCode     = txtBdBankCode.Text;
        oBranch.Address    = txtAddress.Text;
        oBranch.ZipCode    = txtZipCode.Text;
        oBranch.Phone      = txtPhoneNumber.Text;
        if (!string.IsNullOrEmpty(ddlCountryName.SelectedItem.Value))
        {
            oBranch.Country = ddlCountryName.SelectedItem.Value;
        }
        oBranch.Email = txtEmailID.Text;
        oBranch.Fax   = txtFaxNumber.Text;

        oBranch.UserDetails          = ucUserDet.UserDetail;
        oBranch.UserDetails.MakeDate = DateTime.Now;
        ucUserDet.ResetData();
        Result oResult = (Result)oBranchDAL.Save(oBranch);

        if (oResult.Status)
        {
            this.LoadList();
            ClearTextValue();
            hdBranchID.Value = "";

            ucMessage.OpenMessage(Constants.MSG_SUCCESS_SAVE, Constants.MSG_TYPE_SUCCESS);
            // ScriptManager.RegisterStartupScript(this.upData, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("Save"), true);
        }
        else
        {
            ucMessage.OpenMessage(Constants.MSG_ERROR_SAVE, Constants.MSG_TYPE_ERROR);
            // ScriptManager.RegisterStartupScript(this.upData, typeof(string), Constants.POPUP_WINDOW, Util.OpenPopup("Save"), true);
        }
    }
Exemple #2
0
 public bool SaveBranch(Branch newItem)
 {
     return(branchDAL.Save(newItem));
 }