Exemplo n.º 1
0
        public List <Cell_Priceinfoinfo> SelectAllCellPrice()
        {
            try
            {
                using (RMSDataContext db = new RMSDataContext())
                {
                    List <Cell_Priceinfoinfo> lcp = new List <Cell_Priceinfoinfo>();
                    {
                        Cell_Priceinfoinfo cppinfo;
                        var cp = (from cpp in db.Cell_Prices select cpp).ToList();

                        foreach (var obj in cp)
                        {
                            cppinfo             = new Cell_Priceinfoinfo();
                            cppinfo.id          = obj.id;
                            cppinfo.Product_id  = obj.Product_id;
                            cppinfo.Cell_Price1 = obj.Cell_Price1;
                            cppinfo.Cell_Price2 = obj.Cell_Price2;
                            cppinfo.UMID        = obj.UMID;
                            cppinfo.Insert_Date = obj.Insert_Date;
                            cppinfo.Update_Date = obj.Update_Date;
                        }

                        return(lcp);
                    }
                }
            }
            catch (Exception ex)
            {
                return(new List <Cell_Priceinfoinfo>());
            }
        }
Exemplo n.º 2
0
 public void UpdateCell_PriceByID(Cell_Priceinfoinfo cinfo)
 {
     using (RMSDataContext db = new RMSDataContext())
     {
         var obj = (from a in db.Cell_Prices where a.id == cinfo.id select a).First();
         obj.id          = cinfo.id;
         obj.Product_id  = cinfo.Product_id;
         obj.Cell_Price1 = cinfo.Cell_Price1;
         obj.Cell_Price2 = cinfo.Cell_Price2;
         obj.UMID        = cinfo.UMID;
         obj.Update_Date = cinfo.Update_Date;
         db.SubmitChanges();
     }
 }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
 public void DeleteCell_PriceByID(Cell_Priceinfoinfo cinfo)
 {
     try
     {
         using (RMSDataContext db = new RMSDataContext())
         {
             var obj = (from a in db.Cell_Prices where a.id == cinfo.id select a).First();
             db.Cell_Prices.DeleteOnSubmit(obj);
             db.SubmitChanges();
         }
     }
     catch (Exception ex)
     {
         Cell_Price c = new Cell_Price();
     }
 }
Exemplo n.º 5
0
 public void InsertCellPrice(Cell_Priceinfoinfo cp)
 {
     try
     {
         using (RMSDataContext db = new RMSDataContext())
         {
             Cell_Price tbl    = new Cell_Price();
             Guid       sellID = Guid.NewGuid();
             tbl.id          = sellID.ToString();
             tbl.Product_id  = cp.Product_id;
             tbl.Cell_Price1 = cp.Cell_Price1;
             tbl.Cell_Price2 = cp.Cell_Price2;
             tbl.UMID        = cp.UMID;
             tbl.Insert_Date = DateTime.Now;
             tbl.Update_Date = DateTime.Now;
             db.Cell_Prices.InsertOnSubmit(tbl);
             db.SubmitChanges();
         }
     }
     catch (Exception ex)
     {
         Cell_Price c = new Cell_Price();
     }
 }
        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);
        }
 public void DeleteCell_Price(Cell_Priceinfoinfo cinfo)
 {
     cpDao.DeleteCell_PriceByID(cinfo);
 }
 public void UpdateCell_Price(Cell_Priceinfoinfo cinfo)
 {
     cpDao.UpdateCell_PriceByID(cinfo);
 }
 public void InsertCell_Price(Cell_Priceinfoinfo cinfo)
 {
     cpDao.InsertCellPrice(cinfo);
 }