Ejemplo n.º 1
0
        public ActionResult Register(String productName, int inventory, Decimal price, int categoryId)
        {
            data.product product = new data.product();
            product.productName = productName;
            product.inventory   = inventory;
            product.price       = price;
            product.categoryId  = categoryId;

            _products.Insert(product);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public products products_insert()
 {
     products.Resource_ID         = Convert.ToInt32(Insert_Resource_ID_txt.Text);
     products.product_name        = Insert_product_name_txt.Text;
     products.product_type        = Insert_product_type_txt.Text;
     products.product_qty         = Convert.ToInt32(Insert_product_qty_txt.Text);
     products.product_desc        = Insert_product_desc_txt.Text;
     products.product_color       = Insert_product_color_txt.Text;
     products.product_size        = Insert_product_size_txt.Text;
     products.product_cost        = Convert.ToDecimal(Insert_product_cost_txt.Text);
     products.Product_exp_date    = Convert.ToDateTime(Insert_Product_exp_date_txt.Text);
     products.Product_Alergy_info = Insert_Product_Alergy_info_txt.Text;
     products.Product_refrigde    = Insert_Product_refrigde_txt.Text;
     products.Product_Flammable   = Insert_Product_Flammable_txt.Text;
     products.Product_Hazard      = Insert_Product_Hazard_txt.Text;
     products.Product_Other       = Insert_Product_Other_txt.Text;
     products.Product_Min_Inv     = Convert.ToInt32(Insert_Product_Min_Inv_txt.Text);
     products.Product_Barcode     = Insert_Product_Barcode_txt.Text;
     products.Product_subtype     = Insert_Product_subtype_txt.Text;
     products.Make             = Insert_Make_txt.Text;
     products.Model            = Insert_Model_txt.Text;
     products.FEMA_Description = Insert_FEMA_Description_txt.Text;
     products.Year             = Insert_Year_txt.Text;
     products.RFID             = Insert_RFID_txt.Text;
     products.Serial_Number    = Insert_Serial_Number_txt.Text;
     products.Height           = Insert_Height_txt.Text;
     products.Length           = Insert_Length_txt.Text;
     products.Depth            = Insert_Depth_txt.Text;
     products.Weight           = Insert_Weight_txt.Text;
     products.OAI               = Insert_OAI_txt.Text;
     products.OAI_Type          = Insert_OAI_Type_txt.Text;
     products.Use               = Insert_Use_txt.Text;
     products.Brand             = Insert_Brand_txt.Text;
     products.Power_Supply      = Insert_Power_Supply_txt.Text;
     products.Gas_Type          = Insert_Gas_Type_txt.Text;
     products.Needs_Gas         = Convert.ToBoolean(Insert_Needs_Gas_txt.Text);
     products.Needs_Electricity = Convert.ToBoolean(Insert_Needs_Electricity_txt.Text);
     products.Availability      = Insert_Availability_txt.Text;
     products.Datetime          = Convert.ToDateTime(Insert_Datetime_txt.Text);
     products.OpenStatus        = Insert_OpenStatus_txt.Text;
     products = products.Insert(products);
     Insert_products_GridView.DataBind();
     Update_products_GridView.DataBind();
     Delete_products_GridView.DataBind();
     return(products);
 }