public override void GetDataFromComponents(CosmeticProduct currentProduct, Control.ControlCollection controls) { base.GetDataFromComponents(currentProduct, controls); Control[] controlList = GetComponentsForInput(controls); Lipstick currentLipstick = (Lipstick)currentProduct; ComboBox temp = (ComboBox)controlList[packageIndex]; currentLipstick.PackageType = (Lipstick.TypeOfPackage)Enum.Parse(typeof(Lipstick.TypeOfPackage), temp.SelectedValue.ToString()); temp = (ComboBox)controlList[finishIndex]; currentLipstick.Finish = (Lipstick.TypeOfFinish)Enum.Parse(typeof(Lipstick.TypeOfFinish), temp.SelectedValue.ToString()); }
public override void LoadDataToComponets(CosmeticProduct currentProduct, Control.ControlCollection controls) { base.LoadDataToComponets(currentProduct, controls); Control[] controlList = GetComponentsForInput(controls); Lipstick currentLipstick = (Lipstick)currentProduct; ComboBox tempComboBox = (ComboBox)controlList[packageIndex]; tempComboBox.SelectedValue = Enum.GetName(typeof(Lipstick.TypeOfPackage), currentLipstick.PackageType); tempComboBox = (ComboBox)controlList[finishIndex]; tempComboBox.SelectedValue = Enum.GetName(typeof(Lipstick.TypeOfFinish), currentLipstick.Finish); }
public Lipstick ConvertLipstickToDTO(BllLipstick bllLipstick) { Lipstick dTOLipstick = new Lipstick() { Id = bllLipstick.Id, Name = bllLipstick.Name, Brand = bllLipstick.Brand, Price = bllLipstick.Price, Color = bllLipstick.Color, Volume = bllLipstick.Volume, QuantityBottles = bllLipstick.QuantityBottles, QuantityGeneralVolume = bllLipstick.QuantityGeneralVolume, Description = bllLipstick.Description, QuntityCount = bllLipstick.QuntityCount }; return(dTOLipstick); }
public BllLipstick ConvertLipstickToBLL(Lipstick dTOLipstick) { BllLipstick bllLipstick = new BllLipstick() { Id = dTOLipstick.Id, Name = dTOLipstick.Name, Brand = dTOLipstick.Brand, Price = dTOLipstick.Price, Color = dTOLipstick.Color, Volume = dTOLipstick.Volume, QuantityBottles = dTOLipstick.QuantityBottles, QuantityGeneralVolume = dTOLipstick.QuantityGeneralVolume, Description = dTOLipstick.Description, QuntityCount = dTOLipstick.QuntityCount }; return(bllLipstick); }
public static List <Model.Lipstick> GetLipstick() //查询商品 { string sql = "select * from Lipstick"; SqlDataReader dr = DBHpelp.ExecuteReader(sql); List <Model.Lipstick> Lipstick = new List <Model.Lipstick>(); Model.Lipstick kso = null; while (dr.Read()) { kso = new Lipstick(); kso.LipID = (int)dr["LipID"]; kso.Lphoto = dr["Lphoto"].ToString(); kso.LTitle = dr["LTitle"].ToString(); kso.LPrice = (decimal)dr["LPrice"]; kso.LColor = dr["LColor"].ToString(); Lipstick.Add(kso); } dr.Close(); return(Lipstick); }
private void Add(object sender, RoutedEventArgs e) { foreach (var item in StockRoom.Items) { if ((item as TabItem).IsSelected) { if ((item as TabItem).Header.ToString() == "Shampoo") { AddMaterial(new Shampoo()); } else if ((item as TabItem).Header.ToString() == "Balsam") { AddMaterial(new Balsam()); } else if ((item as TabItem).Header.ToString() == "Color") { HairColor hairColor = new HairColor { Color = color.Text, Description = description.Text }; AddMaterial(hairColor); } else if ((item as TabItem).Header.ToString() == "Laque") { AddMaterial(new Laque()); } else if ((item as TabItem).Header.ToString() == "Powder") { Powder powder = new Powder { Color = color.Text }; AddMaterial(powder); } else if ((item as TabItem).Header.ToString() == "Foundation") { Foundation foundation = new Foundation { Color = color.Text, Description = description.Text }; AddMaterial(foundation); } else if ((item as TabItem).Header.ToString() == "Shadow") { Shadows shadows = new Shadows { Color = color.Text }; AddMaterial(shadows); } else if ((item as TabItem).Header.ToString() == "Lipstick") { Lipstick lipstick = new Lipstick { Color = color.Text, Description = description.Text }; AddMaterial(lipstick); } else if ((item as TabItem).Header.ToString() == "Mascara") { Mascara mascara = new Mascara { Color = color.Text, }; AddMaterial(mascara); } else if ((item as TabItem).Header.ToString() == "NailBase") { AddMaterial(new NailBase()); } else if ((item as TabItem).Header.ToString() == "NailTop") { AddMaterial(new NailTop()); } else if ((item as TabItem).Header.ToString() == "NailEnamel") { NailPolish nailPolish = new NailPolish { Color = color.Text, }; AddMaterial(nailPolish); } } } load(null, null); }