public CommonOutput savebp2(savebp2model req) { CommonOutput output = new CommonOutput(); try { using (var objDB = new AdityamineralsEntities()) { var proddesc = objDB.ADM_M_BILLINGPRODUCTS.Where(c => c.Sno == req.prodid).FirstOrDefault(); SqlParameter InvoiceNo = new SqlParameter("@InvoiceNo", Convert.ToInt32(req.invoiceno)); SqlParameter ProductionDescription_VC = new SqlParameter("@proddesc", proddesc.ProductDescription); SqlParameter HSNCODE_VC = new SqlParameter("@hsncode", req.hsncode); SqlParameter UOM_VC = new SqlParameter("@uom", req.uom); SqlParameter QTY = new SqlParameter("@qty", req.qty); SqlParameter Rate = new SqlParameter("@rate", req.rate); SqlParameter Amount = new SqlParameter("@amount", req.amount); SqlParameter Discount = new SqlParameter("@discount", req.discount); SqlParameter ValueofSupply = new SqlParameter("@valueofsupply", req.valueofsupply); SqlParameter Sno = new SqlParameter("@prodid", req.prodid); output = objDB.Database.SqlQuery <CommonOutput>("[dbo].[ADM_SAVEBP2] @InvoiceNo,@proddesc,@hsncode,@uom,@qty,@rate,@amount,@discount,@valueofsupply,@prodid", InvoiceNo, ProductionDescription_VC, HSNCODE_VC, UOM_VC, QTY, Rate, Amount, Discount, ValueofSupply, Sno).FirstOrDefault(); } } catch (Exception ex) { output.StatusCode = 500; output.Message = ex.Message; } return(output); }
public CommonOutput savebp2(savebp2model req) { CommonOutput output = new CommonOutput(); try { DashbordDL obj = new DashbordDL(); output = obj.savebp2(req); } catch (Exception ex) { } return(output); }
public dynamic savebp2(savebp2model req) { CommonOutput output = new CommonOutput(); if (Session["UserName"] != null) { DashboardBL bl = new DashboardBL(); output = bl.savebp2(req); } else { return(RedirectToAction("Login", "Login")); } return(Json(output, JsonRequestBehavior.AllowGet)); }