Beispiel #1
0
        //-------------------------------------------------------------------------------------
        // this message handler gets called when the user checks/unchecks an item the combo box
        //----------------------------------------------------------------------------------------
        private void cmboStyles_CheckStateChanged(object sender, EventArgs e)
        {
            if (sender is CustomerServices.CheckComboBoxItem && formloaded)
            {
                CustomerServices.CheckComboBoxItem item = (CustomerServices.CheckComboBoxItem)sender;
                if (item.CheckState)
                {
                    QueryParms.Styles.Add(repo.LoadStyle(item._Pk));
                    using (var context = new TTI2Entities())
                    {
                        comboColours.Items.Clear();
                        var Colours = context.TLPPS_Replenishment.Where(x => x.TLREP_Style_FK == item._Pk && !x.TLREP_Discontinued).GroupBy(x => x.TLREP_Colour_FK).ToList();
                        foreach (var Col in Colours)
                        {
                            var Clr_Pk = Col.FirstOrDefault().TLREP_Colour_FK;
                            var Clr    = context.TLADM_Colours.Find(Clr_Pk);
                            if (Clr != null)
                            {
                                comboColours.Items.Add(new CustomerServices.CheckComboBoxItem(Clr.Col_Id, Clr.Col_Display, false));
                            }
                        }
                    }
                }
                else
                {
                    var value = QueryParms.Styles.Find(it => it.Sty_Id == item._Pk);
                    if (value != null)
                    {
                        QueryParms.Styles.Remove(value);
                    }

                    if (QueryParms.Styles.Count == 0)
                    {
                        comboColours.Items.Clear();
                        using (var context = new TTI2Entities())
                        {
                            var Colours = context.TLADM_Colours.Where(x => !(bool)x.Col_Discontinued).OrderBy(x => x.Col_Display).ToList();
                            foreach (var Colour in Colours)
                            {
                                comboColours.Items.Add(new CustomerServices.CheckComboBoxItem(Colour.Col_Id, Colour.Col_Display, false));
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
 //-------------------------------------------------------------------------------------
 // this message handler gets called when the user checks/unchecks an item the combo box
 //----------------------------------------------------------------------------------------
 private void cmboStyles_CheckStateChanged(object sender, EventArgs e)
 {
     if (sender is CustomerServices.CheckComboBoxItem && formloaded)
     {
         CustomerServices.CheckComboBoxItem item = (CustomerServices.CheckComboBoxItem)sender;
         if (item.CheckState)
         {
             CustParameters.Styles.Add(repo.LoadStyle(item._Pk));
         }
         else
         {
             var value = CustParameters.Styles.Find(it => it.Sty_Id == item._Pk);
             if (value != null)
             {
                 CustParameters.Styles.Remove(value);
             }
         }
     }
 }
Beispiel #3
0
 //-------------------------------------------------------------------------------------
 // this message handler gets called when the user checks/unchecks an item the combo box
 //----------------------------------------------------------------------------------------
 private void cmboCustomer_CheckStateChanged(object sender, EventArgs e)
 {
     if (sender is CustomerServices.CheckComboBoxItem && FormLoaded)
     {
         CustomerServices.CheckComboBoxItem item = (CustomerServices.CheckComboBoxItem)sender;
         if (item.CheckState)
         {
             QueryParms.Customers.Add(repo.LoadCustomers(item._Pk));
         }
         else
         {
             var value = QueryParms.Customers.Find(it => it.Cust_Pk == item._Pk);
             if (value != null)
             {
                 QueryParms.Customers.Remove(value);
             }
         }
     }
 }
Beispiel #4
0
 //-------------------------------------------------------------------------------------
 // this message handler gets called when the user checks/unchecks an item the combo box
 //----------------------------------------------------------------------------------------
 private void cmboAssigned_CheckStateChanged(object sender, EventArgs e)
 {
     if (sender is CustomerServices.CheckComboBoxItem && FormLoaded)
     {
         CustomerServices.CheckComboBoxItem item = (CustomerServices.CheckComboBoxItem)sender;
         if (item.CheckState)
         {
             QueryParms.PendingPickingSlips.Add(repo.LoadPickingList(item._Pk));
         }
         else
         {
             var value = QueryParms.PendingPickingSlips.Find(it => it.TLSOH_PickListNo == item._Pk);
             if (value != null)
             {
                 QueryParms.PendingPickingSlips.Remove(value);
             }
         }
     }
 }
Beispiel #5
0
 //-------------------------------------------------------------------------------------
 // this message handler gets called when the user checks/unchecks an item the combo box
 //----------------------------------------------------------------------------------------
 private void cmboWareHouses_CheckStateChanged(object sender, EventArgs e)
 {
     if (sender is CustomerServices.CheckComboBoxItem && formloaded)
     {
         CustomerServices.CheckComboBoxItem item = (CustomerServices.CheckComboBoxItem)sender;
         if (item.CheckState)
         {
             QueryParms.Whses.Add(repo.LoadWhse(item._Pk));
         }
         else
         {
             var value = QueryParms.Whses.Find(it => it.WhStore_Id == item._Pk);
             if (value != null)
             {
                 QueryParms.Whses.Remove(value);
             }
         }
     }
 }
 //-------------------------------------------------------------------------------------
 // this message handler gets called when the user checks/unchecks an item the combo box
 //----------------------------------------------------------------------------------------
 private void cmboColours_CheckStateChanged(object sender, EventArgs e)
 {
     if (sender is CustomerServices.CheckComboBoxItem && formloaded)
     {
         CustomerServices.CheckComboBoxItem item = (CustomerServices.CheckComboBoxItem)sender;
         if (item.CheckState)
         {
             parms.Colours.Add(repo.LoadColour(item._Pk));
         }
         else
         {
             var value = parms.Colours.Find(it => it.Col_Id == item._Pk);
             if (value != null)
             {
                 parms.Colours.Remove(value);
             }
         }
     }
 }
Beispiel #7
0
 private void cmboRepackConfig_CheckStateChanged(object sender, EventArgs e)
 {
     if (sender is CustomerServices.CheckComboBoxItem && FormLoaded)
     {
         CustomerServices.CheckComboBoxItem item = (CustomerServices.CheckComboBoxItem)sender;
         if (item.CheckState)
         {
             QueryParms.RePackConfigs.Add(Repo.LoadRePackConfig(item._Pk));
         }
         else
         {
             var value = QueryParms.RePackConfigs.Find(it => it.PORConfig_BoxNumber_Key == item._Pk);
             if (value != null)
             {
                 QueryParms.RePackConfigs.Remove(value);
             }
         }
     }
 }