private void btnAdd_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtCategoriesName.Text)) { MessageBox.Show("Please Enter Category Name"); } else { AddUpdate add = new AddUpdate(); add.addUpdateCategories( txtCategoriesName.Text, txtCategoryDesc.Text, 0, 0 ); // 0 for add Get get = new Get(); dgvAllCategoriesDetails.DataSource = null; dgvAllCategoriesDetails.DataSource = get.getAllCategoriesDetails(); this.IDToUpdate_Categoires = 0; txtCategoriesName.Clear(); txtCategoryDesc.Clear(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (dgvFinalProducts.RowCount < 1) { MessageBox.Show("Please Add Products Firts"); return; } AddUpdate add = new AddUpdate(); add.addTransactionDetails( Convert.ToInt32(cmbCustomer.SelectedValue), DateTime.Now.Date, Convert.ToDouble(txtBillAmount.Text) ); for (int i = 0; i < dgvFinalProducts.RowCount; i++) { add.addTransactionProductDetails( Convert.ToDouble(dgvFinalProducts.Rows[i].Cells[2].Value), //Quantity Convert.ToDouble(dgvFinalProducts.Rows[i].Cells[3].Value), //amount dgvFinalProducts.Rows[i].Cells[0].Value.ToString() //item name ); } //subtract stock for (int i = 0; i < dgvFinalProducts.RowCount; i++) { AddUpdate update = new AddUpdate(); update.addUpdateStockDetails( 0, // not being used 0, // not being used Convert.ToDouble(dgvFinalProducts.Rows[i].Cells[2].Value), // minus this quantuty 0, // not being used 0, // not being used dgvFinalProducts.Rows[i].Cells[0].Value.ToString(), //item name 0, 1 // UPDATE (MINUS STOCK) ); } dgvFinalProducts.DataSource = null; MessageBox.Show("Data Added"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { if ( string.IsNullOrEmpty(txtItemName.Text) || string.IsNullOrEmpty(txtItemCode.Text) || string.IsNullOrEmpty(txtMinLevelStock.Text) || string.IsNullOrEmpty(txtReorderQty.Text) || string.IsNullOrEmpty(txtRemarks.Text) || string.IsNullOrEmpty(txtSeqNo.Text) || string.IsNullOrEmpty(txtSellingRate.Text) ) { MessageBox.Show("Please Enter Complete Information"); } else { AddUpdate add = new AddUpdate(); add.addUpdateProducts( txtItemName.Text, txtItemCode.Text, txtSeqNo.Text, txtMinLevelStock.Text, txtReorderQty.Text, txtRemarks.Text, cmbType.Text, Convert.ToInt32(cmbCategory.SelectedValue), Convert.ToInt32(cmbSubCategory.SelectedValue), Convert.ToDouble(txtSellingRate.Text), 0, 0 ); // 0 for add MessageBox.Show("DATA ADEED"); //clear txtItemName.Clear(); txtItemCode.Clear(); txtSeqNo.Clear(); txtMinLevelStock.Clear(); txtReorderQty.Clear(); txtRemarks.Clear(); cmbType.Text = ""; txtSellingRate.Clear(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnAdd_Click(object sender, EventArgs e) { try { if ( string.IsNullOrEmpty(txtCustomerName.Text) ) { MessageBox.Show("Please Enter Information In All The Fields With '*' .."); } else { AddUpdate add = new AddUpdate(); add.addUpdateCustomerDetails( txtCustomerName.Text, txtAddress.Text, txtFaxNumber.Text, txtRemarks.Text, txtCustomerCOde.Text, txtCity.Text, txtAddress2.Text, txtMobileNO.Text, txtEmailID.Text, 0, 0 // ADD ); MessageBox.Show("Data Added"); txtCustomerName.Clear(); txtAddress.Clear(); txtFaxNumber.Clear(); txtRemarks.Clear(); txtCustomerCOde.Clear(); txtCity.Clear(); txtAddress2.Clear(); txtMobileNO.Clear(); txtEmailID.Clear(); Get get = new Get(); dgvAllCustomerDetails.DataSource = null; dgvAllCustomerDetails.DataSource = get.getAllCustomerDetails(); this.idToUpdate = 0; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnUpdate_Click(object sender, EventArgs e) { try { if ( string.IsNullOrEmpty(txtCustomerName.Text) ) { MessageBox.Show("Select Record By Double Clicking.."); } else { AddUpdate add = new AddUpdate(); add.addUpdateCustomerDetails( txtCustomerName.Text, txtAddress.Text, txtFaxNumber.Text, txtRemarks.Text, txtCustomerCOde.Text, txtCity.Text, txtAddress2.Text, txtMobileNO.Text, txtEmailID.Text, this.idToUpdate, 1 // UPDATE ); MessageBox.Show("Data Updated"); txtCustomerName.Clear(); txtAddress.Clear(); txtFaxNumber.Clear(); txtRemarks.Clear(); txtCustomerCOde.Clear(); txtCity.Clear(); txtAddress2.Clear(); txtMobileNO.Clear(); txtEmailID.Clear(); Get get = new Get(); dgvAllCustomerDetails.DataSource = null; dgvAllCustomerDetails.DataSource = get.getAllCustomerDetails(); this.idToUpdate = 0; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { if ( string.IsNullOrEmpty(txtQuantity.Text) || string.IsNullOrEmpty(txtRate.Text) || string.IsNullOrEmpty(txtAmount.Text) ) { MessageBox.Show("Enter Complete Information"); } else { AddUpdate addUpdate = new AddUpdate(); addUpdate.addUpdateStockDetails( Convert.ToDouble(txtAmount.Text), Convert.ToDouble(txtRate.Text), Convert.ToDouble(txtQuantity.Text), Convert.ToInt32(cmbItemName.SelectedValue), Convert.ToInt32(cmbUnit.SelectedValue), "", //not being used 0, 0 // ADD ); MessageBox.Show("Stock Added"); txtAmount.Clear(); txtRate.Clear(); txtQuantity.Clear(); Get get = new Get(); dgvAllStockDetails.DataSource = null; dgvAllStockDetails.DataSource = get.getAllStockDetails(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnUpdate_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtCategoriesName.Text)) { MessageBox.Show("Please Select A Record To Update By Double Clicking.."); } else { if (this.IDToUpdate_Categoires == 0) { MessageBox.Show("Please Select A Record To Update By Double Clicking.."); return; } else { AddUpdate add = new AddUpdate(); add.addUpdateCategories( txtCategoriesName.Text, txtCategoryDesc.Text, this.IDToUpdate_Categoires, 1 ); // 1 for UPDATE Get get = new Get(); dgvAllCategoriesDetails.DataSource = null; dgvAllCategoriesDetails.DataSource = get.getAllCategoriesDetails(); this.IDToUpdate_Categoires = 0; txtCategoriesName.Clear(); txtCategoryDesc.Clear(); } } } catch (Exception EX) { MessageBox.Show(EX.Message); } }
private void btnUpdate_Click(object sender, EventArgs e) { try { AddUpdate update = new AddUpdate(); update.addUpdateUnitMeasure( txtUnitMeasure.Text, this.idToUpdate, 1 ); // UPDATE txtUnitMeasure.Clear(); MessageBox.Show("DATA UDPATED"); this.idToUpdate = 0; Get get = new Get(); dgvUnitMeasures.DataSource = null; dgvUnitMeasures.DataSource = get.getAllUnitMeasureDetails(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnAdd_Click(object sender, EventArgs e) { try { AddUpdate add = new AddUpdate(); add.addUpdateUnitMeasure( txtUnitMeasure.Text, 0, 0 ); // ADD txtUnitMeasure.Clear(); this.idToUpdate = 0; MessageBox.Show("DATA ADDED"); Get get = new Get(); dgvUnitMeasures.DataSource = null; dgvUnitMeasures.DataSource = get.getAllUnitMeasureDetails(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }