コード例 #1
0
 private void lbxScenarios_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         clsGlobals.GIPar.ProductColorID = Convert.ToInt32(dgvResult.CurrentRow.Cells[0].Value);
         clsGlobals.ParentProductID      = clsGlobals.GIPar.ProductColorID;
         if (clsProductEqui.ExistsEquivalence(clsGlobals.GIPar.ProductColorID))
         {
             clsProductEqui myPequ = new clsProductEqui();
             myPequ.GetProductEquiByPColorID(clsGlobals.GIPar.ProductColorID);
             clsGlobals.ProductEquiID = myPequ.ProductEquiID;
             MessageBox.Show("Exite equivalencia avec " + myPequ.CodeEqui + " en " + myPequ.NameSeason);
         }
         if (frOP == null)
         {
             frOP             = new frmOrderProducts();
             frOP.MdiParent   = this.MdiParent;
             frOP.FormClosed += new FormClosedEventHandler(frOPFromClosed);
             frOP.Show();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         if (cboSeason.SelectedIndex < 0)
         {
             MessageBox.Show("Sélectionnez une saison...");
         }
         else
         {
             if (string.IsNullOrEmpty(txtNewProduct.Text))
             {
                 MessageBox.Show("Sélectionnez le nouveau produit...");
             }
             else
             {
                 if (string.IsNullOrEmpty(txtEquivalentProduct.Text))
                 {
                     MessageBox.Show("Sélectionnez le produit équivalent...");
                 }
                 else
                 {
                     if (MessageBox.Show("Etes-vous sûr de créer cette relation?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                     {
                         clsProductEqui Pequ = new clsProductEqui(NewID, EquID, Convert.ToInt32(cboSeason.SelectedValue));
                         Pequ.InsertProductEqui();
                         Ele.GetProducts();
                         LinkListCollections();
                         cboSeason.SelectedIndex = -1;
                         txtNewProduct.Clear();
                         txtEquivalentProduct.Clear();
                         txtSearchProduct.Clear();
                         radNew.Checked = true;
                         LinkListEquivalentProducts();
                     }
                     else
                     {
                         Ele.GetProducts();
                         LinkListCollections();
                         cboSeason.SelectedIndex = -1;
                         txtNewProduct.Clear();
                         txtEquivalentProduct.Clear();
                         txtSearchProduct.Clear();
                         radNew.Checked = true;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #3
0
        private void UpdateItems(clsProductEqui myPeq, int numberSeasons)
        {
            clsListScSalesHistory myProductBase = new clsListScSalesHistory();

            myProductBase.GetSalesHistoryByID(clsGlobals.GIPar.ScenarioID, clsProduct.GetProductColorIDFromGIProductID(myPeq.ProductBaseID));
            foreach (clsScSalesHistory ele in myProductBase.Elements)
            {
                if (numberSeasons == 2)
                {
                    ele.UpdateTwoItems(myPeq.ProductEquiID);
                }
                else
                {
                    ele.UpdateOneItems(myPeq.ProductEquiID);
                }
            }
        }
コード例 #4
0
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         if (dgvResult.Rows.Count > 0)
         {
             if (MessageBox.Show("Êtes-vous sûr de supprimer cette équivalence?", "Question", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
             {
                 int            vEleID = Convert.ToInt32(dgvResult.CurrentRow.Cells[0].Value.ToString());
                 clsProductEqui myPeq  = lstPeq.GetEquiProductByID(vEleID);
                 myPeq.DeleteProductEqui();
                 LinkListEquivalentProducts();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }