示例#1
0
        public ActionResult GuardPaymentReport()
        {
            GuardViewModel objectGuardViewModel = new GuardViewModel();

            objectGuardViewModel.Guardlist = new SelectList(_guardComponent.GetAllGaurd(), "GuardId", "NameSSN");
            return(View(objectGuardViewModel));
        }
        public ActionResult CreateUpdateGuardPaymentPopup(int id)
        {
            var guardPayment = _guardPaymentComponent.GetGuardPayment(id);

            if (guardPayment == null)
            {
                guardPayment = new GuardPaymentViewModel();
            }
            guardPayment.GuardList = new SelectList(_guardComponent.GetAllGaurd(), "GuardId", "NameSSN");
            //customerPayment.InvoiceList = new SelectList(_customerInvoiceComponent.GetAllCustomerInvoice(), "InvoiceId", "InvoiceNo");
            return(PartialView("/Views/Shared/Partials/_GuardPayment.cshtml", guardPayment));
        }
示例#3
0
        public ActionResult GetGuards()
        {
            //Validate User Pemissions
            string action = string.Empty;

            if (CommonClass.GetPermission(SecurityAgency.Common.Utility.EnumUtility.Permissions.EditGuard))
            {
                action += "<span class='glyphicon glyphicon-pencil create-pencil' onclick='CreateUpdateGuardPopup($$GuardId$$)'></span>&nbsp;";
            }
            if (CommonClass.GetPermission(SecurityAgency.Common.Utility.EnumUtility.Permissions.DeleteGuard))
            {
                action += "&nbsp;<span class='glyphicon glyphicon-trash delete-trash'  onclick='DeleteGuard($$GuardId$$)'></span>";
            }
            var guards = _gaurdComponent.GetAllGaurd();

            if (guards == null)
            {
                return(null);
            }

            List <string[]> data         = new List <string[]>();
            var             totalRecords = guards.Count();

            foreach (var guard in guards)
            {
                var row = new string[]
                {
                    guard.Name,
                    guard.SSN,
                    guard.Address,
                    guard.ContactNo,
                    guard.HourlyRate.ToString(),
                    guard.CreatedDate.ToShortDateString(),
                    action.Replace("$$GuardId$$", guard.GuardId.ToString())
                };
                data.Add(row);
            }

            return(Json(new { aaData = data,
                              iTotalRecords = totalRecords,
                              iTotalDisplayRecords = totalRecords, }, JsonRequestBehavior.AllowGet));
        }