Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            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());
            }

            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);

            List <ConsignmentModel> lstGrNo = new List <ConsignmentModel>();

            lstGrNo           = objService.getGRNo(rid, cid);
            objModel.ListGrNo = new List <ConsignmentModel>();
            objModel.ListGrNo.AddRange(lstGrNo);

            lstChallan           = objService.getAllChallan(rid, cid);
            objModel.ListChallan = new List <ChallanModel>();
            objModel.ListChallan.AddRange(lstChallan);

            lstChallan = objService.getAllChallanTran();
            objModel.ListChallanTran = new List <ChallanModel>();
            objModel.ListChallanTran.AddRange(lstChallan);

            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objModel));
        }
Exemplo n.º 3
0
        public ActionResult FillEmp()
        {
            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());
            }
            List <VehicleItem> lstVhcl      = new List <VehicleItem>();
            VehicleItem        objVhclModel = new VehicleItem();
            ChallanService     objEmp       = new ChallanService();

            lstVhcl = objEmp.getVehicle(rid, cid);
            objVhclModel.ListVehicle = new List <VehicleItem>();
            objVhclModel.ListVehicle.AddRange(lstVhcl);
            return(Json(objVhclModel.ListVehicle, JsonRequestBehavior.AllowGet));
        }