public List <Product_Style_Model> getStyleList()
        {
            List <Product_Style_Model> result = new List <Product_Style_Model>();

            try
            {
                DataTable dt = DBHandler.selectDataBase(ref conn, "`order_product_style`", "*", string.Empty);
                if (dt != null)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        Product_Style_Model item = new Product_Style_Model()
                        {
                            Id           = (long)dt.Rows[i]["style_id"],
                            Name         = (string)dt.Rows[i]["style_name"],
                            Cost         = (string)dt.Rows[i]["style_cost"],
                            ishavebehide = (bool)dt.Rows[i]["ishavebehide"]
                        };
                        result.Add(item);
                    }
                }
            }
            catch (Exception ex)
            {
                LogFile.writeLog(LogFile.DIR, "Exception" + LogFile.getTimeStringNow() + ".txt", LogFile.Filemode.GHIDE, ex.Message);
            }

            return(result);
        }
Exemple #2
0
        public void SetStyle(Product_Style_Model Style)
        {
            this.Style   = Style;
            lb_Name.Text = "Style: " + Style.Name;

            FrontImage  = getBitmapById(Style.Id, false);
            BehideImage = getBitmapById(Style.Id, true);

            Stylepic.Image = FrontImage;
        }
Exemple #3
0
        public void AddStyle(Product_Style_Model Style, List <Product_Color_Model> lstColor)
        {
            ImageStyle item = new ImageStyle(this.Size);

            item.setLstColor(lstColor.Where(c => c.colorofstyle == Style.Id).ToList());
            item.SetStyle(Style);
            this.Controls.Add(item);
            CalculateSize();
            this.lstColor = lstColor;
        }
Exemple #4
0
 public void RemoveStyle(Product_Style_Model Style)
 {
     foreach (Control item in this.Controls)
     {
         if (item is ImageStyle)
         {
             ImageStyle rmItem = (ImageStyle)item;
             if (rmItem.Style.Id == Style.Id)
             {
                 this.Controls.Remove(rmItem);
                 rmItem.Dispose();
                 break;
             }
         }
     }
     CalculateSize();
 }