예제 #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));
        }
예제 #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));
        }
예제 #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));
        }
예제 #4
0
        public ActionResult GetContractorContacts(int contractorId)
        {
            var contactList = ContractorHelper.GetContactsList(contractorId);

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

            return(Json(isSaved));
        }
예제 #6
0
        public ActionResult Index()
        {
            List <ContractorVm> contractorList = ContractorHelper.GetContractorList();

            return(View(contractorList));
        }