예제 #1
0
        public ActionResult Action(Tbl_ReportMaster reportobj, LineItem list)
        {
            try
            {
                MVCManager.MVCHelper.SaveReport(reportobj, list);
            }
            catch (Exception ex)
            {

            }
            return RedirectToAction("Home");
        }
예제 #2
0
 public static void SaveReport(Tbl_ReportMaster reportobj, LineItem list)
 {
     try
     {
         List <LineItemListClass> lineList = new List <LineItemListClass>();
         int rowcount = list.cgst.Length;
         for (int i = 0; i < rowcount; i++)
         {
             LineItemListClass Lineobj = new LineItemListClass()
             {
                 itemname = list.itemname[i],
                 hsn      = list.hsn[i],
                 uom      = list.uom[i],
                 qty      = list.qty[i],
                 rpu      = list.rpu[i],
                 tvalue   = list.tvalue[i],
                 rate     = list.rate[i],
                 igst     = list.igst[i],
                 sgst     = list.sgst[i],
                 cgst     = list.cgst[i],
                 utgst    = list.utgst[i],
                 total    = list.total[i],
                 cess     = list.cess[i],
             };
             lineList.Add(Lineobj);
         }
         reportobj.ItemInfo = Newtonsoft.Json.JsonConvert.SerializeObject(lineList);
         using (GSTDB db = new GSTDB())
         {
             db.Tbl_ReportMaster.Add(reportobj);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
     }
 }