public frmEditProductPriceList(PriceListModel _pricelist)
 {
     InitializeComponent();
     if (_pricelist.Type == "MODIFIRE")
     {
         btnSave.Tag = _pricelist;
         txtProductName.Text = _pricelist.NameDesc;
         txtProductPrice.Text = (_pricelist.CurrentPrice/1000).ToString();
         txtProductSize.Text = _pricelist.Portions;
         txtProductSize.Enabled = false;
         cbColor.Text = _pricelist.Color;
         label1.Text = "Modifire Name";
         label2.Text = "Modifire Size";
         label3.Text = "Modifire Price";
         label5.Text = "Modifire Color";
     }
     else
     {
         btnSave.Tag = _pricelist;
         txtProductName.Text = _pricelist.NameDesc;
         txtProductPrice.Text = (_pricelist.CurrentPrice/1000).ToString();
         txtProductSize.Text = _pricelist.Portions;
         cbColor.Text = _pricelist.Color;
         txtProductSize.Enabled = false;
     }
 }
Example #2
0
 public void addPriceList(int i, int CurrentPage)
 {
     txtSearch.Visible = false;
     btnAdd.Enabled = false;
     btBack.Tag = i;
     btNext.Tag = i;
     if (this.TotalPage == 0)
     {
         this.TotalPage = PriceListSerice.GetTotalProductAndModifire();
     }
     var data = PriceListSerice.GetDataProductAndModifire(CurrentPage);
     if (i == 5)
     {
         this.ResizeTopriceList();
         flpMenuList.Controls.Clear();
         // txtNameMenuList.Visible = false;
         ucPriceListTitle.Visible = true;
         ucPriceListTitle.BackColor = Color.FromArgb(0, 102, 204);
         ucPriceListTitle.ForeColor = Color.FromArgb(255, 255, 255);
         ucPriceListTitle.Dock = DockStyle.Fill;
         foreach (var strPriceList in data)
         {
             UCPriceList ucPriceList = new UCPriceList();
             ucPriceList.lblPriceNameProduct.Text = strPriceList.NameDesc;
             ucPriceList.lblPriceSizeProduct.Text = strPriceList.Portions;
             ucPriceList.lblPriceProduct.Text =money.Format2 (strPriceList.CurrentPrice.ToString());
             ucPriceListTitle.Size = new System.Drawing.Size(NewWidthPn2, ucPriceList.Height);
             //ucPriceList.Dock = DockStyle.Fill;
             ucPriceList.Tag = strPriceList;
             ucPriceList.Width = flpMenuList.Width;
             ucPriceList.Click += ucPriceList_Click;
             flpMenuList.Controls.Add(ucPriceList);
         }
         PriceListModel pricelistmodel = new PriceListModel();
         addButtonPriceList(pricelistmodel);
     }
 }
Example #3
0
 private void addButtonPriceList(PriceListModel tag)
 {
     int i = 1;
     FlowLayoutPanel flpButtonPriceList = new FlowLayoutPanel();
     flpButtonPriceList.Dock = DockStyle.Fill;
     flpButtonPriceList.BackColor = Color.FromArgb(215, 214, 216);
     if (pnDetail.Controls.Count > 0)
     {
         flpButtonPriceList = (FlowLayoutPanel)pnDetail.Controls[0];
     }
     else
     {
         pnDetail.Controls.Add(flpButtonPriceList);
     }
     Button btnGoToProduct = new Button();
     if (flpButtonPriceList.Controls.Count > 0)
     {
         btnGoToProduct = (Button)flpButtonPriceList.Controls[0];
     }
     else
     {
         flpButtonPriceList.Controls.Add(btnGoToProduct);
     }
     btnGoToProduct.Width = 115;
     btnGoToProduct.Height = 67;
     btnGoToProduct.FlatStyle = FlatStyle.Flat;
     btnGoToProduct.FlatAppearance.BorderSize = 0;
     btnGoToProduct.Dock = DockStyle.Top;
     btnGoToProduct.Text = "Edit";
     btnGoToProduct.Tag = tag;
     btnGoToProduct.BackColor = Color.FromArgb(51, 51, 51);
     btnGoToProduct.ForeColor = Color.FromArgb(255, 255, 255);
     btnGoToProduct.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     btnGoToProduct.Click += btnGoToProduct_Click;
     i++;
 }