Exemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            #region Check Rights
            bool hasRights = false;
            hasRights = AdminHelper.CheckUserAction(ScreenEnum.Contractor, ActionEnum.Delete);
            if (!hasRights)
            {
                return(Json("You are UnAuthorized to do this action"));
            }

            #endregion
            string isDeleted = ContractorHelper.Delete(id);
            return(Json(isDeleted));
        }
Exemplo n.º 2
0
        public ActionResult ManageOrder(int id = 0)
        {
            var truckingOrderDetailVm = TruckingHelper.GetTruckingOrderDetailInfo(id);

            ViewBag.TruckingCostNameList = ListCommonHelper.GetTruckingCostNameList();
            ViewBag.CurrencyList         = ListCommonHelper.GetCurrencyList();
            ViewBag.ContractorList       = ListCommonHelper.GetContractorListByCity("en", truckingOrderDetailVm.FromCityId,
                                                                                    truckingOrderDetailVm.ToCityId);

            ViewBag.PackageList = ListCommonHelper.GetPackageTypeList();

            if (truckingOrderDetailVm.ContractorId != 0)
            {
                ViewBag.Contractorobj = ContractorHelper.GetContractorInfo(truckingOrderDetailVm.ContractorId).ContractorNameEn;
            }



            return(View(truckingOrderDetailVm));
        }
Exemplo n.º 3
0
        public ActionResult Add(int id = 0)
        {
            #region Check Rights
            bool hasRights;
            if (id == 0) //Check export rights
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.Contractor, ActionEnum.Add);
            }
            else
            {
                hasRights = AdminHelper.CheckUserAction(ScreenEnum.Contractor, ActionEnum.Edit);
            }

            if (!hasRights)
            {
                return(RedirectToAction("UnAuthorized", "Home", new { area = "" }));
            }

            #endregion

            ViewData["CityList"] = ListCommonHelper.GetCityGrouped();
            ContractorVm contractorObj = ContractorHelper.GetContractorInfo(id);
            return(View(contractorObj));
        }
Exemplo n.º 4
0
        public ActionResult GetContractorContacts(int contractorId)
        {
            var contactList = ContractorHelper.GetContactsList(contractorId);

            return(PartialView("~/Views/Shared/_ViewContacts.cshtml", contactList));
        }
Exemplo n.º 5
0
        public ActionResult AddEditContractor(ContractorVm contractorVm)
        {
            string isSaved = ContractorHelper.AddEditContractor(contractorVm);

            return(Json(isSaved));
        }
Exemplo n.º 6
0
        public ActionResult Index()
        {
            List <ContractorVm> contractorList = ContractorHelper.GetContractorList();

            return(View(contractorList));
        }