private void btnUpdate_Click(object sender, EventArgs e) { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtID.Text.ToString()); var tb = db.tbl_AccountMaster.Where(x => x.Id == idd).FirstOrDefault(); tb.AccountNumber = txtAccountNo.Text; DateTime dttransactiondate = DateTime.Parse(dtpTranactionDate.Value.ToString()); tb.Date = dttransactiondate; tb.Accounttype = cmbAccounttype.Text; tb.AccountName = txtAccountName.Text; tb.SubAccountof = txtSubAccount.Text; tb.AccountRules = txtAccountRules.Text; tb.AccountCurrency = cmbCurrency.Text; tb.Notes = txtRemarks.Text; tb.Status = cmbStatus.Text; db.tbl_AccountMaster.Add(tb); db.SaveChanges(); db.SaveChanges(); MessageBox.Show("Successfully Updated", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); }
private void btnUpdate_Click(object sender, EventArgs e) { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtID.Text.ToString()); var tb = db.tblBonusQuantities.Where(x => x.ID == idd).FirstOrDefault(); tb.Barcode = txtBarcode.Text; tb.ItemName = txtProductname.Text; decimal bonus = decimal.Parse(txtBonus.Text.ToString()); tb.Bonus = bonus; decimal offer = decimal.Parse(txtOfferQty.Text.ToString()); tb.OfferQuantity = offer; tb.TypeOfUnit = cmbUserType.Text; DateTime dtfrom = DateTime.Parse(dateTimePicker1.Text); tb.FromDate = dtfrom; DateTime dtTo = DateTime.Parse(dateTimePicker2.Text); tb.FromDate = dtfrom; db.SaveChanges(); MessageBox.Show("Successfully Updated", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); }
private void btnSave_Click(object sender, EventArgs e) { if (txtBankName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); tbl_AddBank tb = new tbl_AddBank(); Random rr = new Random(); int bankno = rr.Next(100, 900); string banknoo = bankno.ToString(); tb.BankNo = banknoo; tb.Date = dtpTranactionDate.Text; tb.AccountType = cmbAccountType.Text; tb.CurrencyType = cmbCurrencyType.Text; tb.BankName = txtBankName.Text; tb.BranchName = txtBranchName.Text; tb.Address = txtAddress.Text; tb.Phone = txtPhonenumber.Text; tb.Email = txtEmail.Text; tb.Status = cmbStatus.Text; db.tbl_AddBank.Add(tb); db.SaveChanges(); MessageBox.Show("Successfully Added", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void btnSave_Click(object sender, EventArgs e) { if (txtWalletName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); tbl_AddWallet tb = new tbl_AddWallet(); Random rr = new Random(); int bankno = rr.Next(100, 900); tb.WelletNumber = bankno; tb.Date = dateTimePicker1.Text; tb.AccountType = cmbAccountType.Text; tb.CurrencyType = cmbCurrencyType.Text; tb.WalletName = txtWalletName.Text; if (TxtOpeningBalance.Text != "") { decimal opening = decimal.Parse(TxtOpeningBalance.Text); tb.OpeningBalance = opening; } tb.Status = cmbStatus.Text; db.tbl_AddWallet.Add(tb); db.SaveChanges(); MessageBox.Show("Successfully Added", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void btnSave_Click(object sender, EventArgs e) { if (combo_status.SelectedIndex == 0) { st1 = "Yes"; } else { st1 = "No"; } Inventory_DBEntities db = new Inventory_DBEntities(); tbl_Tax tb = new tbl_Tax(); tb.Name = txt_Tax_name.Text; decimal valuee = decimal.Parse(txt_Tax_percent.Text.ToString()); tb.value = valuee; tb.Status = st1; db.tbl_Tax.Add(tb); db.SaveChanges(); refreshGrid(); this.ActiveControl = txt_Tax_name; txt_Tax_name.Focus(); ClearField(); }
private void btnUpdate_Click(object sender, EventArgs e) { if (combo_status.SelectedIndex == 0) { st1 = "Yes"; } else { st1 = "No"; } Inventory_DBEntities db = new Inventory_DBEntities(); int idd = int.Parse(txtID.Text.ToString()); var tb = db.tbl_Tax.Where(x => x.ID == idd).FirstOrDefault(); tb.Name = txt_Tax_name.Text; decimal valuee = decimal.Parse(txt_Tax_percent.Text.ToString()); tb.value = valuee; tb.Status = st1; db.SaveChanges(); refreshGrid(); this.ActiveControl = txt_Tax_name; txt_Tax_name.Focus(); ClearField(); }
private void btnSaveandPrint_Click(object sender, EventArgs e) { if (txtRevenuName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtid.Text); var tb = db.tbl_AddRevenue.Where(x => x.id == idd).FirstOrDefault(); if (txtRevenueNumber.Text != "") { decimal revenuenumber = decimal.Parse(txtRevenueNumber.Text); tb.RevenueNumber = revenuenumber; } if (txtRevenueNumber2.Text != "") { decimal revenuenumber2 = decimal.Parse(txtRevenueNumber2.Text); tb.RevenueNumber2 = revenuenumber2; } tb.Date = dateTimePicker1.Text; tb.CurrencyType = cmbCurrencyType.Text; tb.RevenueName = txtRevenuName.Text; if (txtTotalBeforeTax.Text != "") { decimal totalb = decimal.Parse(txtTotalBeforeTax.Text); tb.TotalBeforeTax = totalb; } if (TxtAmount.Text != "") { decimal amount = decimal.Parse(TxtAmount.Text); tb.Amount = amount; } tb.PaymentMethods = cmbPaymentMethod.Text; if (txtTax.Text != "") { decimal taxes = decimal.Parse(txtTax.Text); tb.Taxes = taxes; } if (txtTotal.Text != "") { decimal total = decimal.Parse(txtTotal.Text);//.te) tb.Total = total; } tb.Notes = TxtNotes.Text; db.SaveChanges(); MessageBox.Show("Successfully Updated", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void btn_update_Click(object sender, EventArgs e) { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtCustomerID.Text); var tb = db.Customers.Where(x => x.ID == idd).FirstOrDefault(); tb.Date = dateTimePicker1.Text; tb.Name = txtCustomerName.Text; tb.CurrencyType = comboCurrencyType.Text; if (txtOpeningBalance.Text != "") { int ob = int.Parse(txtOpeningBalance.Text.ToString()); tb.OpeningBalance = ob; } tb.OpeningBalanceType = cmbOpeningBalanceType.Text; tb.Address = txtAddress.Text; tb.EmailID = txtEmailID.Text; tb.Mobileno = txtContactNo.Text; if (txtCreditLimit.Text != "") { decimal credit = decimal.Parse(txtCreditLimit.Text.ToString()); tb.CreditLimit = credit; } tb.AccountName = txtAccountName.Text; tb.Branch = txtBranch.Text; tb.AccountNumber = txtAccountNo.Text; tb.defaultTransaction = comboDefultTranaction.Text; tb.DefDiscountPercentage = txtcDefultdiscount.Text; if (txtcDirectDiscount.Text != "") { decimal direct = decimal.Parse(txtcDirectDiscount.Text); tb.DirectDiscount = direct; } tb.NextShopping = txtcNextShopping.Text; tb.PayTerms = txtcPaymentTermsdays.Text; tb.CurrencyType = comboCurrencyType.Text; tb.Status = cmbStatus.Text; db.Customers.Add(tb); db.SaveChanges(); UpdateOpeningBalance(); MessageBox.Show("Successfully Updated", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); }
private void btnSave_Click(object sender, EventArgs e) { Inventory_DBEntities db = new Inventory_DBEntities(); tbl_Currency tb = new tbl_Currency(); tb.Name = combo_Currency.Text; decimal valuee = decimal.Parse(txt_cur_rate.Text.ToString()); tb.value = valuee; tb.Status = combo_status.Text; db.tbl_Currency.Add(tb); db.SaveChanges(); MessageBox.Show("Successfully Added", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); this.ActiveControl = combo_Currency; combo_Currency.Focus(); }
private void DeleteRecord() { try { Inventory_DBEntities db = new Inventory_DBEntities(); int idd = int.Parse(txtID.Text.ToString()); var xx = db.tblBonusQuantities.Where(x => x.ID == idd).FirstOrDefault(); db.tblBonusQuantities.Remove(xx); db.SaveChanges(); MessageBox.Show("Successfully Deleted", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_save_Click(object sender, EventArgs e) { if (txtSupplierName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); Supplier tb = new Supplier(); tb.Date = dateTimePicker1.Value; tb.Name = txtSupplierName.Text; tb.AccountNature = comboAccounttype.Text; tb.CurrencyType = comboCurrencyType.Text; if (txtOpeningBalance.Text != "") { decimal ob = decimal.Parse(txtOpeningBalance.Text.ToString()); tb.OpeningBalance = ob; } tb.OpeningBalanceType = cmbOpeningBalanceType.Text; tb.Address = txtAddress.Text; tb.EmailID = txtEmailID.Text; tb.Mobileno = txtContactNo.Text; if (txtCreditLimit.Text != "") { decimal credit = decimal.Parse(txtCreditLimit.Text.ToString()); tb.CreditLimit = credit; } tb.AccountName = txtAccountName.Text; tb.Branch = txtBranch.Text; tb.AccountNumber = txtAccountNo.Text; tb.DefultTransaction = cmbDefultTransaction.Text; tb.Status = cmbStatus.Text; db.Suppliers.Add(tb); db.SaveChanges(); FillOpeningBalance(); MessageBox.Show("Successfully Added", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void btnUpdate_Click(object sender, EventArgs e) { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtExpenseNumber.Text); var tb = db.tbl_AddExpenses.Where(x => x.id == idd).FirstOrDefault(); tb.Date = dateTimePicker1.Text; if (txtInvoiceno.Text != "") { decimal invoice = decimal.Parse(txtInvoiceno.Text); tb.InvoiceNumber = invoice; } tb.ExpenseType = cmbExpenseType.Text; tb.ExpensesName = txtExpenseName.Text; tb.CurrencyType = cmbCurrencyType.Text; tb.TransactionType = cmbTransactionType.Text; if (txtAmount.Text != "") { decimal amount = decimal.Parse(txtAmount.Text); tb.Amount = amount; } tb.Notes = txtNotes.Text; tb.PaymentMethods = cmbPaymentMethod.Text; if (txtTax.Text != "") { decimal tax = decimal.Parse(txtTax.Text); tb.TaxAmount = tax; } if (txtTotal.Text != "") { decimal total = decimal.Parse(txtTotal.Text); tb.TotalAmount = total; } db.SaveChanges(); MessageBox.Show("Successfully Updated", "Expense", MessageBoxButtons.OK, MessageBoxIcon.Information); ModFunc.LogFunc(lblUser.Text, "Updated the Expense With ID : '" + txtExpenseNumber.Text + ""); DisplayData(); ClearData(); }
private void DeleteRecord() { try { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtExpenseNumber.Text); var tb = db.tbl_AddExpenses.Where(x => x.id == idd).FirstOrDefault(); db.tbl_AddExpenses.Remove(tb); db.SaveChanges(); MessageBox.Show("Successfully Delete", "Expense", MessageBoxButtons.OK, MessageBoxIcon.Information); ModFunc.LogFunc(lblUser.Text, "Delted the Expense With ID : '" + txtExpenseNumber.Text + ""); DisplayData(); ClearData(); } catch (Exception ex) { } }
private void DeleteRecord() { try { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtIDNo.Text); var tb = db.tbl_AddBank.Where(x => x.id == idd).FirstOrDefault(); db.tbl_AddBank.Remove(tb); db.SaveChanges(); MessageBox.Show("Successfully Deleted", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (txtTresuryName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtid.Text); var tb = db.tbl_AddTreasury.Where(x => x.id == idd).FirstOrDefault(); tb.Date = dateTimePicker1.Text; txtTresuryName.Text = txtTresuryName.Text; tb.AccountType = cmbAccountType.Text; tb.CurrencyType = cmbCurrencyType.Text; tb.Notes = txtNotes.Text; tb.Status = cmbStatus.Text; db.SaveChanges(); MessageBox.Show("Successfully Added", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (txtName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtUserID.Text.ToString()); var tb = db.tblStores.Where(x => x.ID == idd).FirstOrDefault(); tb.Name = txtName.Text; DateTime dtTo = DateTime.Parse(dateTimePicker1.Text); tb.DateCreated = dtTo; tb.Address = txtAddress.Text; tb.EmailAddress = txtemail.Text; tb.MobileNumber = txtmobile.Text; tb.Status = cmbUserType.Text; db.SaveChanges(); MessageBox.Show("Successfully Updated", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void btnSave_Click(object sender, EventArgs e) { if (txtName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); tblStore tb = new tblStore(); tb.Name = txtName.Text; DateTime dtTo = DateTime.Parse(dateTimePicker1.Text); tb.DateCreated = dtTo; tb.Address = txtAddress.Text; tb.EmailAddress = txtemail.Text; tb.MobileNumber = txtmobile.Text; tb.Status = cmbUserType.Text; db.tblStores.Add(tb); db.SaveChanges(); MessageBox.Show("Successfully Added", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void btnUpdate_Click(object sender, EventArgs e) { Inventory_DBEntities db = new Inventory_DBEntities(); int idd = int.Parse(txtID.Text.ToString()); var tb = db.tbl_Currency.Where(x => x.ID == idd).FirstOrDefault(); tb.Name = combo_Currency.Text; decimal valuee = decimal.Parse(txt_cur_rate.Text.ToString()); tb.value = valuee; tb.Status = combo_status.Text; db.SaveChanges(); MessageBox.Show("Successfully Updated", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); this.ActiveControl = combo_Currency; combo_Currency.Focus(); }
private void btnSave_Click(object sender, EventArgs e) { if (txtTresuryName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); tbl_AddTreasury tb = new tbl_AddTreasury(); Random rr = new Random(); int bankno = rr.Next(100, 900); tb.TreasuryNumber = bankno; tb.Date = dateTimePicker1.Text; txtTresuryName.Text = txtTresuryName.Text; tb.AccountType = cmbAccountType.Text; tb.CurrencyType = cmbCurrencyType.Text; tb.Notes = txtNotes.Text; tb.Status = cmbStatus.Text; db.tbl_AddTreasury.Add(tb); db.SaveChanges(); MessageBox.Show("Successfully Added", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void DeleteRecord() { try { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtID.Text.ToString()); var tb = db.tblItemMasters.Where(x => x.ID == idd).FirstOrDefault(); db.tblItemMasters.Remove(tb); db.SaveChanges(); MessageBox.Show("Successfully Deleted", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); barcodenumber(); procode(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (txtBankName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtIDNo.Text); var tb = db.tbl_AddBank.Where(x => x.id == idd).FirstOrDefault(); tb.Date = dtpTranactionDate.Text; tb.AccountType = cmbAccountType.Text; tb.CurrencyType = cmbCurrencyType.Text; tb.BankName = txtBankName.Text; tb.BranchName = txtBranchName.Text; tb.Address = txtAddress.Text; tb.Phone = txtPhonenumber.Text; tb.Email = txtEmail.Text; tb.Status = cmbStatus.Text; db.SaveChanges(); MessageBox.Show("Successfully Updated", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (txtWalletName.Text != "") { Inventory_DBEntities db = new Inventory_DBEntities(); decimal idd = decimal.Parse(txtid.Text); var tb = db.tbl_AddWallet.Where(x => x.id == idd).FirstOrDefault(); tb.Date = dateTimePicker1.Text; tb.AccountType = cmbAccountType.Text; tb.CurrencyType = cmbCurrencyType.Text; tb.WalletName = txtWalletName.Text; if (TxtOpeningBalance.Text != "") { decimal opening = decimal.Parse(TxtOpeningBalance.Text); tb.OpeningBalance = opening; } tb.Status = cmbStatus.Text; db.SaveChanges(); MessageBox.Show("Successfully Updated", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); } }
private void lnk_sve_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { Inventory_DBEntities db = new Inventory_DBEntities(); tblItemMaster tb = new tblItemMaster(); tb.Barcode1 = txt_Barcode1.Text; tb.Barcode2 = txt_Barcode2.Text; tb.Code = txt_Productcode.Text; tb.NameArabic = txt_ProductnameArabic.Text; tb.NameEng = txt_ProductnameEng.Text; tb.StoreType = combo_Store.Text; tb.BrandName = combo_Brand.Text; tb.Category = combo_Category.Text; tb.Unit = combo_Unit.Text; tb.Color = combo_Color.Text; tb.Description = txt_Description.Text; if (txt_QtyPerUnit.Text != "") { decimal qtyperunit = decimal.Parse(txt_QtyPerUnit.Text.ToString()); tb.QtyPerUnit = qtyperunit; } tb.CompanyProduct = txt_CompanyProduct.Text; tb.VenderPreferred = txt_PreferredVender.Text; tb.DiscountType = combo_DiscountType.Text; if (txt_DirectDiscount.Text != "") { decimal direct = decimal.Parse(txt_DirectDiscount.Text.ToString()); tb.DirectDiscount = direct; } if (txt_NextShoppingDiscount.Text != "") { decimal nextshopping = decimal.Parse(txt_NextShoppingDiscount.Text.ToString()); tb.NextShoppingDiscount = nextshopping; } if (txt_NextShoppingDiscount.Text != "") { decimal taxpercentage = decimal.Parse(txt_TaxPercentage.Text.ToString()); tb.TaxPercentage = taxpercentage; } if (txt_NextShoppingDiscount.Text != "") { decimal redorder = decimal.Parse(txt_ReorderLevel.Text.ToString()); tb.ReorderLevel = redorder; } DateTime manu = DateTime.Parse(dateTimePicker2.Text); tb.ManufacturingDate = manu; DateTime expire = DateTime.Parse(dateTimePicker1.Text); tb.ExpireDate = expire; tb.PurchaseCurrency = combo_PurchaseCurency.Text; tb.SellingCurrency = combo_SellingCurrency.Text; if (txt_WholeSalePrice.Text != "") { decimal wholesale = decimal.Parse(txt_WholeSalePrice.Text.ToString()); tb.WholeSalePrice = wholesale; } if (txt_PurchasePrice.Text != "") { decimal purchaseprice = decimal.Parse(txt_PurchasePrice.Text.ToString()); tb.PurchasePrice = purchaseprice; } if (txt_PurchasePrice.Text != "") { decimal customerprice = decimal.Parse(txt_CustomerPrice.Text.ToString()); tb.CustomerPrice = customerprice; } if (txt_RetailPrice.Text != "") { decimal retialprice = decimal.Parse(txt_RetailPrice.Text.ToString()); tb.RetailPrice = retialprice; } if (txt_AddProfit.Text != "") { decimal addprofit = decimal.Parse(txt_AddProfit.Text.ToString()); tb.AddProfit = addprofit; } tb.Status = combo_Status.Text; db.tblItemMasters.Add(tb); db.SaveChanges(); MessageBox.Show("Successfully Added", "Record", MessageBoxButtons.OK, MessageBoxIcon.Information); refreshGrid(); ClearField(); }