コード例 #1
0
 private void btnAddtype_Click(object sender, EventArgs e)
 {
     try
     {
         frmTypList Obj = new frmTypList();
         Obj.ShowDialog();
         if (Obj.IScontinue)
         {
             ObjEArticle = new EArticles();
             DArticles ObjDArticles = new DArticles();;
             int       ivalue       = 0;
             if (int.TryParse(Convert.ToString(gvRabatt.GetFocusedRowCellValue("RabattID")), out ivalue))
             {
                 ObjEArticle.RabattID = ivalue;
                 ObjEArticle.TypID    = Obj.TypID;
                 ObjEArticle          = ObjDArticles.SaveTypRabattMapping(ObjEArticle);
                 gcTyp.DataSource     = ObjEArticle.dtTypID;
                 gvTyp.Columns["RabattTypMapID"].Visible = false;
                 Utility.Setfocus(gvTyp, "RabattTypMapID", ObjEArticle.RabattTypID);
                 ObjEArticle.RabattTypID = -1;
             }
         }
     }
     catch (Exception ex)
     {
         Utility.ShowError(ex);
     }
 }
コード例 #2
0
 private void gvDimensions_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     try
     {
         if (gvDimensions.GetFocusedRowCellValue("DimensionID") != null)
         {
             if (ObjEArticle == null)
             {
                 ObjEArticle = new EArticles();
             }
             if (ObjDArticle == null)
             {
                 ObjDArticle = new DArticles();
             }
             int     IValue     = 0;
             decimal dMins      = 0;
             decimal dListPrice = 0;
             if (int.TryParse(Convert.ToString(gvDimensions.GetFocusedRowCellValue("DimensionID")), out IValue))
             {
                 ObjEArticle.DimensionID = IValue;
             }
             if (decimal.TryParse(Convert.ToString(gvDimensions.GetFocusedRowCellValue("Minuten")), out dMins))
             {
                 ObjEArticle.Minuten = dMins;
             }
             if (decimal.TryParse(Convert.ToString(gvDimensions.GetFocusedRowCellValue("ListPrice")), out dListPrice))
             {
                 ObjEArticle.ListPrice = dListPrice;
             }
             ObjDArticle.UpdateDimension(ObjEArticle);
             gvWI_FocusedRowChanged(null, null);
         }
     }
     catch (Exception ex) { Utility.ShowError(ex); }
 }
