Пример #1
0
        public ProductInfoForm(Space.InfoType type, ref List<Product> productList, Product product)
        {
            //// EDIT PRODUCT
            InitializeComponent();
            this.Text = "เดชาพาณิชย์ - ข้อมูลสินค้า";
            this.productList = productList;
            this.infoType = type;
            isEditMode = true;
            cbOperative.Items.AddRange(Space.GetOperativeType());
            cbLocation.Items.AddRange(Space.GetStoredLocationType());

            txtProdName.Text = product.Name;
            txtProdUnit.Text = product.Unit;
            txtProdPrice.Text = product.Price.ToString();

            if(product.Operative == Space.OperativeType.Male)
                cbOperative.SelectedIndex = 0;
            else if (product.Operative == Space.OperativeType.Female)
                cbOperative.SelectedIndex = 1;
            else
                throw new Exception("Improper Reached");

            if (product.Location == 1)
                cbLocation.SelectedIndex = 0;
            else if (product.Location == 2)
                cbLocation.SelectedIndex = 1;
            else if (product.Location == 3)
                cbLocation.SelectedIndex = 2;
            else if (product.Location == 3.1)
                cbLocation.SelectedIndex = 3;
            else
                throw new Exception("Improper Reached");

            this.DialogResult = System.Windows.Forms.DialogResult.No;
        }
Пример #2
0
 public ItemIdentity(Product product, double amount)
 {
     this.product = product;
     this.amount = new List<double>();
     this.amount.Add(amount);
 }