private void btnSaveAs_Click(object sender, EventArgs e) { try { if (gvDimensions.RowCount == 0) { return; } if (_IsSaveDimension) { throw new Exception("Bitte speichern Sie die Maße"); } frmSaveDimension Obj = new frmSaveDimension("Dimension", ""); Obj.ObjEArticle = ObjEArticle; Obj.ObjBArticle = ObjBArticle; Obj.strArticle = "Info's zur Aktuellen Abmessung : " + txtWG.Text + "/" + txtWA.Text + "/" + txtWI.Text; Obj.ShowDialog(); ObjEArticle = Obj.ObjEArticle; ObjBArticle = Obj.ObjBArticle; BindDimensions(ObjEArticle.WIID); gvWI_FocusedRowChanged(null, null); } catch (Exception ex) { Utility.ShowError(ex); } }
private void frmRabattGroup_Load(object sender, EventArgs e) { try { if (Utility.ArticleDataAccess == "7") { btnAdd.Enabled = false; } if (ObjEArticle == null) { ObjEArticle = new EArticles(); } if (ObjBArticle == null) { ObjBArticle = new BArticles(); } ObjEArticle = ObjBArticle.GetRabatt(ObjEArticle); BindRabattData(); dateEditValidityDate.DateTime = DateTime.Now; dateEditValidityDate.Properties.MinValue = DateTime.Now; txtMulti1.Text = "1"; txtMulti2.Text = "1"; txtMulti3.Text = "1"; txtMulti4.Text = "1"; } catch (Exception ex) { Utility.ShowError(ex); } }
private void frmArticlesData_Load(object sender, EventArgs e) { try { if (Utility.ArticleDataAccess == "7") { btnNew.Enabled = false; btnSave.Enabled = false; btnSaveAs.Enabled = false; btnCancel.Enabled = false; btnAddDimension.Enabled = false; chkIsNew.Enabled = false; } if (ObjEArticle == null) { ObjEArticle = new EArticles(); } if (ObjBArticle == null) { ObjBArticle = new BArticles(); } cmbME.SelectedIndex = cmbME.Properties.Items.IndexOf("h"); ObjBArticle.GetArticle(ObjEArticle); BindWGdata(); } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnAdd_Click(object sender, EventArgs e) { try { int iValue = 0; if (ObjBArticle == null) { ObjBArticle = new BArticles(); } if (ObjEArticle == null) { ObjEArticle = new EArticles(); } ParseRabattDetails(); ObjEArticle = ObjBArticle.SaveRabatt(ObjEArticle); iValue = ObjEArticle.RabattID; BindRabattData(); Utility.Setfocus(gvRabatt, "RabattID", iValue); ObjEArticle.RabattID = -1; if (Utility._IsGermany == true) { frmOTTOPro.UpdateStatus("Vorgang abgeschlossen: Speichern der Rabattgruppe(n)"); } else { frmOTTOPro.UpdateStatus("Rabatt group Saved Successfully"); } } catch (Exception ex) { Utility.ShowError(ex); } }
private void frmArticleAccessories_Load(object sender, EventArgs e) { try { if (ObjBArticles == null) { ObjBArticles = new BArticles(); } if (ObjEArticles == null) { ObjEArticles = new EArticles(); } ObjBArticles.GetArticleForAccessories(ObjEArticles); gcArticles.DataSource = ObjEArticles.dtArt; } catch (Exception ex) { Utility.ShowError(ex); } }
private void frmType_Load(object sender, EventArgs e) { try { if (Utility.ArticleDataAccess == "7") { btnSave.Enabled = false; } if (ObjEArticle == null) { ObjEArticle = new EArticles(); } if (ObjBArticle == null) { ObjBArticle = new BArticles(); } ObjEArticle = ObjBArticle.GetTyp(ObjEArticle); ObjEArticle.dtWG.TableName = "WG"; cmbWGWA.Properties.DataSource = ObjEArticle.dtWG; cmbWGWA.Properties.ValueMember = "WGID"; cmbWGWA.Properties.DisplayMember = "WGWADesc"; cmbWI.Properties.DataSource = ObjEArticle.dtWI; cmbWI.Properties.ValueMember = "WIID"; cmbWI.Properties.DisplayMember = "WI"; cmbWI.CascadingOwner = cmbWGWA; cmbSupplier.Properties.DataSource = ObjEArticle.dtSupplier; cmbSupplier.Properties.ValueMember = "SupplierID"; cmbSupplier.Properties.DisplayMember = "FullName"; ReqFields.Add(txtTyp); ReqFields.Add(cmbWGWA); ReqFields.Add(cmbWI); ReqFields.Add(cmbSupplier); BindTypeData(); } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (ObjBArticle == null) { ObjBArticle = new BArticles(); } ObjEArticle.ValidityDate = dateEditGultigkeit.DateTime; ObjEArticle.dtDim = ((DataView)gvDimensions.DataSource).ToTable(); ObjEArticle = ObjBArticle.SaveDimensionCopy(ObjEArticle); MessageBox.Show("Maße / Artikeldaten mit neuem Gültigkeitsdatum wurden gespeichert : " + string.Format("{0:y}", dateEditGultigkeit.DateTime)); this.Close(); } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnImportArticleData_ItemClick(object sender, ItemClickEventArgs e) { try { DialogResult result = fdImportFile.ShowDialog(); if (result == DialogResult.OK) { BArticles ObjBArticle = new BArticles(); EArticles ObjEArticle = new EArticles(); ObjEArticle = ObjBArticle.ImportExcelXLS(fdImportFile.FileName, ObjEArticle); ObjEArticle = ObjBArticle.ImportArticleData(ObjEArticle); Utility.ShowSucces("Data Imported Sucessfully"); } } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnSave_Click(object sender, EventArgs e) { try { int _WGID = 0; int _WIID = 0; ParsearticleDetails(); if (ObjBArticle == null) { ObjBArticle = new BArticles(); } ObjBArticle.SaveArticle(ObjEArticle); _WGID = ObjEArticle.WGID; _WIID = ObjEArticle.WIID; BindWGdata(); Setfocus(gvWGWA, "WGID", _WGID); BindWIData(ObjEArticle.WGID); Setfocus(gvWI, "WIID", _WIID); if (chkIsNew.Checked == true) { btnNew_Click(null, null); } else { _IsNew = false; gvWGWA_FocusedRowChanged(null, null); } if (Utility._IsGermany == true) { frmOTTOPro.UpdateStatus("Vorgang abgeschlossen: Speichern des Artikels"); } else { frmOTTOPro.UpdateStatus("Article saved successfully"); } } catch (Exception ex) { Utility.ShowError(ex); } }
private void BindDimensionsValidityDate(int WIID, DateTime _Validity) { try { DataTable _dtData = new DataTable(); if (ObjBArticle == null) { ObjBArticle = new BArticles(); } _dtData = ObjBArticle.GetValidityDatesDimensions(WIID, _Validity); if (_dtData != null) { gcDimensions.DataSource = _dtData; gvDimensions.BestFitColumns(); } } catch (Exception ex) { throw; } }
/// <summary> /// Function to fill validity dates available for dimensions. /// </summary> private void FillValidityDates() { try { DataTable _dtyDates = new DataTable(); if (ObjBArticle == null) { ObjBArticle = new BArticles(); } _dtyDates = ObjBArticle.GetValidityDates(_WIID); if (_dtyDates != null) { gcAddTyp.DataSource = _dtyDates; gvAddTyp.BestFitColumns(); } } catch (Exception ex) { throw; } }
/// <summary> /// Function to fill list of typ from article data linked to perticular article /// </summary> private void FillTypeData() { try { DataTable _dtType = new DataTable(); if (ObjBArticle == null) { ObjBArticle = new BArticles(); } _dtType = ObjBArticle.GetMultipleTyp(_WIID); if (_dtType != null) { gcAddTyp.DataSource = _dtType; gvAddTyp.BestFitColumns(); } } catch (Exception ex) { throw; } }
private void btnSave_Click(object sender, EventArgs e) { try { if (!dxValidationProvider1.Validate()) { return; } int iValue = 0; if (ObjBArticle == null) { ObjBArticle = new BArticles(); } if (ObjEArticle == null) { ObjEArticle = new EArticles(); } ObjEArticle.Typ = txtTyp.Text; if (cmbWI.EditValue != null) { ObjEArticle.WIID = Convert.ToInt32(cmbWI.EditValue); } if (cmbSupplier.EditValue != null) { ObjEArticle.SupplierID = Convert.ToInt32(cmbSupplier.EditValue); } ObjEArticle = ObjBArticle.SaveTyp(ObjEArticle); iValue = ObjEArticle.TypID; BindTypeData(); frmOTTOPro.UpdateStatus("Vorgang abgeschlossen: Speichern von TYP"); Utility.Setfocus(gvTyp, "TypID", iValue); txtTyp.Text = string.Empty; ObjEArticle.TypID = -1; txtTyp.Focus(); } catch (Exception ex) { Utility.ShowError(ex); } }
private void btnSave_Click(object sender, EventArgs e) { try { if (!Utility.ValidateRequiredFields(Requirefields)) { return; } if (ObjBArticle == null) { ObjBArticle = new BArticles(); } ParseSDimensionDetails(); ObjBArticle = new BArticles(); ObjBArticle.SaveDimension(_ObjEArticle); _isValidate = true; } catch (Exception ex) { Utility.ShowError(ex); } }
private void gvArticles_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyData == Keys.Enter) { if (gvArticles.FocusedRowHandle > 0 && gvArticles.GetFocusedRowCellValue("WG") != null) { decimal dv = 0; if (decimal.TryParse(Convert.ToString(gvArticles.GetFocusedRowCellValue("WG")), out dv) && dv > 0) { if (ObjBArticle == null) { ObjBArticle = new BArticles(); } _ObjEArticle.ChildWG = Convert.ToString(gvArticles.GetFocusedRowCellValue("WG")); _ObjEArticle.ChildWA = Convert.ToString(gvArticles.GetFocusedRowCellValue("WA")); _ObjEArticle.ChildWI = Convert.ToString(gvArticles.GetFocusedRowCellValue("WI")); ObjBArticle.GetAccessoryDimension(_ObjEArticle); if (_ObjEArticle.dtArt != null && _ObjEArticle.dtArt.Rows.Count > 0) { EPosition ObjEPosition = new EPosition(); if (_ObjEArticle.dtArt.Rows.Count == 1) { string stA = Convert.ToString(_ObjEArticle.dtArt.Rows[0]["A"]); string stB = Convert.ToString(_ObjEArticle.dtArt.Rows[0]["B"]); string stL = Convert.ToString(_ObjEArticle.dtArt.Rows[0]["L"]); if (_ObjEArticle.A == stA && _ObjEArticle.B == stB && _ObjEArticle.L == stL) { gvArticles.SetFocusedRowCellValue("A", stA); gvArticles.SetFocusedRowCellValue("B", stB); gvArticles.SetFocusedRowCellValue("L", stL); } else { ObjEPosition.dtDimensions = _ObjEArticle.dtArt; frmSelectDimension Obj = new frmSelectDimension(); Obj.ObjEPosition = ObjEPosition; Obj.ShowInTaskbar = false; Obj.ShowDialog(); gvArticles.SetFocusedRowCellValue("A", ObjEPosition.Dim1); gvArticles.SetFocusedRowCellValue("B", ObjEPosition.Dim2); gvArticles.SetFocusedRowCellValue("L", ObjEPosition.Dim3); } } else { ObjEPosition.dtDimensions = _ObjEArticle.dtArt; frmSelectDimension Obj = new frmSelectDimension(); Obj.ObjEPosition = ObjEPosition; Obj.ShowInTaskbar = false; Obj.ShowDialog(); gvArticles.SetFocusedRowCellValue("A", ObjEPosition.Dim1); gvArticles.SetFocusedRowCellValue("B", ObjEPosition.Dim2); gvArticles.SetFocusedRowCellValue("L", ObjEPosition.Dim3); } } } } gvArticles.MoveNext(); } } catch (Exception ex) { } }