private void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtDealerName.Text) || string.IsNullOrWhiteSpace(txtAddress.Text) || string.IsNullOrWhiteSpace(txtMobileNo.Text) || string.IsNullOrWhiteSpace(cmbRegion.Text)) { ClsCommon.ShowErrorToolTip(txtDealerName, "Please Enter The Dealer Name"); } else { var model = new DealerModel { DealerId = _dealerId, DealerName = txtDealerName.Text, DealerAddress = txtAddress.Text, PhoneNo = txtPhoneNo.Text, MobileNo = txtMobileNo.Text, Email = txtEmailId.Text, RegionId = (int)cmbRegion.SelectedValue, DelearIncharge = txtIncharge.Text }; if (_isNewMode) { _dealerId = _dealerService.Save(model).DealerId; if (_dealerId <= 0) { return; } MessageBox.Show(@"Data Saved Successfully", @"Save", MessageBoxButtons.OK, MessageBoxIcon.Information); var frm = (FrmDealer)_frmForm; frm.grdData.Rows.Add(_dealerId, model.DealerName, model.DealerAddress, model.PhoneNo, model.MobileNo, model.Email, model.RegionId, cmbRegion.Text, model.DelearIncharge); frm.grdData.Rows[frm.grdData.Rows.Count - 1].IsSelected = true; txtDealerName.Focus(); txtDealerName.Text = ""; txtIncharge.Text = ""; Notify(); } else { var success = _dealerService.Update(model); if (!success) { return; } MessageBox.Show(@"Data Updated Successfully", @"Update", MessageBoxButtons.OK, MessageBoxIcon.Information); var frm = (FrmDealer)_frmForm; frm.grdData.CurrentRow.Cells["DealerName"].Value = model.DealerName; frm.grdData.CurrentRow.Cells["DealerAddress"].Value = model.DealerAddress; frm.grdData.CurrentRow.Cells["PhoneNo"].Value = model.PhoneNo; frm.grdData.CurrentRow.Cells["MobileNo"].Value = model.MobileNo; frm.grdData.CurrentRow.Cells["Email"].Value = model.Email; frm.grdData.CurrentRow.Cells["RegionId"].Value = model.RegionId; frm.grdData.CurrentRow.Cells["RegionName"].Value = cmbRegion.Text; frm.grdData.CurrentRow.Cells["DelearIncharge"].Value = model.DelearIncharge; Close(); Notify(); } } }
public bool validation() { if (string.IsNullOrWhiteSpace(txtQuantity.Text)) { ClsCommon.ShowErrorToolTip(txtQuantity, "Enter the Quantity"); return(false); } return(true); }
private void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtName.Text) || string.IsNullOrWhiteSpace(txtType.Text) || string.IsNullOrWhiteSpace(cmbUnit.Text)) { ClsCommon.ShowErrorToolTip(txtName, "Please Enter The ProductionMaterial Name"); } else { var model = new ProductionMaterialModel { ProductionMaterialId = _productionMaterialId, MaterialName = txtName.Text, MaterialType = txtType.Text, Description = txtDesc.Text, UnitOfMeasurementId = (int)cmbUnit.SelectedValue }; if (_isNewMode) { _productionMaterialId = _productionMaterialService.Save(model).ProductionMaterialId; if (_productionMaterialId <= 0) { return; } MessageBox.Show(@"Data Saved Successfully", @"Save", MessageBoxButtons.OK, MessageBoxIcon.Information); var frm = (FrmProductionMaterial)_frmForm; frm.grdData.Rows.Add(_productionMaterialId, model.MaterialName, model.UnitOfMeasurementId, cmbUnit.Text, model.MaterialType, model.Description); frm.grdData.Rows[frm.grdData.Rows.Count - 1].IsSelected = true; txtName.Focus(); txtName.Text = ""; Notify(); } else { var success = _productionMaterialService.Update(model).ProductionMaterialId; if (success <= 0) { return; } MessageBox.Show(@"Data Updated Successfully", @"Update", MessageBoxButtons.OK, MessageBoxIcon.Information); var frm = (FrmProductionMaterial)_frmForm; frm.grdData.CurrentRow.Cells["MaterialName"].Value = model.MaterialName; frm.grdData.CurrentRow.Cells["MaterialType"].Value = model.MaterialType; frm.grdData.CurrentRow.Cells["UnitOfMeasurementId"].Value = model.UnitOfMeasurementId; frm.grdData.CurrentRow.Cells["UnitName"].Value = cmbUnit.Text; frm.grdData.CurrentRow.Cells["Description"].Value = model.Description; Close(); Notify(); } } }
private void btnadd_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtQuantity.Text)) { ClsCommon.ShowErrorToolTip(txtQuantity, "Enter the Quantity?"); } else { grdJobOrder.Rows.Add(1, cmbPrNId.SelectedValue, cmbMaterialname.Text, txtQuantity.Text); SerialNumber(); } }
private void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtWareHouseName.Text) || string.IsNullOrWhiteSpace(cmbType.Text)) { ClsCommon.ShowErrorToolTip(txtWareHouseName, "Please Enter The WareHouse Name"); } else { var model = new WareHouseModel { WareHouseId = _wareHouseId, WareHouseName = txtWareHouseName.Text, WareHouseType = cmbType.Text, Description = txtRemarks.Text }; if (_isNewMode) { _wareHouseId = _wareHouseService.Save(model); if (_wareHouseId <= 0) { return; } MessageBox.Show(@"Data Saved Successfully", @"Save", MessageBoxButtons.OK, MessageBoxIcon.Information); var frm = (FrmWareHouse)_frmForm; frm.grdData.Rows.Add(_wareHouseId, model.WareHouseName, model.WareHouseType, model.Description); frm.grdData.Rows[frm.grdData.Rows.Count - 1].IsSelected = true; txtWareHouseName.Focus(); txtWareHouseName.Text = ""; txtRemarks.Text = ""; Notify(); } else { var success = _wareHouseService.Update(model); if (!success) { return; } MessageBox.Show(@"Data Updated Successfully", @"Update", MessageBoxButtons.OK, MessageBoxIcon.Information); var frm = (FrmWareHouse)_frmForm; frm.grdData.CurrentRow.Cells["WareHouseName"].Value = model.WareHouseName; frm.grdData.CurrentRow.Cells["WareHouseType"].Value = model.WareHouseType; frm.grdData.CurrentRow.Cells["Description"].Value = model.Description; Close(); Notify(); } } }
public bool validation() { if (string.IsNullOrWhiteSpace(txtPreparedBy.Text)) { ClsCommon.ShowErrorToolTip(txtPreparedBy, "Who Prepared This???"); return(false); } if (string.IsNullOrWhiteSpace(txtDescription.Text)) { ClsCommon.ShowErrorToolTip(txtDescription, "Description Needed???"); return(false); } return(true); }
public bool validation() { if (string.IsNullOrEmpty(txtQuantity.Text)) { ClsCommon.ShowErrorToolTip(txtQuantity, "Enter Quantity"); return(false); } if (string.IsNullOrEmpty(Txtrate.Text)) { ClsCommon.ShowErrorToolTip(Txtrate, "Enter Rate"); return(false); } return(true); }
private void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtUnitName.Text) || string.IsNullOrWhiteSpace(txtRemarks.Text)) { ClsCommon.ShowErrorToolTip(txtUnitName, "Please Enter The Unit Name"); } else { var model = new UnitOfMeasurementModel { UnitOfMeasurementId = _unitId, UnitName = txtUnitName.Text, Description = txtRemarks.Text }; if (_isNewMode) { _unitId = _unitService.Save(model).UnitOfMeasurementId; if (_unitId <= 0) { return; } MessageBox.Show(@"Data Saved Successfully", @"Save", MessageBoxButtons.OK, MessageBoxIcon.Information); var frm = (FrmUnit)_frmForm; frm.grdData.Rows.Add(_unitId, model.UnitName, model.Description); frm.grdData.Rows[frm.grdData.Rows.Count - 1].IsSelected = true; txtUnitName.Focus(); txtUnitName.Text = ""; txtRemarks.Text = ""; Notify(); } else { var success = _unitService.Update(model); if (success == null) { return; } MessageBox.Show(@"Data Updated Successfully", @"Update", MessageBoxButtons.OK, MessageBoxIcon.Information); var frm = (FrmUnit)_frmForm; frm.grdData.CurrentRow.Cells["UnitName"].Value = model.UnitName; frm.grdData.CurrentRow.Cells["Description"].Value = model.Description; Close(); Notify(); } } }
private void btnAdd_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(txtQuantity.Text)) { ClsCommon.ShowErrorToolTip(txtQuantity, "Please Enter the Required Quantity"); } else { if (string.IsNullOrWhiteSpace(txtRate.Text)) { ClsCommon.ShowErrorToolTip(txtRate, "Please Enter the Required Rate"); } else { grdDisplay.Rows.Add(0, cmbProduct.SelectedValue, cmbProduct.Text, txtRate.Text, txtQuantity.Text, txtTotal.Text); SerialNumber(); txtQuantity.Text = ""; txtRate.Text = ""; txtTotal.Text = ""; } } }
public bool validation() { if (string.IsNullOrWhiteSpace(txtGateEntryNo.Text)) { ClsCommon.ShowErrorToolTip(txtGateEntryNo, "Enter The Gate Number"); return(false); } if (string.IsNullOrWhiteSpace(txtVechilenumber.Text)) { ClsCommon.ShowErrorToolTip(txtVechilenumber, "Enter the Vechile Number!!!"); return(false); } if (string.IsNullOrWhiteSpace(txtQuantity.Text)) { ClsCommon.ShowErrorToolTip(txtQuantity, "Enter the Quantity"); return(false); } if (string.IsNullOrWhiteSpace(txtRate.Text)) { ClsCommon.ShowErrorToolTip(txtRate, "Assign Rate!!!"); return(false); } return(true); }
private void btnExportToExcel_Click(object sender, EventArgs e) { ClsCommon.ExportToExcel(grdData); }
private void btnPrint_Click(object sender, EventArgs e) { ClsCommon.PrintPreview(grdData); }