Exemplo n.º 1
0
        // GET: MaterialReturn
        public ActionResult Index()
        {
            if (Session["User"] == null)
            {
                Session["From"] = "MaterialReturn";
                return(RedirectToAction("Login", "Home"));
            }

            MaterialReturnModel entity = new MaterialReturnModel();

            entity.Company    = Session["Company"].ToString();
            entity.CreatedBy  = Session["User"].ToString();
            entity.ReasonList = GetReason(Session["Company"].ToString());
            return(View(entity));
        }
Exemplo n.º 2
0
        private MaterialReturnModel ConvertToModelMVC(MaterialReturnWEBAPI materialReturn)
        {
            MaterialReturnModel materialReturnWEBAPI = new MaterialReturnModel();

            materialReturnWEBAPI.ActPartNum   = materialReturn.ActPartNum;
            materialReturnWEBAPI.BalQty       = materialReturn.BalQty;
            materialReturnWEBAPI.Company      = materialReturn.Company;
            materialReturnWEBAPI.CreatedBy    = materialReturn.CreatedBy;
            materialReturnWEBAPI.Desc         = materialReturn.Desc;
            materialReturnWEBAPI.FromBin      = materialReturn.FromBin;
            materialReturnWEBAPI.FromWH       = materialReturn.FromWH;
            materialReturnWEBAPI.Lot          = materialReturn.Lot;
            materialReturnWEBAPI.PartNum      = materialReturn.PartNum;
            materialReturnWEBAPI.Qty          = materialReturn.Qty;
            materialReturnWEBAPI.Reason       = materialReturn.Reason;
            materialReturnWEBAPI.RetReason    = materialReturn.RetReason;
            materialReturnWEBAPI.SupplierPart = materialReturn.SupplierPart;
            materialReturnWEBAPI.TranStatus   = materialReturn.TranStatus;
            materialReturnWEBAPI.UOM          = materialReturn.UOM;
            return(materialReturnWEBAPI);
        }
Exemplo n.º 3
0
        public ActionResult ValidateLot(MaterialReturnModel obj)
        {
            MaterialReturnWEBAPI objSend = new MaterialReturnWEBAPI();

            objSend = ConvertToModelAPI(obj);
            string msg = string.Empty;
            MaterialReturnWEBAPI objReturn = new MaterialReturnWEBAPI();
            HttpResponseMessage  response  = GlobalVariables.WebApiClient.PostAsJsonAsync("RetnMaterialValidateLot", objSend).Result;

            objReturn = response.Content.ReadAsAsync <MaterialReturnWEBAPI>().Result;
            MaterialReturnModel objMVC = new MaterialReturnModel();

            objMVC = ConvertToModelMVC(objReturn);
            if (objReturn.TranStatus != "Success")
            {
                msg = objReturn.TranStatus;
                return(Json(new { Message = msg }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { Data = objMVC }, JsonRequestBehavior.AllowGet));
            }
        }