private void btnShow_Click(object sender, EventArgs e) { try { if (cmbCustomerName.SelectedIndex == 0) { if (Utility.Langn == "English") { MessageBox.Show("Please Select customer name"); } else { MessageBox.Show("कृपया ग्राहक निवडा"); } cmbCustomerName.Focus(); return; } else { DataTable dtChallaneList = SaleDetailsController.getChallenList(Convert.ToInt64(cmbCustomerName.SelectedValue), Convert.ToDateTime(dtpFromChallanDate.Value.ToShortDateString()), Convert.ToDateTime(dtpToChallanDate.Value.ToShortDateString()), Utility.FinancilaYearId); dgvSaleChallan.DataSource = dtChallaneList; dgvSaleChallan.ReadOnly = false; dgvSaleChallan.Columns[0].ReadOnly = true; dgvSaleChallan.Columns[1].ReadOnly = true; dgvSaleChallan.Columns[2].ReadOnly = true; dgvSaleChallan.Columns[3].ReadOnly = true; } } catch (Exception ae) { MessageBox.Show(ae.Message); } }
private void btnnew_Click(object sender, EventArgs e) { try { Utility.ClearSpace(this); Utility.enableFields(this); btnSave.Enabled = true; grbList.Visible = false; dgvItemName.Hide(); dgvSaleItems.Rows.Clear(); dgvSaleItems.Rows.Add(); isUpdate = false; isDelete = false; dtpChallenDate.MaxDate = Utility.lastDate; dtpChallenDate.MinDate = Utility.firstDate; if (dtpChallenDate.Value < Utility.firstDate || dtpChallenDate.Value > Utility.lastDate) { dtpChallenDate.Value = Utility.firstDate; } dtpFromChallanDate.MinDate = Utility.firstDate; dtpFromChallanDate.MaxDate = Utility.lastDate; dtpToChallanDate.MinDate = Utility.firstDate; dtpToChallanDate.MaxDate = Utility.lastDate; dtpFromChallanDate.Value = Utility.firstDate; dtpToChallanDate.Value = Utility.lastDate; txtInvoice.Text = SaleDetailsController.getMaxIdSalesItemDetails(7, Utility.FinancilaYearId).ToString(); bindaccountName(true); damagedStockExpiryId = 0; transactionId = 0; } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnnew_Click(object sender, EventArgs e) { try { Utility.ClearSpace(this); Utility.enableFields(this); panel1.Enabled = true; btnSave.Enabled = true; btnDelete.Enabled = false; pnlUpdateTransfer.Visible = false; dgvList.Visible = false; isUpdate = isDelete = false; if (Utility.Langn == "English") { btnSave.Text = "Save"; } else { btnSave.Text = "जतन"; } pnlgodownSearch.Visible = false; dtpDate.MaxDate = Utility.lastDate; dtpDate.MinDate = Utility.firstDate; godownTransferId1 = SaleDetailsController.getMaxIdSalesItemDetails(5, Utility.FinancilaYearId).ToString(); txtInvoice.Text = SaleDetailsController.getMaxIdSalesItemDetails(6, Utility.FinancilaYearId).ToString(); txtId.Text = godownTransferId1; dgvGodownTransfer.Rows.Clear(); dgvGodownTransfer.Rows.Add(); dgvGodownTransfer.Columns["itemName"].ReadOnly = false; BindFromGodownDetails(); pnlUpdateTransfer.Visible = false; BindToGodownDetails(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void dgvPandingChalan_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { dgvPurchaseItems.Enabled = true; DataTable dtSaleChallen = new DataTable(); if (rbCustomer.Checked == true) { dtSaleChallen = SaleDetailsController.getSaleChallenDetails(Convert.ToInt64(dgvPandingChalan.CurrentRow.Cells["SalesChallanBillId"].Value), Utility.FinancilaYearId); dgvPurchaseItems.Visible = false; dgvSaleItems.Visible = true; bindSaleItemDetails(dtSaleChallen); } if (rbDealer.Checked == true) { dtSaleChallen = purchaseDetailsController.getSaleChallenDetails(Convert.ToInt64(dgvPandingChalan.CurrentRow.Cells["salesChallanId"].Value), Utility.FinancilaYearId); dgvPurchaseItems.Visible = true; dgvSaleItems.Visible = false; bindPurchaseItemDetails(dtSaleChallen); } dgvPurchaseItems.ClearSelection(); dgvSaleItems.ClearSelection(); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (cmbFromGodown.SelectedIndex == 0 || cmbFromGodown.SelectedValue == null) { if (Utility.Langn == "English") { MessageBox.Show("Please select From Godown...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("कृपया From गोडाऊन निवडा...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } cmbFromGodown.Focus(); return; } if (cmbtoGodown.SelectedIndex == 0 || cmbtoGodown.SelectedValue == null) { if (Utility.Langn == "English") { MessageBox.Show("Please select To Godown...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("कृपया To गोडाऊन निवडा...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } cmbtoGodown.Focus(); return; } if (cmbFromGodown.Text.Trim() == cmbtoGodown.Text.Trim()) { if (Utility.Langn == "English") { MessageBox.Show("Please Change To Godown...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MessageBox.Show("कृपया To गोडाऊन बदला...!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } cmbtoGodown.Focus(); return; } for (int c = 0; c < dgvGodownTransfer.Rows.Count; c++) { if (dgvGodownTransfer.Rows[c].Cells["itemName"].Value == null) { if (Utility.Langn == "English") { MessageBox.Show("Please add Item Name in list.."); } else { MessageBox.Show("कृपया लिस्ट मध्ये वस्तूचे नाव भरा.."); } dgvGodownTransfer.Focus(); dgvGodownTransfer.CurrentCell = dgvGodownTransfer.Rows[c].Cells["itemName"]; return; } if (dgvGodownTransfer.Rows[c].Cells["Quantity"].Value == null || Convert.ToDouble(dgvGodownTransfer.Rows[c].Cells["Quantity"].Value) == 0) { if (Utility.Langn == "English") { MessageBox.Show("Please add Quantity in list.."); } else { MessageBox.Show("कृपया लिस्ट मध्ये वस्तूचे नाव भरा.."); } dgvGodownTransfer.Focus(); dgvGodownTransfer.CurrentCell = dgvGodownTransfer.Rows[c].Cells["Quantity"]; return; } } godownTransfer gm = new godownTransfer(); if (isUpdate == false && isDelete == false) { gm.godownTransferId = SaleDetailsController.getMaxIdSalesItemDetails(5, Utility.FinancilaYearId); gm.invoiceId = SaleDetailsController.getMaxIdSalesItemDetails(6, Utility.FinancilaYearId); } else { gm.godownTransferId = Convert.ToInt64(txtId.Text); gm.invoiceId = Convert.ToInt64(txtInvoice.Text); } gm.godownTransferDate = dtpDate.Value; gm.fromGodownTransfer = cmbFromGodown.Text.Trim(); gm.toGodownTransfer = cmbtoGodown.Text.Trim(); gm.isDelete = isDelete; gm.isUpdate = isUpdate; DataTable dtSaleItems = new DataTable(); foreach (DataGridViewColumn col in dgvGodownTransfer.Columns) { dtSaleItems.Columns.Add(col.Name); } foreach (DataGridViewRow row in dgvGodownTransfer.Rows) { DataRow dRow = dtSaleItems.NewRow(); foreach (DataGridViewCell cell in row.Cells) { if (cell.Value == null) { if (Utility.Langn == "English") { MessageBox.Show("Please add all details in list"); } else { MessageBox.Show("कृपया लिस्ट मध्ये पूर्ण माहिती भरा"); } return; } dRow[cell.ColumnIndex] = cell.Value; } dtSaleItems.Rows.Add(dRow); } gm.dtItems = dtSaleItems; gm.FinancialYearID = Utility.FinancilaYearId; gm.addedBy = 1; gm.addedOn = dtpDate.Value; int i = 0; string msg = ""; if (isDelete == false) { if (Utility.Langn == "English") { msg = "Record Saved successfully !! "; } else { msg = "माहिती यशस्वीरित्या साठवल्या गेली !! "; } i = godownTransferController.addGodownTransfer(gm); } if (isDelete == true) { if (Utility.Langn == "English") { msg = "Record Deleted successfully!! "; } else { msg = "माहिती यशस्वीरित्या डिलीट झाली आहे!! "; } i = godownTransferController.addGodownTransfer(gm); } if (i > 0) { MessageBox.Show(msg, "जतन", MessageBoxButtons.OK, MessageBoxIcon.Information); btnnew_Click(sender, e); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnSave_Click(object sender, EventArgs e) { try { for (int i = 0; i < dgvSaleItems.Rows.Count; i++) { if (dgvSaleItems.Rows[i].Cells["itemName"].Value == null) { if (Utility.Langn == "English") { MessageBox.Show("Please add Item Name in list ...!"); } else { MessageBox.Show("कृपया लिस्ट मध्ये वस्तूचे नाव भरा.."); } dgvSaleItems.Focus(); dgvSaleItems.CurrentCell = dgvSaleItems.Rows[i].Cells["itemName"]; return; } if (dgvSaleItems.Rows[i].Cells["Quantity"].Value == null) { if (Utility.Langn == "English") { MessageBox.Show("Please Add Quantity in list ...!"); } else { MessageBox.Show("कृपया लिस्ट मध्ये नग भरा.."); } dgvSaleItems.Focus(); dgvSaleItems.CurrentCell = dgvSaleItems.Rows[i].Cells["Quantity"]; return; } if (dgvSaleItems.Rows[i].Cells["purchaseRate"].Value == null) { if (Utility.Langn == "English") { MessageBox.Show("Please add Rate in list ...!"); } else { MessageBox.Show("कृपया लिस्ट मध्ये दर भरा.."); } dgvSaleItems.Focus(); dgvSaleItems.CurrentCell = dgvSaleItems.Rows[i].Cells["purchaseRate"]; return; } } damagedStockExpiry sale = new damagedStockExpiry(); DataTable dtSaleItems = new DataTable(); foreach (DataGridViewColumn col in dgvSaleItems.Columns) { dtSaleItems.Columns.Add(col.Name); } foreach (DataGridViewRow row in dgvSaleItems.Rows) { DataRow dRow = dtSaleItems.NewRow(); foreach (DataGridViewCell cell in row.Cells) { if (cell.Value == null) { if (Utility.Langn == "English") { MessageBox.Show("Please Add all details in list"); } else { MessageBox.Show("कृपया लिस्ट मध्ये पूर्ण माहिती भरा"); } return; } dRow[cell.ColumnIndex] = cell.Value; } dtSaleItems.Rows.Add(dRow); } sale.dtItems = dtSaleItems; sale.damagedStockDate = dtpChallenDate.Value; if (isUpdate == false) { sale.damagedStockExpiryId = 0; sale.InvoiceId = SaleDetailsController.getMaxIdSalesItemDetails(7, Utility.FinancilaYearId); } else { sale.damagedStockExpiryId = damagedStockExpiryId; sale.InvoiceId = Convert.ToInt64(txtInvoice.Text); } sale.transactionId = transactionId; sale.Amount = Utility.ParseValue(txtNetAmount.Text); sale.Remark = txtNaration.Text; sale.addedBy = Utility.LoginID; sale.accountId = Convert.ToInt64(cmbAccountName.SelectedValue); sale.isDelete = isDelete; sale.isUpdate = isUpdate; sale.FinancialYearID = Utility.FinancilaYearId; sale.addedOn = dtpChallenDate.Value; sale.transactionId = 0; int s = damagedStockExpiryController.adddamagedStockExpiry(sale); if (s > 0) { if (Utility.Langn == "English") { MessageBox.Show("This record saved successfully..!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("सदर नोंद यशस्वीरित्या साठवले गेले आहे..!", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information); } btnnew_Click(sender, e); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }