public JsonResult Get_Produced_Rice_id(int id)
        {
            try
            {
                Rice_Production_ProductWorth worth = db.Rice_Production_ProductWorths.Find(id);

                Rice_Produce_Bag bagid     = db.Rice_Produce_Bags.Find(worth.Rice_Produce_Bags_id);
                int     Rice_Production_id = bagid.Rice_Production_id;
                decimal qty     = worth.Rice_Production_ProductWorth_Qty;
                decimal Soldqty = worth.Rice_Production_ProductWorth_SoldQty;
                decimal PBP     = worth.Rice_Production_ProductWorth_PBA;


                int    Rice_Production_ProductWorth_id = id;
                string bprsc_title = worth.Rice_Production_ProductWorth_name;
                int    worthid     = worth.Rice_Production_ProductWorth_id;

                Tuple <decimal, int, decimal, string, decimal, int, int> tpl = new Tuple <decimal, int, decimal, string, decimal, int, int>
                                                                               (
                    qty,
                    Rice_Production_ProductWorth_id,
                    Soldqty,
                    bprsc_title,
                    PBP,
                    worthid,
                    Rice_Production_id
                                                                               );

                return(Json(tpl, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
        }
Example #2
0
        public ActionResult WorthRiceStock(FormCollection form, Rice_Production_ProductWorth worth)
        {
            string idd = Convert.ToString(Session["UserId"]);

            var RiceName = Convert.ToString(form["RiceName"]);

            worth.Rice_Production_ProductWorth_name = RiceName;

            worth.Rice_Production_ProductWorth_Qty = Convert.ToInt32(form["BAgs"]);
            worth.Rice_Production_ProductWorth_PBA = Convert.ToDecimal(form["Price"]);
            db.Rice_Production_ProductWorths.Add(worth);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }