/// <summary> /// DeleteFunction checking conformation /// </summary> public void DeleteFunction() { try { BomSP spBom = new BomSP(); Messages.DeletedMessage(); if (frmProductCreationObj != null) { bool isDeleted = true; frmProductCreationObj.ReciveDeleteConfirmation(isDeleted); } Clear(); this.Close(); } catch (Exception ex) { formMDI.infoError.ErrorString = "PB:15" + ex.Message; } }
/// <summary> /// DeleteFunction checking conformation /// </summary> public void DeleteFunction() { try { BomSP spBom = new BomSP(); Messages.DeletedMessage(); if (frmProductCreationObj != null) { bool isDeleted = true; frmProductCreationObj.ReciveDeleteConfirmation(isDeleted); } Clear(); this.Close(); } catch (Exception ex) { MessageBox.Show("PB:15" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to Edit tbl_Bom /// </summary> public void BomTableForUpdate() { try { BomSP spBom = new BomSP(); DataTable dtblBom = new DataTable(); dtblBom = spBom.ProduBomForEdit(decProductIdForEdit); dtblBomForEdit = dtblBom; } catch (Exception ex) { MessageBox.Show("PC:20" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to check data in Multiple Unit table /// </summary> public void BomDeleteFunction() { try { BomSP spBom = new BomSP(); spBom.BomDeleteForUpdation(decProductIdForEdit); } catch (Exception ex) { MessageBox.Show("PC:12" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to Edit tbl_Bom /// </summary> public void BomTableEditFill() { try { BomInfo infoBom = new BomInfo(); BomSP spBom = new BomSP(); for (int i = 0; i < dtblFromBomForUpdate.Rows.Count; i++) { infoBom.RowmaterialId = Convert.ToDecimal(dtblFromBomForUpdate.Rows[i]["dgvcmbRawMaterial"]); infoBom.UnitId = Convert.ToDecimal(dtblFromBomForUpdate.Rows[i]["dgvtxtUnitId"]); infoBom.Quantity = Convert.ToDecimal(dtblFromBomForUpdate.Rows[i]["dgvtxtQty"]); infoBom.Extra1 = dtblFromBomForUpdate.Rows[i]["extra1"].ToString(); infoBom.Extra2 = dtblFromBomForUpdate.Rows[i]["extra2"].ToString(); infoBom.ExtraDate = Convert.ToDateTime(dtblFromBomForUpdate.Rows[i]["extraDate"]); infoBom.BomId = Convert.ToDecimal(dtblFromBomForUpdate.Rows[i]["bomId"]); infoBom.ProductId = decProductIdForEdit; spBom.UpdateBom(infoBom); } } catch (Exception ex) { MessageBox.Show("PC:10" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function for new row added for Bom /// </summary> public void NewRowAddedForBom() { try { BomInfo infoBom = new BomInfo(); BomSP spBom = new BomSP(); for (int inI = 0; inI < dtblFromBomForUpdate.Rows.Count; inI++) { if (Convert.ToDecimal(dtblFromBomForUpdate.Rows[inI]["bomId"]) == 0) { infoBom.RowmaterialId = Convert.ToDecimal(dtblFromBomForUpdate.Rows[inI]["dgvcmbRawMaterial"]); infoBom.UnitId = Convert.ToDecimal(dtblFromBomForUpdate.Rows[inI]["dgvtxtUnitId"]); infoBom.Quantity = Convert.ToDecimal(dtblFromBomForUpdate.Rows[inI]["dgvtxtQty"]); infoBom.Extra1 = dtblFromBomForUpdate.Rows[inI]["extra1"].ToString(); infoBom.Extra2 = dtblFromBomForUpdate.Rows[inI]["extra2"].ToString(); infoBom.ExtraDate = Convert.ToDateTime(dtblFromBomForUpdate.Rows[inI]["extraDate"]); spBom.BomFromDatatable(infoBom, decProductIdForEdit); } } } catch (Exception ex) { MessageBox.Show("PC:78" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function for delete data from tbl_BOM /// </summary> public void RemoveBom() { try { BomInfo infoBom = new BomInfo(); BomSP spBom = new BomSP(); int inC = 0; while (strArrOfRemoveForBom[inC] != null) { decimal decId = Convert.ToDecimal(strArrOfRemoveForBom[inC]); spBom.BomRemoveRows(decId); inC++; } } catch (Exception ex) { MessageBox.Show("PC:65" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//-------------------------------------------------------------TaxBomComboFill-------------------------- public void BomComboFill() { try { DataTable dtbl = new DataTable(); BomSP spBom = new BomSP(); dtbl = spBom.BomViewAll(); cmbBom.DataSource = dtbl; cmbBom.DisplayMember = "taxName"; cmbBom.ValueMember = "taxId"; } catch (Exception ex) { MessageBox.Show("PC:48" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to add data to tbl_Bom /// </summary> public void BomTableFill() { try { BomInfo infoBom = new BomInfo(); BomSP spBom = new BomSP(); decimal decProductId; if (btnSave.Text == "Update") { decProductId = decProductIdForEdit; } else { decProductId = decSaveProduct; } for (int i = 0; i < dtblBom.Rows.Count; i++) { infoBom.RowmaterialId = Convert.ToDecimal(dtblBom.Rows[i]["dgvcmbRawMaterial"]); infoBom.UnitId = Convert.ToDecimal(dtblBom.Rows[i]["dgvtxtUnitId"]); infoBom.Quantity = Convert.ToDecimal(dtblBom.Rows[i]["dgvtxtQty"]); infoBom.Extra1 = dtblBom.Rows[i]["extra1"].ToString(); infoBom.Extra2 = dtblBom.Rows[i]["extra2"].ToString(); infoBom.ExtraDate = Convert.ToDateTime(dtblBom.Rows[i]["extraDate"]); spBom.BomFromDatatable(infoBom, decProductId); } } catch (Exception ex) { MessageBox.Show("PC:2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }