public ActionResult AddGR(ChallanModel model, string cmd) { ChallanService objService = new ChallanService(); int id = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); model.CID = id; if (cmd == "Add") { objService.InsertChallanTran(model); } else { objService.Update(model); } int uid = 0; int cid = 0; int rid = 0; if (Session["UserId"] != null) { uid = Convert.ToInt32(Session["UserId"].ToString()); cid = Convert.ToInt32(Session["CompID"].ToString()); rid = Convert.ToInt32(Session["CompID"].ToString()); } ChallanModel objModel = new ChallanModel(); List <ChallanModel> lstChallan = new List <ChallanModel>(); objModel = objService.GetById(id); List <ConsignmentModel> lstGrNo = new List <ConsignmentModel>(); lstGrNo = objService.getGRNo(rid, cid); objModel.ListGrNo = new List <ConsignmentModel>(); objModel.ListGrNo.AddRange(lstGrNo); List <VehicleItem> lstVehicle = new List <VehicleItem>(); lstVehicle = objService.getVehicle(rid, cid); objModel.ListVehicle = new List <VehicleItem>(); objModel.ListVehicle.AddRange(lstVehicle); List <EmployeeItem> lstEmp = new List <EmployeeItem>(); lstEmp = objService.GetEmp(cid); objModel.ListEmp = new List <EmployeeItem>(); objModel.ListEmp.AddRange(lstEmp); lstChallan = objService.getChallanTran(id); objModel.ListChallan = new List <ChallanModel>(); objModel.ListChallan.AddRange(lstChallan); ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objModel)); }
public ActionResult PrintChallan(string id) { ChallanService objService = new ChallanService(); ChallanModel objModel = new ChallanModel(); List <ChallanModel> lstChallan = new List <ChallanModel>(); EncDec objEnDec = new EncDec(); string cid = objEnDec.Decrypt(id); objModel = objService.GetById(Convert.ToInt32(cid)); lstChallan = objService.getChallanTran(Convert.ToInt32(cid)); objModel.ListChallanTran = new List <ChallanModel>(); objModel.ListChallanTran.AddRange(lstChallan); return(View(objModel)); }
public ActionResult AddGR(int id) { ChallanService objService = new ChallanService(); ChallanModel objModel = new ChallanModel(); List <ChallanModel> lstChallan = new List <ChallanModel>(); int uid = 0; int cid = 0; int rid = 0; if (Session["UserId"] != null) { uid = Convert.ToInt32(Session["UserId"].ToString()); cid = Convert.ToInt32(Session["CompID"].ToString()); rid = Convert.ToInt32(Session["CompID"].ToString()); } objModel = objService.GetById(id); List <ConsignmentModel> lstGrNo = new List <ConsignmentModel>(); lstGrNo = objService.getGRNo(rid, cid); objModel.ListGrNo = new List <ConsignmentModel>(); objModel.ListGrNo.AddRange(lstGrNo); List <VehicleItem> lstVehicle = new List <VehicleItem>(); lstVehicle = objService.getVehicle(rid, cid); objModel.ListVehicle = new List <VehicleItem>(); objModel.ListVehicle.AddRange(lstVehicle); List <EmployeeItem> lstEmp = new List <EmployeeItem>(); lstEmp = objService.GetEmp(cid); objModel.ListEmp = new List <EmployeeItem>(); objModel.ListEmp.AddRange(lstEmp); lstChallan = objService.getChallanTran(id); objModel.ListChallan = new List <ChallanModel>(); objModel.ListChallan.AddRange(lstChallan); ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objModel)); }