private void dgvAddSubCategory_CellClick(object sender, DataGridViewCellEventArgs e) { { if (dgvAddSubCategory.Columns[e.ColumnIndex] == clmbtnDelete) { intSubCategoryID = Convert.ToInt32(dgvAddSubCategory.Rows[e.RowIndex].Cells[clmintSubCategoryID.Name].Value); DialogResult dr = MessageBox.Show("Are you sure want to Delete in this SubCategory ?", "CONFIRMATION", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intSubCategoryID", intSubCategoryID), }; int NoOfRowsEffected = objExecute.Executes("spDeleteSubcategory", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Successfully DELETE !"); LoadGrid(); } else { MessageBox.Show("SubCategory DELETE Process Error !"); } } } } }
//measure code grid delete item private void dgvMeasureDetails_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgvMeasureDetails.Columns[e.ColumnIndex] == clmbtnDeleteDescription) { MeasureUnitID = Convert.ToInt32(dgvMeasureDetails.Rows[e.RowIndex].Cells[clmMeasureUnitID.Name].Value); DialogResult dr = MessageBox.Show("Are you sure want to Delete in this Measure Code ?", "CONFIRMATION", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intMeasureUnitID", MeasureUnitID), }; int NoOfRowsEffected = objExecute.Executes("spDeleteMeasureUnit", param, CommandType.StoredProcedure); if (NoOfRowsEffected == 1) { MessageBox.Show("Successfully DELETE !"); GetMeasureUnitDetails(); GetMeasureUnit(); } else { MessageBox.Show("Measure Code DELETE Process Error !"); } } } }
//API delete private void dgvAPI_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgvAPI.Columns[e.ColumnIndex] == clmbtnDelete) { API = Convert.ToInt32(dgvAPI.Rows[e.RowIndex].Cells[clmAPIID.Name].Value); DialogResult dr = MessageBox.Show("Are you sure want to Delete in this API ?", "CONFIRMATION", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intAPIID", API), }; int NoOfRowsEffected = objExecute.Executes("spDeleteAPI", param, CommandType.StoredProcedure); if (NoOfRowsEffected == 1) { MessageBox.Show("SUCCESSFULLY DELETE !"); GetAPI(); } else { MessageBox.Show("API Delete Error !"); } } } }
public void SaveSubCategory() { DialogResult dr = MessageBox.Show("Are You Sure Want to Add Sub Category ?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intMainCategoryID", Convert.ToInt32(cmbMainCategory.SelectedValue)), Execute.AddParameter("@vcSubCategoryName", txtSubCategory.Text.Trim().ToUpper()), }; int NoOfRowsEffected = objExecute.Executes("SaveSubCategory", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Save.."); LoadGrid(); txtSubCategory.Text = String.Empty; } else { MessageBox.Show("Cant't Save.."); } } }
public void GetCustomerInfo() { DetailsFromItemID = Convert.ToInt32(txtItemID.Text.ToUpper()); string OIL; decimal unitprice; decimal stockHand; Execute objExecute = new Execute(); string Query = "[dbo].[spGetItemInfo]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intItemID ", DetailsFromItemID) }; DataSet ds = (DataSet)objExecute.Executes(Query, ReturnType.DataSet, para, CommandType.StoredProcedure); if (ds.Tables[0].Rows.Count > 0) { intItemInfo = Convert.ToInt32(ds.Tables[0].Rows[0]["intItemID"].ToString()); unitprice = Convert.ToDecimal(ds.Tables[0].Rows[0]["decUnitPrice"].ToString()); txtUnitPrice.Text = unitprice.ToString(); stockHand = Convert.ToInt32(ds.Tables[0].Rows[0]["decStockInHand"]); txtStockInHand.Text = stockHand.ToString(); txtItemCode.Text = ds.Tables[0].Rows[0]["vcItemCode"].ToString(); txtDec.Text = ds.Tables[0].Rows[0]["vcItemDescription"].ToString(); lblBrandName.Text = ds.Tables[0].Rows[0]["vcBrandName"].ToString(); lblMainCategory.Text = ds.Tables[0].Rows[0]["vcMainCategoryName"].ToString(); lblSubCategory.Text = ds.Tables[0].Rows[0]["vcSubCategoryName"].ToString(); lblMUnit.Text = ds.Tables[0].Rows[0]["vcMeasureUnitDesc"].ToString(); lblMUSize.Text = ds.Tables[0].Rows[0]["vcUnit"].ToString(); lblAPIGrade.Text = ds.Tables[0].Rows[0]["vcAPI"].ToString(); lblSAEGrade.Text = ds.Tables[0].Rows[0]["vcSAE"].ToString(); lblEngineType.Text = ds.Tables[0].Rows[0]["vcEngineType"].ToString(); dt = Convert.ToDateTime(ds.Tables[0].Rows[0]["dtEnteredDate"].ToString()); if (lblMainCategory.Text == "OIL") { txtItemCode.ReadOnly = true; } else { labelAPI.Text = string.Empty; labeldot.Text = string.Empty; labelSAE.Text = string.Empty; labelSAEbot.Text = string.Empty; labelENGING.Text = string.Empty; labelEnginedot.Text = string.Empty; } } else { MessageBox.Show("Please Register Customer"); //txtvcVehicle.Focus(); } }
public void GetGRNNo() { List <GRNEntity> lstGRNNo = new List <GRNEntity>(); Execute objExecute = new Execute(); string Query = "[dbo].[spGetGRNNo]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intSupplierID", Convert.ToInt32(cmbSupplier.SelectedValue)), }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); foreach (DataRow dr in dt.Rows) { objGRNEntity = new GRNEntity { intGRNHeaderID = Convert.ToInt32(dr["intGRNHeaderID"]), vcGRNNo = dr["vcGRNNo"].ToString() }; lstGRNNo.Add(objGRNEntity); } cmbGRNNo.DataSource = lstGRNNo; cmbGRNNo.DisplayMember = "vcGRNNo"; cmbGRNNo.ValueMember = "intGRNHeaderID"; cmbGRNNo.SelectedIndex = -1; }
public void UpdateItem() { try { using (TransactionScope ts = new TransactionScope()) { DialogResult dr = MessageBox.Show("Are You Sure Want to Update Item ?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intItemID", Convert.ToInt32(txtItemID.Text.Trim())), Execute.AddParameter("@decStockInHand", Convert.ToDecimal(txtStockInHand.Text.Trim())), Execute.AddParameter("@decUnitPrice", Convert.ToDecimal(txtUnitPrice.Text.Trim())), Execute.AddParameter("@vcItemCode", txtItemCode.Text.ToUpper()), Execute.AddParameter("@vcItemDescription", txtDec.Text.ToUpper()), Execute.AddParameter("@dtEnteredDate", Convert.ToDateTime(dt)) }; objExecute.Executes("spEditItem", param, CommandType.StoredProcedure); MessageBox.Show("Update Item.."); Clear(); } ts.Complete(); } this.Close(); } catch (Exception ex) { MessageBox.Show("Data Updating Error"); Logger.LoggError(ex, "btnSave_Click"); } }
public void GetBrandWiseSubCat() { Execute objExecute = new Execute(); List <CategoryEntity> lstCategory = new List <CategoryEntity>(); string Query = "[dbo].[spGetBrandWiseSubCat]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intBrandID", Convert.ToInt32(cmbBrand.SelectedValue)) }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); foreach (DataRow dr in dt.Rows) { CategoryEntity objCategoryEntity = new CategoryEntity { intSubCatDetailsID = Convert.ToInt32(dr["intSubCatDetailsID"]), intSubCatID = Convert.ToInt32(dr["intSubCatID"]), intBrandID = Convert.ToInt32(dr["intBrandID"]), vcSubCategoryName = dr["vcSubCategoryName"].ToString(), }; lstCategory.Add(objCategoryEntity); } dgvSubCat.DataSource = null; dgvSubCat.AutoGenerateColumns = false; dgvSubCat.DataSource = lstCategory.ToList(); GlobleCategoryEntity = lstCategory; }
private void LoadGrid() { try { Execute objExecute = new Execute(); string Query = "[dbo].[spGetReturnToCustomerDetails]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intIssueHeaderID", Convert.ToInt32(cmbInvoiceNo.SelectedValue)), }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); IssueEntity objIssueEntity; List <IssueEntity> lstGetItem = new List <IssueEntity>(); foreach (DataRow dr in dt.Rows) { objIssueEntity = new IssueEntity { intIssueDetailID = (int)dr["intIssueDetailID"], vcItemCode = dr["vcItemCode"].ToString(), vcItemDescription = dr["vcItemDescription"].ToString(), vcUnit = dr["vcUnit"].ToString(), IssuedQty = (int)dr["IssuedQty"], decUnitPrice = (decimal)dr["decUnitPrice"], decDiscountedUnitValue = (decimal)dr["decDiscountedUnitValue"], decStockInHand = (int)dr["decStockInHand"], AleadyReturnedQty = (int)dr["AleadyReturnedQty"], IsAleadyReturned = (int)dr["IsAleadyReturned"], }; lstGetItem.Add(objIssueEntity); } dgvReturnItem.DataSource = null; dgvReturnItem.AutoGenerateColumns = false; dgvReturnItem.DataSource = lstGetItem.ToList(); //set return Qty to 0 from grid load foreach (DataGridViewRow row in dgvReturnItem.Rows) { for (int i = 0; i < dgvReturnItem.Rows.Count; i++) { row.Cells[dgvReturnItem.Columns[clmReturnQty.Name].Index].Value = 0; } } } catch (Exception ex) { MessageBox.Show("Data Loading Error"); Logger.LoggError(ex, "LoadGrid"); } }
public void DescriptionSave() { if (txtMeasureCode.Text == string.Empty) { MessageBox.Show("Please Enter Measure Code!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else if (txtMeasureDesc.Text == string.Empty) { MessageBox.Show("Please Enter Measure Description!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (GlobleMeasureUnitDetails == null) { GlobleMeasureUnitDetails = new List <ItemEntity>(); } if (GlobleMeasureUnitDetails.Find(x => x.vcMeasureUnit == (txtMeasureCode.Text.ToUpper())) != null) { MessageBox.Show("You can't Add Same API!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtMeasureCode.Text = string.Empty; txtMeasureCode.Focus(); return; } DialogResult dr = MessageBox.Show("Are You Sure Want to Add New Measure Unit ?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@vcMeasureUnit", txtMeasureCode.Text.Trim().ToUpper()), Execute.AddParameter("@vcMeasureUnitDesc", txtMeasureDesc.Text.Trim().ToUpper()), }; int NoOfRowsEffected = objExecute.Executes("spSaveMeasureUnit", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Save.."); txtMeasureCode.Text = string.Empty; txtMeasureDesc.Text = string.Empty; GetMeasureUnitDetails(); GetMeasureUnit(); } else { MessageBox.Show("Cant't Save.."); } } }
public void unitSizeSave() { if (cmbMeasureUnit.SelectedIndex == -1) { MessageBox.Show("Please select the Measure Unit!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else if (txtMeasureUnitSize.Text == string.Empty) { MessageBox.Show("Please enter the unit size!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (GlobleMeasureSizes == null) { GlobleMeasureSizes = new List <ItemEntity>(); } if (GlobleMeasureSizes.Find(x => x.decQty == Convert.ToInt32(txtMeasureUnitSize.Text.ToUpper())) != null) { MessageBox.Show("You can't Add Same Size!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtMeasureUnitSize.Text = string.Empty; txtMeasureUnitSize.Focus(); return; } DialogResult dr = MessageBox.Show("Are You Sure Want to Add New Unit Size?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); decimal MeasureUnitSize = Convert.ToDecimal(txtMeasureUnitSize.Text.ToString()); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@decQty", MeasureUnitSize), Execute.AddParameter("@intMeasureUnitID", Convert.ToInt32(cmbMeasureUnit.SelectedValue)), }; int NoOfRowsEffected = objExecute.Executes("spSavePackingMethods", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Save.."); txtMeasureUnitSize.Text = string.Empty; GetMeasureSize(); } else { MessageBox.Show("Cant't Save.."); } } }
private void btnAssign_Click(object sender, EventArgs e) { if (cmbBrand.SelectedIndex == -1) { MessageBox.Show("Please select the Brand"); return; } else if (cmbSubCat.SelectedIndex == -1) { MessageBox.Show("Please select the SubCategory"); return; } if (GlobleCategoryEntity == null) { GlobleCategoryEntity = new List <CategoryEntity>(); } if (GlobleCategoryEntity.Find(x => x.intSubCatID == Convert.ToInt32(cmbSubCat.SelectedValue)) != null) { MessageBox.Show("You can't Assgin SubCategory", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); cmbSubCat.SelectedIndex = -1; return; } DialogResult dr = MessageBox.Show("Are You Sure Want to Assgin SubCategory ?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intBrandID", Convert.ToInt32(cmbBrand.SelectedValue)), Execute.AddParameter("@intSubCatID", Convert.ToInt32(cmbSubCat.SelectedValue)), }; int NoOfRowsEffected = objExecute.Executes("SaveSubCatDetails", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Save.."); GetBrandWiseSubCat(); cmbSubCat.SelectedIndex = -1; } else { MessageBox.Show("Cant't Save.."); cmbSubCat.SelectedIndex = -1; } } }
public void LoadGrid() { Execute objExecute = new Execute(); string Query = "[dbo].[spGetSubCat]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intMainCategoryID", Convert.ToInt32(cmbMainCategory.SelectedValue)) }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); dgvAddSubCategory.DataSource = dt; }
private void dgvViewItemList_CellClick(object sender, DataGridViewCellEventArgs e) { try { //edit if (dgvViewItemList.Columns[e.ColumnIndex] == clmbtnEdit) { frmEditItem obj = new frmEditItem(); obj.txtItemID.Text = dgvViewItemList.SelectedRows[0].Cells[0].Value.ToString(); obj.ShowDialog(); GetAllItemViewItem(); txtDecSearch.Text = string.Empty; txtSearch.Text = string.Empty; } //delete if (dgvViewItemList.Columns[e.ColumnIndex] == clmbtnDelete) { intItemID = Convert.ToInt32(dgvViewItemList.Rows[e.RowIndex].Cells[clmItemID.Name].Value); DialogResult dr = MessageBox.Show("Are you sure want to Delete in this Item ?", "CONFIRMATION", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intItemID", intItemID), }; int NoOfRowsEffected = objExecute.Executes("spDeleteItem", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Successfully DELETE !"); GetAllItemViewItem(); } else { MessageBox.Show("Item DELETE Process Error !"); } } } } catch (Exception ex) { MessageBox.Show("Data Deleting Error"); Logger.LoggError(ex, "dgvViewItemList_CellClick"); } //GetAllItemViewItem(); }
public void GetPackingMethods() { Execute objExecute = new Execute(); string Query = "[dbo].[spGetPackingMethods]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intMeasureUnitID", Convert.ToInt32(cmbMeasureUnit.SelectedValue)) }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); cmbUnitQty.DataSource = dt; cmbUnitQty.DisplayMember = "decQty"; cmbUnitQty.ValueMember = "intPackingMethodID"; cmbUnitQty.SelectedIndex = -1; }
public void GetStockSummeryDetails() { try { Execute objExecute = new Execute(); string Query = "[dbo].[spGetStockSummeryDetails]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intBrandID", Convert.ToInt32(cmbBrand.SelectedValue)), }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); ItemEntity objItemEntity; List <ItemEntity> lstGetItemAdd = new List <ItemEntity>(); foreach (DataRow dr in dt.Rows) { objItemEntity = new ItemEntity { intItemID = (int)dr["intItemID"], vcItemCode = dr["vcItemCode"].ToString(), vcItemDescription = dr["vcItemDescription"].ToString(), vcEngineType = dr["vcEngineType"].ToString(), decStockInHand = (decimal)dr["decStockInHand"], vcSubCategoryName = dr["vcSubCategoryName"].ToString(), vcUnit = dr["vcUnit"].ToString(), decUnitPrice = (decimal)dr["decUnitPrice"], decDiscountedUnitValue = (decimal)dr["decUnitPriceDiscounted"], }; lstGetItemAdd.Add(objItemEntity); } dgvAddItem.DataSource = null; dgvAddItem.AutoGenerateColumns = false; dgvAddItem.DataSource = lstGetItemAdd; GlobalList = lstGetItemAdd.ToList(); } catch (Exception ex) { MessageBox.Show("Data Loading Error"); Logger.LoggError(ex, "GetAllItemIssueAdd"); } }
public void saveAddServiceCharge() { if (txtServiceDec.Text == null || txtServiceDec.Text == "" || txtPrice.Text == null || txtPrice.Text == "") { MessageBox.Show("There is Empty value"); } else { if (GlobleBrandEntity == null) { GlobleBrandEntity = new List <ServiceEntity>(); } if (GlobleBrandEntity.Find(x => x.vcServiceName == (txtServiceDec.Text.ToUpper())) != null) { MessageBox.Show("You can't Add Same Service!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } DialogResult dr = MessageBox.Show("Are You Sure Want to Add New Service ?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@vcServiceName", txtServiceDec.Text.Trim().ToUpper()), Execute.AddParameter("@decPrice", Convert.ToInt32(txtPrice.Text)) }; int NoOfRowsEffected = objExecute.Executes("spSaveServiceCharges", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Save.."); GridLoad(); txtServiceDec.Text = string.Empty; txtPrice.Text = string.Empty; } else { MessageBox.Show("Cant't Save.."); } } } }
private void GetIssueNo() { Execute objExecute = new Execute(); string Query = "[dbo].[spGetDateWiseIssueNo]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@dtFrom", dtFrom.Value.Date), Execute.AddParameter("@dtTo", dtTo.Value.Date) }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); cmbIssueNo.DataSource = dt; cmbIssueNo.DisplayMember = "vcIssueNo"; cmbIssueNo.ValueMember = "intIssueHeaderID"; cmbIssueNo.SelectedIndex = -1; }
public void GetSubCat() { Execute objExecute = new Execute(); string Query = "[dbo].[spGetBrandAndMainWiseSubCat]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intBrandID", Convert.ToInt32(cmbBrand.SelectedValue)), Execute.AddParameter("@intMainCategoryID", Convert.ToInt32(cmbMainCategory.SelectedValue)), }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); cmbSubCat.DataSource = dt; cmbSubCat.DisplayMember = "vcSubCategoryName"; cmbSubCat.ValueMember = "intSubCatDetailsID"; cmbSubCat.SelectedIndex = -1; }
private void GridLoad() { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; Execute objExecuteXX = new Execute(); string Query = "[dbo].[spGetIssueBillDetails]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intIssueHeaderID", Convert.ToInt32(cmbIssueNo.SelectedValue)), }; DataTable dt = (DataTable)objExecuteXX.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; dgvIssueItem.DataSource = null; dgvIssueItem.AutoGenerateColumns = false; dgvIssueItem.DataSource = dt; }
public void GetMeasureSize() { DataTable dt = new DataTable(); List <ItemEntity> lstItemEntity = new List <ItemEntity>(); try { Execute objExecute = new Execute(); string Query = "[dbo].[spGetPackingMethods]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intMeasureUnitID", Convert.ToInt32(cmbMeasureUnit.SelectedValue)), }; dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); foreach (DataRow dr1 in dt.Rows) { ItemEntity objMeasure = new ItemEntity { intPackingMethodID = Convert.ToInt32(dr1["intPackingMethodID"]), decQty = Convert.ToInt32(dr1["decQty"]), vcMeasureUnit = dr1["vcMeasureUnit"].ToString(), }; lstItemEntity.Add(objMeasure); } dgvMeasureSize.DataSource = null; dgvMeasureSize.AutoGenerateColumns = false; dgvMeasureSize.DataSource = lstItemEntity.ToList(); GlobleMeasureSizes = lstItemEntity; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void APIGradeSave() { if (GlobleAPIEntity == null) { GlobleAPIEntity = new List <ItemEntity>(); } if (GlobleAPIEntity.Find(x => x.vcAPI == (txtAPI.Text.ToUpper())) != null) { MessageBox.Show("You can't Add Same API!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtAPI.Text = string.Empty; txtAPI.Focus(); return; } DialogResult dr = MessageBox.Show("Are You Sure Want to Add New API ?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@vcAPI", txtAPI.Text.Trim().ToUpper()), }; int NoOfRowsEffected = objExecute.Executes("spSaveAPI", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Save.."); txtAPI.Text = string.Empty; GetAPI(); } else { MessageBox.Show("Cant't Save.."); } } }
private void LableFill() { lblGRNDate.Text = String.Empty; lblSupName.Text = String.Empty; Execute objExecute = new Execute(); string Query = "[dbo].[spGetGRNLableinfo]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intGRNHeaderID", Convert.ToInt32(cmbGRNNo.SelectedValue)), }; DataSet ds = (DataSet)objExecute.Executes(Query, ReturnType.DataSet, para, CommandType.StoredProcedure); if (ds.Tables[0].Rows.Count > 0) { lblSupName.Text = ds.Tables[0].Rows[0]["vcSupplierName"].ToString(); DateTime dtGRNdate; dtGRNdate = Convert.ToDateTime(ds.Tables[0].Rows[0]["dtGRNDate"].ToString()); lblGRNDate.Text = dtGRNdate.ToString("MM/dd/yyyy"); } }
private void Report() { rptStockSummary rpt = new rptStockSummary(); ReportDocument rptDoc = new ReportDocument(); rptDoc = rpt; Execute objExecute = new Execute(); string Query = "[dbo].[spGetStockSummeryDetails]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intBrandID", Convert.ToInt32(cmbBrand.SelectedValue)), }; DataTable dt = (DataTable)objExecute.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); rpt.SetDataSource(dt); frmReportViewer objfrmReportViewer = new frmReportViewer(rptDoc); objfrmReportViewer.Show(); }
private void Report() { rptIssueDetails rpt = new rptIssueDetails(); ReportDocument rptDoc = new ReportDocument(); rptDoc = rpt; System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor; Execute objExecuteXX = new Execute(); string Query = "[dbo].[spGetIssueDetailsReport]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@dtFrom", dtFrom.Value.Date), Execute.AddParameter("@dtTo", dtTo.Value.Date) }; DataTable dt = (DataTable)objExecuteXX.Executes(Query, ReturnType.DataTable, para, CommandType.StoredProcedure); if (dt != null && dt.Rows.Count > 0) { rpt.SetDataSource(dt); rpt.SetParameterValue("XXXFromDate", dtFrom.Value.Date); rpt.SetParameterValue("XXXToDate", dtTo.Value.Date); System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; frmReportViewer objfrmReportViewer = new frmReportViewer(rptDoc); objfrmReportViewer.Show(); } else { System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default; MessageBox.Show("No Data For Selected Time Period"); } }
public void updateService() { try { //spUpdateService using (TransactionScope ts = new TransactionScope()) { DialogResult dr = MessageBox.Show("Update The Service ?", "CONFIRM", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intServiceID", ServiceID), Execute.AddParameter("@vcServiceName", txtServiceDec.Text.Trim()), Execute.AddParameter("@decPrice", Convert.ToDecimal(txtPrice.Text.Trim())) }; objExecute.Executes("[spUpdateServiceCharges]", param, CommandType.StoredProcedure); MessageBox.Show("Update Item.."); txtServiceDec.Text = string.Empty; txtPrice.Text = string.Empty; btnSave.Visible = true; btnUpdate.Visible = false; GridLoad(); } ts.Complete(); } } catch (Exception ex) { MessageBox.Show("Data Updating Error"); Logger.LoggError(ex, "btnUpdate_Click"); } }
private void LableFill() { lblContactNo.Text = String.Empty; lblIssueDate.Text = String.Empty; Execute objExecute = new Execute(); string Query = "[dbo].[spGetIssueLableinfo]"; SqlParameter[] para = new SqlParameter[] { Execute.AddParameter("@intIssueHeaderID", Convert.ToInt32(cmbIssueNo.SelectedValue)), }; DataSet ds = (DataSet)objExecute.Executes(Query, ReturnType.DataSet, para, CommandType.StoredProcedure); if (ds.Tables[0].Rows.Count > 0) { int ContactNo = Convert.ToInt32(ds.Tables[0].Rows[0]["intContactNo"].ToString()); lblContactNo.Text = ContactNo.ToString(); DateTime IssueDate; IssueDate = Convert.ToDateTime(ds.Tables[0].Rows[0]["dtIssueDate"].ToString()); lblIssueDate.Text = IssueDate.ToString("MM/dd/yyyy"); } }
public void SaveMainCategory() { DialogResult dr = MessageBox.Show("Are You Sure Want to Add Main Category ?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@MainCategoryName", txtMainCategoryName.Text.Trim().ToUpper()) }; int NoOfRowsEffected = objExecute.Executes("SaveMainCategory", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Save.."); } else { MessageBox.Show("Cant't Save.."); } } }
private void dgvAddServiceChange_CellClick(object sender, DataGridViewCellEventArgs e) { try { //Delete Column if (dgvAddServiceChange.Columns[e.ColumnIndex] == clmbtnDelete) { btnUpdate.Visible = true; btnUpdate.Visible = false; ServiceID = Convert.ToInt32(dgvAddServiceChange.Rows[e.RowIndex].Cells[clmServiceID.Name].Value); DialogResult dr = MessageBox.Show("Are you sure want to Delete in this Service ?", "CONFIRMATION", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@intServiceID", ServiceID), }; int NoOfRowsEffected = objExecute.Executes("spDeleteService", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Successfully DELETE !"); GridLoad(); btnSave.Visible = true; btnUpdate.Visible = false; } else { MessageBox.Show("Item DELETE Process Error !"); } } } //edit column // btnSave.Visible = false; // btnUpdate.Visible = true; if (dgvAddServiceChange.Columns[e.ColumnIndex] == clmbtnEdit) { decimal ServicePrice; ServiceID = Convert.ToInt32(dgvAddServiceChange.Rows[e.RowIndex].Cells[clmServiceID.Name].Value); { Execute objExecute = new Execute(); string Query = "[dbo].[spGetServiceToEdit]"; SqlParameter[] paramt = new SqlParameter[] { Execute.AddParameter("@intServiceID", ServiceID) }; DataSet ds = (DataSet)objExecute.Executes(Query, ReturnType.DataSet, paramt, CommandType.StoredProcedure); if (ds.Tables[0].Rows.Count > 0) { txtServiceDec.Text = ds.Tables[0].Rows[0]["vcServiceName"].ToString(); ServicePrice = Convert.ToDecimal(ds.Tables[0].Rows[0]["decPrice"].ToString()); txtPrice.Text = ServicePrice.ToString(); } btnSave.Visible = false; btnUpdate.Visible = true; } } } catch (Exception ex) { MessageBox.Show("Data Deleting Error"); Logger.LoggError(ex, "dgvAddServiceChange_CellClick"); } }
public void SaveCustomer() { if (IsCheckVehical == true) { if (txtvcVehicle.Text == string.Empty) { MessageBox.Show("Please Enter Vehical No"); return; } else if (txtIntVehicle.Text == string.Empty) { MessageBox.Show("Please Enter Vehical No"); return; } } else if (txtName.Text == string.Empty) { MessageBox.Show("Please Enter Name"); return; } else if (txtAddress.Text == string.Empty) { MessageBox.Show("Please Enter Address"); return; } else if (txtCity.Text == string.Empty) { MessageBox.Show("Please Enter City"); return; } else if (txtContactNo.Text == string.Empty) { MessageBox.Show("Please Enter contact No"); return; } vcVehicleNo = txtvcVehicle.Text.ToUpper(); intVehicleNo = txtIntVehicle.Text.ToString(); if (!Convert.ToBoolean(txtvcVehicle.Text == string.Empty)) { FullVehicleNO = vcVehicleNo + '-' + intVehicleNo; } DialogResult dr = MessageBox.Show("Are You Sure Want to Add Customer ?", "CONFIRM", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); if (dr == DialogResult.Yes) { Execute objExecute = new Execute(); SqlParameter[] param = new SqlParameter[] { Execute.AddParameter("@vcVehicleNo", FullVehicleNO == null?DBNull.Value : (object)FullVehicleNO), Execute.AddParameter("@vcCustomerName", txtName.Text.ToUpper()), Execute.AddParameter("@vcAddress", txtAddress.Text.ToUpper()), Execute.AddParameter("@vcCity", txtCity.Text.ToUpper()), Execute.AddParameter("@intContactNo", Convert.ToInt32(txtContactNo.Text)) }; int NoOfRowsEffected = objExecute.Executes("spSaveCustomer", param, CommandType.StoredProcedure); if (NoOfRowsEffected < 0) { MessageBox.Show("Save.."); this.Close(); } else { MessageBox.Show("Cant't Save.."); } } }