protected void Button1_Click1(object sender, EventArgs e) { Cell_Priceinfoinfo cinfo = new Cell_Priceinfoinfo(); cinfo.Cell_Price1 = decimal.Parse(txtCell_Price1.Text); cinfo.Cell_Price2 = decimal.Parse(txtCell_Price2.Text); cinfo.Product_id = txtProduct_ID.Text; cinfo.Insert_Date = Convert.ToDateTime(txtInsertDate.Text); cinfo.Update_Date = Convert.ToDateTime(txtUpdateDate.Text); cinfo.UMID = txtUn_M_ID.Text; Cell_PriceController cController = new Cell_PriceController(); cController.InsertCell_Price(cinfo); gridviewcall(); }
protected void btnSave_Click(object sender, EventArgs e) { Productinfo prinfo = new Productinfo(); ProductController pcon = new ProductController(); prinfo.ProductName = txtProductName.Text.Trim(); prinfo.Product_description = txtDesc.Text.Trim(); prinfo.Color = txtColor.Text.Trim(); prinfo.Size = txtSize.Text.Trim(); prinfo.Manufacture_Country = txtMade.Text.Trim(); prinfo.UnitPrice = Convert.ToDecimal(txtSellPrice.Text.Trim()); prinfo.Manufacture_date = Convert.ToDateTime(txtManuDate.Text.Trim()); prinfo.Expired_date = Convert.ToDateTime(txtExpDate.Text.Trim()); prinfo.Product_Expired_date = Convert.ToDateTime(txtExpDate.Text.Trim()); prinfo.BrandID = ddlBrand.SelectedItem.Value; prinfo.CategoryID = ddlCateogry.SelectedItem.Value; prinfo.SupplierID = ddlSupplier.SelectedItem.Value; prinfo.UMID = ddlUM.SelectedItem.Value; //pcon.InsertProduct(prinfo); string productID = pcon.InsertProduct(prinfo); Inventoryinfo invinfo = new Inventoryinfo(); Invertorycontroller invCon = new Invertorycontroller(); invinfo.ProductID = productID; invinfo.UnitInStock = Convert.ToInt32(txtUnitStock.Text.Trim()); string invId = invCon.InsertInventory(invinfo); ReorderInfo rinfo = new ReorderInfo(); ReorderController rcon = new ReorderController(); rinfo.ProductID = productID; rinfo.InventoryID = invId; rinfo.ReorderUnit = txtReorder.Text.Trim(); rcon.InsertReorder(rinfo); Cell_Priceinfoinfo cinfo = new Cell_Priceinfoinfo(); Cell_PriceController ccon = new Cell_PriceController(); cinfo.Cell_Price1 = Convert.ToDecimal(txtBuyPrice.Text.Trim()); cinfo.Cell_Price2 = Convert.ToDecimal(txtSellPrice.Text.Trim()); cinfo.Product_id = productID; cinfo.UMID = ddlUM.SelectedItem.Value; ccon.InsertCell_Price(cinfo); if (fuMain.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuMain.FileBytes; piminfo.MainPic = true; pimcon.InsertProductImage(piminfo); } if (fuLeft.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuLeft.FileBytes; pimcon.InsertProductImage(piminfo); } if (FuBehind.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = FuBehind.FileBytes; piminfo.MainPic = false; pimcon.InsertProductImage(piminfo); } if (fuRight.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuRight.FileBytes; piminfo.MainPic = false; pimcon.InsertProductImage(piminfo); } if (fuFront.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuFront.FileBytes; piminfo.MainPic = false; pimcon.InsertProductImage(piminfo); } if (fuBottom.HasFile) { product_imageinfo piminfo = new product_imageinfo(); ProductImageController pimcon = new ProductImageController(); piminfo.ProductID = productID; piminfo.Images = fuBottom.FileBytes; piminfo.MainPic = false; pimcon.InsertProductImage(piminfo); } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('New Product Inserted Successfully!')", true); }