Update() private method

private Update ( ) : void
return void
Example #1
0
        private void btn_editBranch_Click(object sender, EventArgs e)
        {
            int check = Validation(txt_branchName.Text, txt_addressBranch.Text, num_emp.Value, num_empExpect.Value);

            if (check == -1)
            {
                MessageBox.Show("Vui lòng nhập tên chi nhánh!");
            }
            else if (check == -2)
            {
                MessageBox.Show("Vui lòng nhập địa chỉ chi nhánh!");
            }
            else if (check == -3)
            {
                MessageBox.Show("Vui lòng nhập số nhân viên hiện tại!");
            }
            else if (check == -4)
            {
                MessageBox.Show("Vui lòng nhập số nhân viên dự kiến!");
            }
            else
            {
                Branch branch = new Branch();
                branch.SelectObjectwithID(Oid);
                branch.branchName    = txt_branchName.Text;
                branch.address       = txt_addressBranch.Text;
                branch.eNumber       = Convert.ToInt32(num_emp.Value);
                branch.eNumberExpect = Convert.ToInt32(num_empExpect.Value);
                branch.Update();
                MessageBox.Show("Sửa chi nhánh thành công!");
                reLoad();
            }
        }
Example #2
0
 public void UpdateBranch()
 {
     using (var repo = GetTrashRepository())
     {
         var master        = new Branch(repo, "refs/heads/master");
         var origin_master = new Branch(repo, "refs/remotes/origin/master");
         origin_master.Update(master);
         Assert.AreEqual(master.CurrentCommit.Hash, origin_master.CurrentCommit.Hash);
         var remote_head = repo.Refs["refs/remotes/origin/master"];
         Assert.AreEqual(master.CurrentCommit.Hash, remote_head.Target.Hash);
     }
 }
Example #3
0
        private void btnUpdate_Click(object sender, RoutedEventArgs e)
        {
            var result = _branch.Update();

            if (!result.Success)
            {
                MessageWindow.ShowAlertMessage(result.Message);
                return;
            }
            DialogResult = true;
            Close();
        }
Example #4
0
		public void UpdateBranch()
		{
			using (var repo = GetTrashRepository())
			{
				var master = new Branch(repo, "refs/heads/master");
				var origin_master = new Branch(repo, "refs/remotes/origin/master");
				origin_master.Update(master);
				Assert.AreEqual(master.CurrentCommit.Hash, origin_master.CurrentCommit.Hash);
				var remote_head = repo.Refs["refs/remotes/origin/master"];
				Assert.AreEqual(master.CurrentCommit.Hash, remote_head.Target.Hash);
			}
		}
Example #5
0
        public async Task <Branch> UpdateAsync(BranchModel branchModel)
        {
            Branch branch = await _branchServiceQueries.FindBranchById(branchModel.BranchId);

            if (branch.BranchName != branchModel.BranchName)
            {
                await _branchServiceDomain.CheckBranchExist(branchModel.BranchName, branchModel.AgencyCode);
            }
            Check.ArgumentNotNull(nameof(branch), branch);
            branch.Update(branchModel.BranchName, new List <BranchAddress>());
            return(await _branchServiceCommand.UpdateAsync(branch));
        }
 private void Update(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(_currentBranch.BranchName))
     {
         MessageWindow.ShowAlertMessage("Branch Name must not be empty!");
         return;
     }
     if (_currentBranch.BranchId == 0)
     {
         _currentBranch.Create();
         return;
     }
     _currentBranch.Update();
 }
Example #7
0
        private void SaveRecord()
        {
            Branch        clsBranch  = new Branch();
            BranchDetails clsDetails = new BranchDetails();

            clsDetails.BranchID        = Convert.ToInt32(lblBranchID.Text);
            clsDetails.BranchCode      = txtBranchCode.Text;
            clsDetails.BranchName      = txtBranchName.Text;
            clsDetails.DBIP            = txtDBIP.Text;
            clsDetails.DBPort          = txtDBPort.Text;
            clsDetails.Address         = txtAddress.Text;
            clsDetails.Remarks         = txtRemarks.Text;
            clsDetails.IncludeIneSales = chkIncludeIneSales.Checked;

            clsBranch.Update(clsDetails);
            clsBranch.CommitAndDispose();
        }
        public virtual IHttpActionResult Put(int id, [FromBody] UpdateBranch value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Branch model = repository.GetByID(id);

            try
            {
                model.Update(value);
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }

            repository.Update(model);
            return(Content(HttpStatusCode.NoContent, ""));
        }
Example #9
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (CboShop.Items[CboShop.SelectedIndex] is ShopModel selectedShop)
            {
                var Branch = new Branch();
                var result = 0;

                if (m_BranchID > 0)
                {
                    // we are in edit mode
//                    public int Update(long lngID, long lngShopID, string strBranchName, string strAddress, bool bActive,
//                                 string strMobileNo, long lngAdvance, string strReserve1)

                    result = Branch.Update(m_BranchID, selectedShop.ID, TxtBranchName.Text, TxtAddress.Text, cbkActive.Checked,
                                           TxtMobile.Text, NBAdvance.Value, TxtReserve.Text);
                }
                else
                {
                    result = Branch.Add(selectedShop.ID, TxtBranchName.Text, TxtAddress.Text, cbkActive.Checked,
                                        TxtMobile.Text, NBAdvance.Value, TxtReserve.Text);
                }

                if (result > 0)
                {
                    MessageBox.Show(@"Record Saved");
                }

                BtnAdd.Enabled     = true;
                BtnEdit.Enabled    = true;
                BtnDelete.Enabled  = true;
                BtnSave.Enabled    = false;
                BtnCancel.Enabled  = false;
                GBControls.Enabled = false;
                FillGrid();
            }
        }
Example #10
0
        public bool UpdateBranch(Guid id, string name, string description, string address, string address2, string city, string state, string zip, string country, string phone, string email, bool isMainBranch)
        {
            Branch b = new Branch();

            return(b.Update(id, name, description, address, address2, city, state, zip, country, phone, email, isMainBranch));
        }