public IActionResult StationeryRetrievalForm2([FromRoute] int id)
        {
            StationeryRetrievalViewModel SRviewModel = new StationeryRetrievalViewModel();

            emp = JsonConvert.DeserializeObject <Employee>(HttpContext.Session.GetString("employee")) as Employee;

            //SR details_clerkid,date,...to show in SR details page //by htp
            StationeryRetrieval sr = srformservice.GetSRDetails(id);

            SRviewModel.stationeryRetrieval = sr;
            //data for requisition form summary in SR details //by htp
            List <RequisitionForm> rfList = srformservice.GetRequisitionDetailBySR_RF(id);

            SRviewModel.retrievalRequisitions = rfList;


            //data for warehouse stock preview table(all products) in SR details //by htp
            List <StationeryRetrievalProduct> srpList = srformservice.GetSRDetailProducts(id);

            SRviewModel.retrievalProducts = srpList;
            SRviewModel.employee          = emp;
            SRviewModel.srrfList          = srformservice.GetSRRFListBySRID(id);

            return(View("StationeryRetrievalFormTransaction", SRviewModel));
        }
        // GET (or POST): /Requisiton/StationeryRetrieval
        public ActionResult StationeryRetrieval(string rid, string message)
        {
            Retrieval r = retrievalService.FindRetrievalById(rid);
            StationeryRetrievalViewModel viewModel = new StationeryRetrievalViewModel();

            if (TempData["message"] != null)
            {
                ViewBag.Message = TempData["message"].ToString();
            }
            else
            {
                ViewBag.Message = message;
            }

            try
            {
                viewModel.StatusId    = r.Status.StatusId;
                viewModel.RetrievalID = r.RetrievalId;
                viewModel.CreatedBy   = r.CreatedBy != null?String.Format("{0} {1}", r.CreatedBy.FirstName, r.CreatedBy.LastName) : "";

                viewModel.CreatedOn = String.Format("{0} {1}", r.CreatedDateTime.ToShortDateString(), r.CreatedDateTime.ToShortTimeString());
                viewModel.UpdatedBy = r.UpdatedBy != null?String.Format("{0} {1}", r.UpdatedBy.FirstName, r.UpdatedBy.LastName) : "";

                viewModel.UpdatedOn = r.UpdatedDateTime != null?String.Format("{0} {1}", r.UpdatedDateTime.Value.ToShortDateString(), r.UpdatedDateTime.Value.ToShortTimeString()) : "";
            }
            catch
            {
                return(new HttpStatusCodeResult(400));
            }
            return(View(viewModel));
        }
Esempio n. 3
0
        public IActionResult SaveAssignedProductsInPendingSR(int srId, [FromBody] StationeryRetrievalViewModel srVModel)
        {
            bool status = srfservice.SetProductsAssignedInSR(srId, srVModel.sRRFPList, srVModel.retrievalProducts, srVModel.srrfList);

            if (status == true)
            {
                return(Ok(srVModel));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 4
0
        public IActionResult SaveReceivedQty([FromBody] StationeryRetrievalViewModel SRviewModel)
        {
            bool status = srfservice.saveReceivedProds3(SRviewModel.retrievalProducts, SRviewModel.stationeryRetrieval.Id, SRviewModel.warehousepacker, SRviewModel.storeclerk, SRviewModel.srrfList);

            if (status == true)
            {
                return(Ok(SRviewModel));
            }
            else
            {
                return(null);
            }
        }
        public IActionResult SaveAssignedProductsInPendingSR([FromRoute] int id, [FromBody] StationeryRetrievalViewModel srVModel)
        {
            bool status = srformservice.SetProductsAssignedInSR(id, srVModel.sRRFPList, srVModel.retrievalProducts, srVModel.srrfList);

            if (status == true)
            {
                return(new JsonResult(new { success = "Success" }));
            }
            else
            {
                return(new JsonResult(new { success = "Failure" }));
            }
        }
        public IActionResult SaveReceivedQty([FromBody] StationeryRetrievalViewModel SRviewModel)
        {
            bool status = srformservice.saveReceivedProds3(SRviewModel.retrievalProducts, SRviewModel.stationeryRetrieval.Id, SRviewModel.warehousepacker, SRviewModel.storeclerk, SRviewModel.srrfList);

            if (status == true)
            {
                return(new JsonResult(new { success = "Success" }));
            }
            else
            {
                return(new JsonResult(new { success = "Failure" }));
            }
        }
Esempio n. 7
0
        public IActionResult StationeryRetrievalForm(int SFId)
        {
            //emp = JsonConvert.DeserializeObject<Employee>(HttpContext.Session.GetString("employee")) as Employee;
            StationeryRetrievalViewModel SRviewModel = new StationeryRetrievalViewModel();

            SRviewModel.stationeryRetrieval   = srfservice.GetSRDetails(SFId);
            SRviewModel.retrievalRequisitions = srfservice.GetRequisitionDetailBySR_RF(SFId);
            SRviewModel.retrievalProducts     = srfservice.GetSRPListForAssign(SFId);
            //SRviewModel.employee = emp;
            SRviewModel.sRRFPList = srfservice.FindSRRFPList(SFId);
            SRviewModel.srrfList  = srfservice.FindSRRFList(SFId);

            return(Ok(SRviewModel));
        }
Esempio n. 8
0
        public IActionResult ViewAssignedProductsInPendingSR(int SFId)
        {
            StationeryRetrievalViewModel srVModel = new StationeryRetrievalViewModel();

            //emp = JsonConvert.DeserializeObject<Employee>(HttpContext.Session.GetString("employee")) as Employee;
            //srVModel.employee = emp;
            srVModel.retrievalProducts = srfservice.GetSRPListForAssign(SFId);
            StationeryRetrieval sr = srfservice.FindBySRId(SFId);

            srVModel.sRRFPList           = srfservice.FindSRRFPList(SFId);
            srVModel.stationeryRetrieval = sr;
            srVModel.srrfList            = srfservice.GetSRRFListBySRID(SFId);
            return(Ok(srVModel));
        }
        public IActionResult ViewAssignedProductsInPendingSR([FromRoute] int id)
        {
            StationeryRetrievalViewModel srVModel = new StationeryRetrievalViewModel();

            emp = JsonConvert.DeserializeObject <Employee>(HttpContext.Session.GetString("employee")) as Employee;
            srVModel.employee          = emp;
            srVModel.retrievalProducts = srformservice.GetSRPListForAssign(id);
            StationeryRetrieval sr = srformservice.FindBySRId(id);

            srVModel.sRRFPList           = srformservice.FindSRRFPList(id);
            srVModel.stationeryRetrieval = sr;
            srVModel.srrfList            = srformservice.GetSRRFListBySRID(id);
            return(View("StationeryRetrievalFormAssignment", srVModel));
        }