コード例 #1
0
        public ServiceResult Delete(Vendor n)
        {
            if (n == null || string.IsNullOrWhiteSpace(n.UUID))
            {
                return(ServiceResponse.Error("Invalid account was sent."));
            }

            if (CurrentUser == null)
            {
                return(ServiceResponse.Error("You must be logged in to access this function."));
            }

            VendorManager vendorManager = new VendorManager(Globals.DBConnectionKey, this.GetAuthToken(Request));

            return(vendorManager.Delete(n));
        }
コード例 #2
0
 private void btnDelete_ItemClick(object sender, ItemClickEventArgs e)
 {
     try
     {
         int VendorCode = int.Parse(txtVendorCode.Text);
         if (new PurchaseManager().GetAll().Where(sa => sa.Vendor_Code == VendorCode).ToList().Count > 0)
         {
             MessageBox.Show("You Can't Delete This Vendor", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop);
             return;
         }
         Vendor cust = vendor.Get(VendorCode);
         vendor.Delete(cust);
         MessageBox.Show("Selected Vendor Successfully Deleted");
         RowFocusedIndex = 0;
         FRM_Vendor_Load(null, null);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #3
0
        public void Delete()
        {
            bool result = VendorManager.Delete(2);

            Assert.IsTrue(result);
        }