public ActionResult DeleteConfirmed(string id)
        {
            Product_details product_details = (from p in db.Product_details where p.ProductID == id select p).FirstOrDefault();

            db.Product_details.Remove(product_details);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ProductID,Color,SizeID,DateAdd,Price,Quanlity")] Product_details product_details)
 {
     if (ModelState.IsValid)
     {
         db.Entry(product_details).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ProductID = new SelectList(db.PRODUCTS, "ProductID", "ProductName", product_details.ProductID);
     ViewBag.SizeID    = new SelectList(db.SIZEs, "SizeID", "SizeType", product_details.SizeID);
     return(View(product_details));
 }
        // GET: admin/Product_details/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Product_details product_details = db.Product_details.Find(id);

            if (product_details == null)
            {
                return(HttpNotFound());
            }
            return(View(product_details));
        }
        // GET: admin/Product_details/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Product_details product_details = (from p in db.Product_details where p.ProductID == id select p).FirstOrDefault();

            if (product_details == null)
            {
                return(HttpNotFound());
            }
            return(View(product_details));
        }
        // GET: admin/Product_details/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Product_details product_details = db.Product_details.Find(id);

            if (product_details == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ProductID = new SelectList(db.PRODUCTS, "ProductID", "ProductName", product_details.ProductID);
            ViewBag.SizeID    = new SelectList(db.SIZEs, "SizeID", "SizeType", product_details.SizeID);
            return(View(product_details));
        }
示例#6
0
            public override void Finally()
            {
                Product_details     __svc__  = (Product_details)_service;
                __Product_details_1 __ctx1__ = (__Product_details_1)(__svc__._stateMgrs[1]);

                if (__ctx1__ != null && __ctx1__.__In_msg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__In_msg);
                    __ctx1__.__In_msg = null;
                }
                if (__ctx1__ != null && __ctx1__.__Insert_Product != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__Insert_Product);
                    __ctx1__.__Insert_Product = null;
                }
                base.Finally();
            }
示例#7
0
            public override void Finally()
            {
                Product_details          __svc__  = (Product_details)_service;
                __Product_details_root_0 __ctx0__ = (__Product_details_root_0)(__svc__._stateMgrs[0]);

                if (__svc__.Port_1 != null)
                {
                    __svc__.Port_1.Close(this, null);
                    __svc__.Port_1 = null;
                }
                if (__svc__.Port_2 != null)
                {
                    __svc__.Port_2.Close(this, null);
                    __svc__.Port_2 = null;
                }
                base.Finally();
            }
示例#8
0
 protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
 {
     using (SqlConnection conn = new SqlConnection(conn_string))
     {
         SqlDataAdapter adapter = new SqlDataAdapter();
         SqlCommand     scmd    = new SqlCommand();
         scmd.Connection  = conn;
         scmd.CommandText = "USP_ExtractPid";
         scmd.CommandType = CommandType.StoredProcedure;
         scmd.Parameters.AddWithValue("@pid", product_list.SelectedItem.Value);
         adapter.SelectCommand = scmd;
         dt = new DataTable();
         adapter.Fill(dt);
         //DataTable newdt = from dt where "id" == product_list.SelectedValue
         //     select ;
         //TextBox1.Text=newdt.GetType().ToString();
         Product_details.DataSource = dt;
         Product_details.DataBind();
     }
 }