コード例 #3
0
 private void gvDeleteDimension_Click(object sender, EventArgs e)
 {
     try
     {
         if (gvDimensions.GetFocusedRowCellValue("DimensionID") != null)
         {
             int IValue = 0;
             if (int.TryParse(Convert.ToString(gvDimensions.GetFocusedRowCellValue("DimensionID")), out IValue))
             {
                 var dlgResult = XtraMessageBox.Show("Sind Sie sicher, dass Sie die ausgewählten Abmessungen löschen möchten?", "Frage", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                 if (Convert.ToString(dlgResult) == "Yes")
                 {
                     if (ObjEArticle == null)
                     {
                         ObjEArticle = new EArticles();
                     }
                     ObjEArticle.DimensionID = IValue;
                     if (ObjDArticle == null)
                     {
                         ObjDArticle = new DArticles();
                     }
                     ObjDArticle.DeleteDimension(ObjEArticle);
                     gvDimensions.DeleteSelectedRows();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Utility.ShowError(ex);
     }
 }
コード例 #4
0
 /// <summary>
 /// Code to add or edit rabatt from rabatt master
 /// </summary>
 /// <param name="xml"></param>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles SaveRabatt(EArticles ObjEArticle)
 {
     try
     {
         XmlDocument Xdoc  = new XmlDocument();
         string      XPath = "/Nouns/Rabatt";
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "RabattID", ObjEArticle.RabattID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Rabatt", ObjEArticle.Rabatt.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "TypeID", ObjEArticle.TypID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi1", ObjEArticle.Multi1.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi2", ObjEArticle.Multi2.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi3", ObjEArticle.Multi3.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi4", ObjEArticle.Multi4.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "ValidityDate", ObjEArticle.ValidityDate.ToString("yyyy-MM-dd"));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CreatedBy", ObjEArticle.CreatedBy.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "LastUpdatedBy", ObjEArticle.LastUpdatedBy.ToString());
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.SaveRabatt(Xdoc, ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }
コード例 #5
0
 /// <summary>
 /// Code to Add dimensions of article
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles SaveDimension(EArticles ObjEArticle)
 {
     try
     {
         XmlDocument Xdoc  = new XmlDocument();
         string      XPath = "/Nouns/Dimension";
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "DimensionID", ObjEArticle.DimensionID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WIID", ObjEArticle.WIID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "A", ObjEArticle.A);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "B", ObjEArticle.B);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "L", ObjEArticle.L);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "ListPrice", ObjEArticle.ListPrice.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "GMulti", ObjEArticle.GMulti.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Minuten", ObjEArticle.Minuten.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "ValidityDate", ObjEArticle.ValidityDate.ToString("yyyy-MM-dd"));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CreatedBy", ObjEArticle.CreatedBy.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "LastUpdatedBy", ObjEArticle.LastUpdatedBy.ToString());
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.SaveDimension(Xdoc, ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }
コード例 #6
0
 private void frmTypList_Load(object sender, EventArgs e)
 {
     ObjEArticles     = new EArticles();
     ObjDArticles     = new DArticles();
     ObjEArticles     = ObjDArticles.GetTypForRabatt(ObjEArticles);
     gcTyp.DataSource = ObjEArticles.dtTyp;
     gvTyp.Columns["TypID"].Visible = false;
     gvTyp.BestFitColumns();
 }
コード例 #7
0
 /// <summary>
 /// Code to get Articles for accessories mapping
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles GetArticleForAccessories(EArticles ObjEArticle)
 {
     try
     {
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjDArticles.GetArticleForAccessories(ObjEArticle);
     }
     catch (Exception ex) { throw ex; }
     return(ObjEArticle);
 }
コード例 #8
0
 /// <summary>
 /// Code to delete accessory mapping
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles DeleteAccessory(EArticles ObjEArticle)
 {
     try
     {
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjDArticles.DeleteAccessory(ObjEArticle);
     }
     catch (Exception ex) { throw ex; }
     return(ObjEArticle);
 }
コード例 #9
0
 /// <summary>
 /// Code to Save new set of Dimesions with new validity date from Article master
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles SaveDimensionCopy(EArticles ObjEArticle)
 {
     try
     {
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.SaveDimensionCopy(ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }
コード例 #10
0
 /// <summary>
 /// Code to import article data i.e. data migration
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles ImportArticleData(EArticles ObjEArticle)
 {
     try
     {
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.ImportArticleData(ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }
コード例 #11
0
 /// <summary>
 /// Code to save Article mapping with accesories
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles SaveArticleMapping(EArticles ObjEArticle)
 {
     try
     {
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.SaveArticleMapping(ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }
コード例 #12
0
 /// <summary>
 /// Code to getch article data from base i.e. Article data, dimensiions, typ and Rabatt mappings
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles GetArticle(EArticles ObjEArticle)
 {
     try
     {
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.GetArticle(ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }
コード例 #13
0
        /// <summary>
        /// Code to get validity dates of dimensions
        /// </summary>
        /// <param name="_ID"></param>
        /// <param name="_date"></param>
        /// <returns></returns>
        public DataTable GetValidityDatesDimensions(int _ID, DateTime _date)
        {
            DataTable _dt = new DataTable();

            try
            {
                if (ObjDArticles == null)
                {
                    ObjDArticles = new DArticles();
                }
                _dt = ObjDArticles.GetValidityDatesDimensions(_ID, _date);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(_dt);
        }
コード例 #14
0
        /// <summary>
        /// Code to get mapped Typs based on article ID
        /// </summary>
        /// <param name="_ID"></param>
        /// <returns></returns>
        public DataTable GetMultipleTyp(int _ID)
        {
            DataTable dt = new DataTable();

            try
            {
                if (ObjDArticles == null)
                {
                    ObjDArticles = new DArticles();
                }
                dt = ObjDArticles.GetMultipleTyp(_ID);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(dt);
        }
コード例 #15
0
        private void gvWI_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            try
            {
                if (_IsNew)
                {
                    return;
                }

                if (gvWI.FocusedColumn != null && gvWI.GetFocusedRowCellValue("WIID") != null)
                {
                    if (int.TryParse(gvWI.GetFocusedRowCellValue("WIID").ToString(), out _WIIDValue))
                    {
                        ObjEArticle.WIID      = _WIIDValue;
                        txtWI.Text            = gvWI.GetFocusedRowCellValue("WI") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("WI").ToString();
                        txtWIDescription.Text = gvWI.GetFocusedRowCellValue("WIDescription") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("WIDescription").ToString();
                        txtFabrikat.Text      = gvWI.GetFocusedRowCellValue("Fabrikate") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("Fabrikate").ToString();
                        txtMasseinheit.Text   = gvWI.GetFocusedRowCellValue("Masseinheit") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("Masseinheit").ToString();
                        txtDimension.Text     = gvWI.GetFocusedRowCellValue("Dimension") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("Dimension").ToString();
                        cmbME.SelectedIndex   = cmbME.Properties.Items.IndexOf(gvWI.GetFocusedRowCellValue("Menegenheit") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("Menegenheit").ToString());
                        txtremark.Text        = gvWI.GetFocusedRowCellValue("Remarks") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("Remarks").ToString();
                        txtTextKZ.Text        = gvWI.GetFocusedRowCellValue("TextKZ") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("TextKZ").ToString();
                        txtDatanormNr.Text    = gvWI.GetFocusedRowCellValue("DataNormNumber") == DBNull.Value ? "" : gvWI.GetFocusedRowCellValue("DataNormNumber").ToString();
                        lblArticle.Text       = "Artikelübersicht zu : " + txtWG.Text + "/" + txtWA.Text + "/" + txtWI.Text;
                        BindDimensions(_WIIDValue);
                        DArticles Obj = new DArticles();
                        Obj.GetTypByWIID(ObjEArticle);
                        gcTyp.DataSource = ObjEArticle.dtTyp;
                        gvTyp.BestFitColumns();
                        Utility.Setfocus(gvTyp, "RTID", ObjEArticle.RTID);
                    }
                }
                else
                {
                    gcDimensions.DataSource = null;
                    gcTyp.DataSource        = null;
                }
            }
            catch (Exception ex)
            {
                Utility.ShowError(ex);
            }
        }
コード例 #16
0
 /// <summary>
 /// Code to add or edit an article from article master
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles SaveArticle(EArticles ObjEArticle)
 {
     try
     {
         XmlDocument Xdoc  = new XmlDocument();
         string      XPath = "/Nouns/Article";
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WGID", ObjEArticle.WGID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WG", ObjEArticle.WG);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WA", ObjEArticle.WA);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WGDescription", ObjEArticle.WGDescription);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WADescription", ObjEArticle.WADescription);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WIID", ObjEArticle.WIID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WI", ObjEArticle.WI);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WIDescription", ObjEArticle.WIDescription);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Fabrikate", ObjEArticle.Fabrikate);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Typ", ObjEArticle.Typ);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Masseinheit", ObjEArticle.Masseinheit);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Dimension", ObjEArticle.Dimension);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Menegenheit", ObjEArticle.Menegenheit);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Remarks", ObjEArticle.Remarks);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "TextKZ", ObjEArticle.TextKZ);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "ValidityDate", ObjEArticle.ValidityDate.ToString("yyyy-MM-dd"));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi1", ObjEArticle.Multi1.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi2", ObjEArticle.Multi2.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi3", ObjEArticle.Multi3.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi4", ObjEArticle.Multi4.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "DataNormNumber", Convert.ToString(ObjEArticle.DataNormNumber));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CreatedBy", Convert.ToString(ObjEArticle.CreatedBy));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "LastUpdatedBy", Convert.ToString(ObjEArticle.LastUpdatedBy));
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.SaveArticle(Xdoc, ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }
コード例 #17
0
 /// <summary>
 /// Code to add ot edit typ from Typ master
 /// </summary>
 /// <param name="xml"></param>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles SaveTyp(EArticles ObjEArticle)
 {
     try
     {
         XmlDocument Xdoc  = new XmlDocument();
         string      XPath = "/Nouns/Typ";
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "TypID", ObjEArticle.TypID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "SupplierID", ObjEArticle.SupplierID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WIID", ObjEArticle.WIID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Typ", ObjEArticle.Typ);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CreatedBy", ObjEArticle.CreatedBy.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "LastUpdatedBy", ObjEArticle.LastUpdatedBy.ToString());
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.SaveTyp(Xdoc, ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }
コード例 #18
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                decimal   DValue       = 0;
                DArticles ObjDArticles = new DArticles();
                ObjEArticle.Rabatt       = txtRabatt.Text;
                ObjEArticle.ValidityDate = dtpValidityDate.DateTime;
                if (decimal.TryParse(txtMulti1.Text, out DValue))
                {
                    ObjEArticle.Multi1 = DValue;
                }
                else
                {
                    ObjEArticle.Multi1 = 1;
                }

                if (decimal.TryParse(txtMulti2.Text, out DValue))
                {
                    ObjEArticle.Multi2 = DValue;
                }
                else
                {
                    ObjEArticle.Multi2 = 1;
                }

                if (decimal.TryParse(txtMulti3.Text, out DValue))
                {
                    ObjEArticle.Multi3 = DValue;
                }
                else
                {
                    ObjEArticle.Multi3 = 1;
                }

                if (decimal.TryParse(txtMulti4.Text, out DValue))
                {
                    ObjEArticle.Multi4 = DValue;
                }
                else
                {
                    ObjEArticle.Multi4 = 1;
                }

                if (!IsCopy)
                {
                    ObjEArticle.Flag = "E";
                }
                else
                {
                    ObjEArticle.Flag = "A";
                }

                ObjEArticle            = ObjDArticles.UpdateRabatt(ObjEArticle);
                ObjEArticle.IsContinue = true;
                this.Close();
            }
            catch (Exception ex)
            {
                Utility.ShowError(ex);
            }
        }