Beispiel #1
0
 public JsonResult getlistbyContainer(string container)
 {
     return(Json(APIHelper.CallAPI <JsonResultObject <List <MD_PALETTE> > >("pallet/GetListPKL", new
     {
         containerId = container
     }), JsonRequestBehavior.AllowGet));
 }
Beispiel #2
0
 public JsonResult Getbyid(string id)
 {
     try
     {
         var resultJson = APIHelper.CallAPI<JsonResultObject<List<MD_CONSIGNEE>>>("consignee/getdetail", new
         {
             id = id
         });
         if (!resultJson.IsOk)
         {
             return Json(resultJson, JsonRequestBehavior.AllowGet);
         }
         return Json(new JsonResultData
         {
             IsOk = true,
             dataObj = new ConsigneeViewModel().ParseFromDBObject(resultJson.dataObj.FirstOrDefault()),
             dataErr = null,
             Msg = string.Empty,
             totalrows = 1
         }, JsonRequestBehavior.AllowGet);
     }
     catch (Exception ex)
     {
         return Json(new JsonResultData
         {
             IsOk = false,
             dataObj = null,
             dataErr = null,
             Msg = ex.ToString(),
             totalrows = 0
         }, JsonRequestBehavior.AllowGet);
     }
 }
Beispiel #3
0
 public JsonResult Delete(string id = "")
 {
     if (!string.IsNullOrEmpty(id))
     {
         //delete
         var resultJson = APIHelper.CallAPI<JsonResultObject<List<MD_PALETTE>>>("consignee/getdetail", new
         {
             id = id
         });
         if (!resultJson.IsOk)
         {
             return Json(resultJson, JsonRequestBehavior.AllowGet);
         }
         var Detail = resultJson.dataObj.First();
         if (Detail == null)
         {
             return Json(resultJson, JsonRequestBehavior.AllowGet);
         }
         return Json(APIHelper.CallAPI<JsonResultData>("consignee/delete", new
         {
             data = Detail
         }), JsonRequestBehavior.AllowGet);
     }
     else
     {
         return Json(new JsonResultData
         {
             IsOk = false,
             dataErr = null,
             dataObj = null,
             Msg = "Id is null",
             totalrows = 0
         }, JsonRequestBehavior.AllowGet);
     }
 }
        public JsonResult DailyReport()
        {
            var resultReport = APIHelper.CallAPI <string>("pallet/Report");

            if (resultReport == "1")
            {
                return(Json(new JsonResultData
                {
                    IsOk = true,
                    dataObj = "1",
                    Msg = string.Empty,
                    totalrows = 1,
                    dataErr = null
                }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new JsonResultData
                {
                    IsOk = false,
                    dataObj = "1",
                    Msg = string.Empty,
                    totalrows = 1,
                    dataErr = null
                }, JsonRequestBehavior.AllowGet));
            }
        }
Beispiel #5
0
 public JsonResult Save(MD_UNIT info)
 {
     if (info.ID != 0)
     {
         //update
         return(Json(APIHelper.CallAPI <JsonResultData>("unit/update", new
         {
             info.ID,
             info.NAME,
             info.SHORTNAME,
             info.VALUE
         }), JsonRequestBehavior.AllowGet));
     }
     else
     {
         //insert
         return(Json(APIHelper.CallAPI <JsonResultData>("unit/insert", new
         {
             info.ID,
             info.NAME,
             info.SHORTNAME,
             info.VALUE
         }), JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #6
0
 public JsonResult GetPalletCode(string resacode, string mergeselectionid)
 {
     try
     {
         string[] splitselectionid = mergeselectionid.Split('_');
         string   selectionid      = splitselectionid[0];
         string   subselectionid   = splitselectionid[1];
         var      result           = APIHelper.CallAPI <JsonResultData>("uncompletepallet/getprintcode", new
         {
             resacode       = resacode,
             selectionid    = selectionid,
             subselectionid = subselectionid
         });
         return(Json(result, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new JsonResultData
         {
             IsOk = false,
             dataErr = null,
             Msg = "param null",
             dataObj = null,
             totalrows = 0
         }, JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #7
0
 public JsonResult getlistSemiImported(string resacode)
 {
     return(Json(APIHelper.CallAPI <JsonResultObject <List <MD_PALETTE> > >("pallet/getlistSemiImported", new
     {
         resacode = resacode
     }), JsonRequestBehavior.AllowGet));
 }
Beispiel #8
0
        public JsonResult Delete(string id = "")
        {
            if (string.IsNullOrEmpty(id))
            {
                return(Json(new JsonResultData
                {
                    IsOk = false,
                    dataErr = null,
                    dataObj = null,
                    Msg = "Id is null",
                    totalrows = 0
                }, JsonRequestBehavior.AllowGet));
            }
            var resultCheckValidDelete = APIHelper.CallAPI <JsonResultData>("importcontract/checkvaliddeletion", new
            {
                id = id
            });

            if (!resultCheckValidDelete.IsOk)
            {
                return(Json(resultCheckValidDelete, JsonRequestBehavior.AllowGet));
            }
            var resultDelete = APIHelper.CallAPI <JsonResultData>("importcontract/delete", new
            {
                id = id
            });

            return(Json(resultDelete, JsonRequestBehavior.AllowGet));
        }
Beispiel #9
0
 public JsonResult Update2(MD_IMPORTCONTRACT info)
 {
     if (info.ID != 0)
     {
         var result = APIHelper.CallAPI <JsonResultData>("importcontract/update", new
         {
             data = info
         });
         return(Json(new JsonResultData
         {
             IsOk = result.IsOk,
             dataErr = null,
             dataObj = null,
             Msg = "importcontractdetail Update - " + result.Msg,
             totalrows = 0
         }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         return(Json(new JsonResultData
         {
             IsOk = false,
             dataErr = null,
             dataObj = null,
             Msg = "ID CAN NOT BE NULL IN UPDATE FUNCTION",
             totalrows = 0
         }, JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #10
0
 public JsonResult GetListForImpFile(string importContract)
 {
     return(Json(APIHelper.CallAPI <JsonResultObject <List <MD_MATERIAL> > >("material/getlistforimpfile", new
     {
         importContractCode = importContract
     }), JsonRequestBehavior.AllowGet));
 }
Beispiel #11
0
 public JsonResult GetNavigator(string resacode = "")
 {
     try
     {
         ResaView model  = new ResaView();
         var      result = APIHelper.CallAPI <JsonResultObject <List <ResaView> > >("resa/getdetailbyresacode", new
         {
             resa = resacode
         });
         if (result.IsOk)
         {
             model = result.dataObj.FirstOrDefault();
         }
         return(Json(new JsonResultData
         {
             IsOk = true,
             dataObj = model.NAVIGATOR
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new JsonResultData
         {
             IsOk = false,
             Msg = ex.ToString()
         }, JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #12
0
 public string GetGithubStarts()
 {
     return(ReadFromCache <string>("githubstar", () => {
         var s = APIHelper.CallAPI <github>("https://api.github.com/repos/dotnetcore/wtm").Result;
         return s.stargazers_count.ToString();
     }, 1800));
 }
Beispiel #13
0
        public PartialViewResult ResaTableFilterJS(string resacode, string listfilter = "")
        {
            if (string.IsNullOrEmpty(listfilter))
            {
                var lst = new List <string> {
                    "PCS", "KGS", "SQFT"
                };
                ViewBag.Filter = lst;
            }
            else
            {
                var lst = listfilter.Split(',');

                ViewBag.Filter = lst.ToList();
            }

            var resaproductiontableresult = APIHelper.CallAPI <JsonResultObject <List <ResaProductionTable> > >("resa/GetListProductionTable", new
            {
                Resacode = resacode
            });

            if (resaproductiontableresult.IsOk)
            {
                ViewBag.ProductionTable = resaproductiontableresult.dataObj;
            }

            var resultSelectInOne = APIHelper.CallAPI <JsonResultObject <List <SelectionOneList> > >("selection/getselectionfull");

            if (resultSelectInOne.IsOk)
            {
                ViewBag.SelectInOne = resultSelectInOne.dataObj;
            }
            return(PartialView());
        }
Beispiel #14
0
 public JsonResult GetCustomerContract(string contractcode)
 {
     try
     {
         MD_CONTRACT model  = new MD_CONTRACT();
         var         result = APIHelper.CallAPI <JsonResultObject <List <MD_CONTRACT> > >("contract/getlist", new
         {
             PageIndex   = 0,
             PageSize    = 1,
             FilterQuery = string.Format(" CONTRACTCODE = '{0}' ", contractcode),
             OrderBy     = ""
         });
         if (result.IsOk)
         {
             model = result.dataObj.FirstOrDefault();
         }
         var contractfulldetail = new ContractEditViewModel(model);
         return(Json(new JsonResultData
         {
             IsOk = true,
             dataObj = contractfulldetail.CustomerDetail != null ? contractfulldetail.CustomerDetail.CUSTOMERNAME : string.Empty
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new JsonResultData
         {
             IsOk = true,
             Msg = ex.ToString()
         }, JsonRequestBehavior.AllowGet));
     }
 }
 public JsonResult Getbyid(string id)
 {
     try
     {
         var resultJson = APIHelper.CallAPI <JsonResultObject <List <MD_ITEMDETAIL> > >("consignee/getdetail", new
         {
             id = id
         });
         if (!resultJson.IsOk)
         {
             return(Json(resultJson, JsonRequestBehavior.AllowGet));
         }
         return(Json(new JsonResultData
         {
             IsOk = true,
             dataObj = null,
             dataErr = null,
             Msg = string.Empty,
             totalrows = 1
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new JsonResultData
         {
             IsOk = false,
             dataObj = null,
             dataErr = null,
             Msg = ex.ToString(),
             totalrows = 0
         }, JsonRequestBehavior.AllowGet));
     }
 }
        public JsonResult Update(MD_SUPPLIER info)
        {
            info.UPDATEDDATE = DateTime.Now;
            info.UPDATEDUSER = LoginUser.Current.USERNAME;
            var result = APIHelper.CallAPI <JsonResultData>("supplier/update", new { data = info });

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #17
0
 public JsonResult getlistbyFullSelection(string selection, string subselection)
 {
     return(Json(APIHelper.CallAPI <JsonResultObject <List <MD_PALETTE> > >("pallet/getlistunpackcnt", new
     {
         selection = selection,
         subselection = subselection
     }), JsonRequestBehavior.AllowGet));
 }
Beispiel #18
0
 public JsonResult Delete(string id = "")
 {
     try
     {
         ResaView model = new ResaView();
         if (!string.IsNullOrEmpty(id))
         {
             var result = APIHelper.CallAPI <JsonResultObject <List <ResaView> > >("resa/getdetailbyresacode", new
             {
                 resa = id
             });
             if (result.IsOk && result.dataObj != null)
             {
                 model = result.dataObj.FirstOrDefault();
                 if (model == null)
                 {
                     return(Json(new JsonResultData
                     {
                         IsOk = false,
                         Msg = "Data is not exists"
                     }, JsonRequestBehavior.AllowGet));
                 }
                 else
                 {
                     return(Json(APIHelper.CallAPI <JsonResultData>("resa/delete", new
                     {
                         resacode = model.RESACODE,
                         username = LoginUser.Current.USERNAME
                     }), JsonRequestBehavior.AllowGet));
                 }
             }
             else
             {
                 return(Json(new JsonResultData
                 {
                     IsOk = false,
                     Msg = "Data is not exists"
                 }, JsonRequestBehavior.AllowGet));
             }
         }
         else
         {
             return(Json(new JsonResultData
             {
                 IsOk = false,
                 Msg = "ID NULL"
             }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception ex)
     {
         return(Json(new JsonResultData
         {
             IsOk = false,
             Msg = ex.ToString()
         }, JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #19
0
        public override void DoAdd()
        {
            if (Entity.IsInside == true)
            {
                var             domain = DC.Set <FrameworkDomain>().Where(x => x.ID == Entity.DomainId).FirstOrDefault();
                FrameworkAction act    = null;
                if (domain == null)
                {
                    act = DC.Set <FrameworkAction>().Include(x => x.Module.Area).Where(x => x.ID == Entity.ActionId).FirstOrDefault();
                }
                else
                {
                    act = APIHelper.CallAPI <FrameworkAction>(domain.Address + "/WebApi/Pub/GetAction?id=" + Entity.ActionId + "&domainid=" + Entity.DomainId + "&eventts=" + DateTime.Now.Ticks).Result;
                }
                if (act != null)
                {
                    Entity.Url = "/" + act.Module.ClassName + "/" + act.MethodName;
                    if (act.Module.Area != null)
                    {
                        Entity.Url = "/" + act.Module.Area.Prefix + Entity.Url;
                    }
                    Entity.ModuleName = act.Module.ModuleName;
                    Entity.ActionName = act.ActionName;
                }
            }
            else
            {
                Entity.ActionId = null;
                Entity.ModuleId = null;
                if (Entity.Url != null && Entity.Url != "")
                {
                    if (Entity.DomainId == null)
                    {
                        if (Entity.Url.ToLower().StartsWith("http://") == false)
                        {
                            Entity.Url = "http://" + Entity.Url;
                        }
                    }
                    else
                    {
                        if (Entity.Url.StartsWith("/") == false)
                        {
                            Entity.Url = "/" + Entity.Url;
                        }
                    }
                }
            }
            var role = DC.Set <FrameworkRole>().Where(x => x.RoleCode == "001").SingleOrDefault();

            if (role != null && SelectedRolesIDs.Contains(role.ID) == false && SelectedRolesID2.Contains(role.ID) == false)
            {
                Entity.Privileges.Add(new FunctionPrivilege {
                    RoleId = role.ID, Allowed = true
                });
            }
            base.DoAdd();
            AddPrivilege(Entity.ID);
        }
        public JsonResult BeginWarehousing(long id)
        {
            var resultJson = APIHelper.CallAPI <JsonResultData>("importpkl/beginwarehousing", new
            {
                id = id
            });

            return(Json(resultJson, JsonRequestBehavior.AllowGet));
        }
Beispiel #21
0
        public JsonResult getlistPalletResaImported(string resacode)
        {
            var resultJson = APIHelper.CallAPI <JsonResultObject <List <ImpPalletView> > >("importpallet/getlistpalletresaimported", new
            {
                resacode
            });

            return(Json(resultJson, JsonRequestBehavior.AllowGet));
        }
        public JsonResult UpdateList(List <string> lstList)
        {
            var result = APIHelper.CallAPI <JsonResultData>("selection/updateconfig", new
            {
                lstList = lstList
            });

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #23
0
 public ActionResult GetGithubInfo()
 {
     var rv = ReadFromCache<string>("githubinfo", () =>
     {               
         var s = APIHelper.CallAPI<github>("https://api.github.com/repos/dotnetcore/wtm").Result;
         return JsonConvert.SerializeObject(s);
     }, 1800);
     return Content(rv, "application/json");
 }
Beispiel #24
0
        public JsonResult GetFilter(List <string> list)
        {
            var result = APIHelper.CallAPI <JsonResultObject <List <MD_IMPORTDETAIL> > >("importdetail/getfilter", new
            {
                list
            });

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #25
0
        public JsonResult GetListForImpFileFull(string importContract)
        {
            var result = APIHelper.CallAPI <JsonResultObject <List <MaterialOneList> > >("material/getlistforimpfilefull", new
            {
                Code = importContract
            });

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
 public JsonResult GetListbyId(string value)
 {
     return(Json(APIHelper.CallAPI <JsonResultObject <List <MD_SUBSELECTION> > >("subselection/getlist", new
     {
         PageIndex = 0,
         PageSize = -1,
         OrderBy = " ID ASC ",
         FilterQuery = " SELECTION = '" + value + "' "
     }), JsonRequestBehavior.AllowGet));
 }
 public JsonResult GetListFollowId(string value)
 {
     return(Json(APIHelper.CallAPI <JsonResultObject <List <MD_SUBMATERIAL> > >("submaterial/getlist", new
     {
         PageIndex = 0,
         PageSize = -1,
         OrderBy = " ID ASC ",
         FilterQuery = " MATERIALID = '" + value + "' "
     }), JsonRequestBehavior.AllowGet));
 }
Beispiel #28
0
        public JsonResult Scan(string QRcode)
        {
            var result = APIHelper.CallAPI <JsonResultData>("scan/scanarrival", new
            {
                PalletCode = QRcode,
                UserName   = LoginUser.Current.USERNAME
            });

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #29
0
        public JsonResult GetFilter(List <string> list, string contractcode = "")
        {
            var result = APIHelper.CallAPI <JsonResultObject <List <ContractPKL> > >("contract/getfilter", new
            {
                list,
                contractcode
            });

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #30
0
        public JsonResult updatepallet(List <string> list, string ContainerNo)
        {
            var result = APIHelper.CallAPI <JsonResultData>("pallet/updatecontainerpallet", new
            {
                list,
                ContainerNo
            });

            return(Json(result, JsonRequestBehavior.AllowGet));
        }