示例#1
0
        protected void btnSubmite_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                BranchModel model;
                model = client.GetBranchByID(txtBranchName.Text, ParlourId);
                if (model != null && BranchID == new Guid("00000000-0000-0000-0000-000000000000"))
                {
                    ShowMessage(ref lblMessage, MessageType.Danger, "Branch Already Exists.");
                }
                else
                {
                    model              = new BranchModel();
                    model.Brancheid    = BranchID;
                    model.BranchName   = txtBranchName.Text;
                    model.Parlourid    = ParlourId;
                    model.TelNumber    = txtPhone.Text;
                    model.CellNumber   = txtCellPhone.Text;
                    model.Address1     = txtline1.Text;
                    model.Address2     = txtline2.Text;
                    model.Address3     = txtline3.Text;
                    model.Address4     = txtline4.Text;
                    model.Code         = txtpostalcode.Text;
                    model.BranchCode   = txtBranchCode.Text;
                    model.Region       = txtRegion.Text;
                    model.LastModified = System.DateTime.Now;
                    model.ModifiedUser = UserName;


                    //================================================================
                    Guid retID = client.SaveBranchDetails(model);
                    BranchID = retID;

                    ShowMessage(ref lblMessage, MessageType.Success, "Branch Details successfully saved");
                    BindBranchesList();
                    ClearControl();
                }
                lblMessage.Visible = true;
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "goToTab512", "goToTab(5)", true);
            }
        }