コード例 #1
0
        public void PopulateCurrentPriceOptions()
        {
            Theme t = bs.GetTheme();

            currentPriceOptionsPanel.Controls.Clear();
            priceConfigs = db.AllConfigs();
            int    curConfigY = 10;
            string text;
            Label  l;
            Panel  p;
            Font   f      = new Font("Segoe UI", 10);
            int    config = 9999999;

            foreach (RunningConfig rc in priceConfigs.Values)
            {
                if (config == 9999999)
                {
                    config = rc.ID;
                }
                // Generate / poulate text item
                l           = new Label();
                text        = rc.Title + " - " + rc.HourRate.ToString("$#0.00");
                l.AutoSize  = false;
                l.TextAlign = ContentAlignment.MiddleRight;
                l.Font      = f;
                l.Text      = text;
                l.Width     = currentPriceOptionsPanel.Width - 24;
                l.Height    = 25;
                l.Location  = new Point(12, curConfigY);
                l.Click    += ((sender, e) => editPriceBTN_Click(rc.ID));
                currentPriceOptionsPanel.Controls.Add(l);
                curConfigY += 34;

                // Generate spacer panel
                p           = new Panel();
                p.Width     = currentPriceOptionsPanel.Width - 2;
                p.Height    = 1;
                p.BackColor = t.MainThemeColor;
                p.Location  = new Point(0, curConfigY);
                currentPriceOptionsPanel.Controls.Add(p);
                curConfigY += 11;
            }

            /*
             * if(priceConfigs.Count > 0)
             * {
             *  editPriceBTN_Click(config);
             * }*/
        }
コード例 #2
0
 private void PopulatePricingConfigurations()
 {
     pricingConfigs = db.AllConfigs();
     priceConfigIDs = new List <int>();
     priceConfigDD.Items.Clear();
     foreach (RunningConfig rc in pricingConfigs.Values)
     {
         priceConfigDD.Items.Add(rc.Title);
         priceConfigIDs.Add(rc.ID);
     }
     if (pricingConfigs.Count > 0)
     {
         priceConfigDD.SelectedIndex = 0;
     }
 }
コード例 #3
0
 // Session Management
 private void PopulatePricingOptions(int type)
 {
     pricingConfigs = db.AllConfigs();
     configIDs      = new List <int>();
     priceOptionsDD.Items.Clear();
     foreach (RunningConfig rc in pricingConfigs.Values)
     {
         if (rc.CountUpStyle == type)
         {
             configIDs.Add(rc.ID);
             priceOptionsDD.Items.Add(rc.Title);
         }
     }
     if (pricingConfigs.Count > 0)
     {
         priceOptionsDD.SelectedIndex = 0;
     }
 }