Ejemplo n.º 1
0
 public ActionResult Refused(string recordId)
 {
     try
     {
         ParkMonthlyCarApply monthlyCarApply = ParkMonthlyCarApplyServices.QueryByRecordID(recordId);
         if (monthlyCarApply == null)
         {
             throw new MyException("申请信息不存在");
         }
         return(View(monthlyCarApply));
     }
     catch (Exception ex)
     {
         ExceptionsServices.AddExceptionToDbAndTxt("AdminAduitCarApply", "查看月租车申请详情失败", ex, LogFrom.WeiXin);
         return(RedirectToAction("Index", "AdminAduitCarApply", new { RemindUserContent = "拒绝失败" }));
     }
 }
Ejemplo n.º 2
0
        public ActionResult Refused(string RecordID, string AuditRemark)
        {
            try
            {
                bool result = ParkMonthlyCarApplyServices.Refused(RecordID, AuditRemark);
                if (!result)
                {
                    throw new MyException("拒绝失败");
                }

                return(RedirectToAction("Index", "AdminAduitCarApply", new { RemindUserContent = "拒绝成功" }));
            }
            catch (MyException ex)
            {
                return(RedirectToAction("Refused", "AdminAduitCarApply", new { recordId = RecordID, RemindUserContent = ex.Message }));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "拒绝月租车申请操作失败");
                return(RedirectToAction("Refused", "AdminAduitCarApply", new { recordId = RecordID, RemindUserContent = "拒绝失败" }));
            }
        }
Ejemplo n.º 3
0
        public ActionResult Passed(string RecordID, string AuditRemark, string CarTypeID, string CarModelID, string AreaIDS, string GateID)
        {
            try
            {
                bool result = ParkMonthlyCarApplyServices.Passed(RecordID, AuditRemark, CarTypeID, CarModelID, AreaIDS, GateID, AdminLoginUser.RecordID);
                if (!result)
                {
                    throw new MyException("审核失败");
                }

                return(RedirectToAction("Index", "AdminAduitCarApply", new { RemindUserContent = "审核成功" }));
            }
            catch (MyException ex)
            {
                return(RedirectToAction("Passed", "AdminAduitCarApply", new { recordId = RecordID, RemindUserContent = ex.Message }));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "审核月租车申请操作失败");
                return(RedirectToAction("Passed", "AdminAduitCarApply", new { recordId = RecordID, RemindUserContent = "审核操作失败" }));
            }
        }
Ejemplo n.º 4
0
        public JsonResult Refused(string RecordID, string AuditRemark)
        {
            try
            {
                bool result = ParkMonthlyCarApplyServices.Refused(RecordID, AuditRemark);
                if (!result)
                {
                    throw new MyException("拒绝失败");
                }

                return(Json(MyResult.Success()));
            }
            catch (MyException ex)
            {
                return(Json(MyResult.Error(ex.Message)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "拒绝月租车申请操作失败");
                return(Json(MyResult.Error("拒绝操作失败")));
            }
        }
Ejemplo n.º 5
0
        public JsonResult Passed(string RecordID, string AuditRemark, string CarTypeID, string CarModelID, string AreaIDS, string GateID)
        {
            try
            {
                bool result = ParkMonthlyCarApplyServices.Passed(RecordID, AuditRemark, CarTypeID, CarModelID, AreaIDS, GateID, GetLoginUser.RecordID);
                if (!result)
                {
                    throw new MyException("审核失败");
                }

                return(Json(MyResult.Success()));
            }
            catch (MyException ex)
            {
                return(Json(MyResult.Error(ex.Message)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "审核月租车申请操作失败");
                return(Json(MyResult.Error("审核操作失败")));
            }
        }
Ejemplo n.º 6
0
        public ActionResult GetAduitMonthlyCarApplyData()
        {
            try
            {
                List <string> parkingIds = new List <string>();
                if (!string.IsNullOrEmpty(Request.Params["parkingId"]))
                {
                    parkingIds.Add(Request.Params["parkingId"].ToString());
                }
                else
                {
                    List <BaseParkinfo> parings = ParkingServices.QueryParkingByVillageIds(GetLoginUserVillages.Select(p => p.VID).ToList());
                    parkingIds = parings.Select(p => p.PKID).ToList();
                }
                if (parkingIds.Count == 0)
                {
                    throw new MyException("获取车场编号失败");
                }

                string applyInfo = Request.Params["applyInfo"];

                DateTime startTime = DateTime.Parse(Request.Params["starttime"]);
                DateTime endTime   = DateTime.Parse(Request.Params["endtime"]);

                MonthlyCarApplyStatus?status = null;
                int intStatus = 0;
                if (!string.IsNullOrWhiteSpace(Request.Params["status"]) && int.TryParse(Request.Params["status"].ToString(), out intStatus))
                {
                    status = (MonthlyCarApplyStatus)intStatus;
                }
                int page = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int rows = 15;

                int total = 0;
                List <ParkMonthlyCarApply> models = ParkMonthlyCarApplyServices.QueryPage(parkingIds, applyInfo, status, startTime, endTime, rows, page, out total);

                var result = from p in models
                             select new
                {
                    ID             = p.ID,
                    RecordID       = p.RecordID,
                    PKID           = p.PKID,
                    CarTypeID      = p.CarTypeID,
                    CarModelID     = p.CarModelID,
                    ApplyName      = p.ApplyName,
                    ApplyMoblie    = p.ApplyMoblie,
                    PlateNo        = GetNullToEmpty(p.PlateNo),
                    PKLot          = GetNullToEmpty(p.PKLot),
                    FamilyAddress  = GetNullToEmpty(p.FamilyAddress),
                    ApplyRemark    = GetNullToEmpty(p.ApplyRemark),
                    ApplyStatus    = (int)p.ApplyStatus,
                    ApplyStatusDes = p.ApplyStatus.GetDescription(),
                    AuditRemark    = GetNullToEmpty(p.AuditRemark),
                    ApplyDateTime  = p.ApplyDateTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    CarTypeName    = p.CarTypeName,
                    CarModelName   = p.CarModelName,
                    PKName         = p.PKName,
                };

                return(Json(MyResult.Success("", result)));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptionToDbAndTxt("AdminAduitCarApply", "获取月租车申请信息失败", ex, LogFrom.WeiXin);
                return(Json(MyResult.Error("获取月租车申请信息失败")));
            }
        }
Ejemplo n.º 7
0
        public ActionResult Passed(string recordId)
        {
            try
            {
                List <BaseVillage> villages     = VillageServices.QueryVillageByEmployeeMobilePhone(WeiXinUser.MobilePhone);
                List <EnumContext> parkContexts = new List <EnumContext>();
                if (villages.Count > 0)
                {
                    List <BaseParkinfo> parkings = ParkingServices.QueryParkingByVillageIds(villages.Select(p => p.VID).ToList());
                    foreach (var item in parkings)
                    {
                        EnumContext model = new EnumContext();
                        model.Description = item.PKName;
                        model.EnumString  = item.PKID;
                        parkContexts.Add(model);
                    }
                }
                ViewBag.ParkContexts = parkContexts;

                ParkMonthlyCarApply monthlyCarApply = ParkMonthlyCarApplyServices.QueryByRecordID(recordId);
                if (monthlyCarApply == null)
                {
                    throw new MyException("申请信息不存在");
                }

                List <ParkArea>    areas        = ParkAreaServices.GetParkAreaByParkingId(monthlyCarApply.PKID);
                List <EnumContext> areaContexts = new List <EnumContext>();
                foreach (var item in areas)
                {
                    EnumContext model = new EnumContext();
                    model.Description = item.AreaName;
                    model.EnumString  = item.AreaID;
                    areaContexts.Add(model);
                }
                ViewBag.AreaContexts = areaContexts;

                List <EnumContext> gateContexts = new List <EnumContext>();
                foreach (var item in areaContexts)
                {
                    List <ParkGate> gates = ParkGateServices.QueryByParkAreaRecordIds(new List <string>()
                    {
                        item.EnumString
                    });

                    foreach (var gate in gates)
                    {
                        EnumContext model = new EnumContext();
                        model.Description = gate.GateName;
                        model.EnumString  = string.Format("{0}|{1}", gate.GateID, item.EnumString);
                        gateContexts.Add(model);
                    }
                }

                ViewBag.GateContexts = gateContexts;

                return(View(monthlyCarApply));
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptionToDbAndTxt("AdminAduitCarApply", "查看月租车申请详情失败", ex, LogFrom.WeiXin);
                return(RedirectToAction("Index", "AdminAduitCarApply", new { RemindUserContent = "审核失败" }));
            }
        }
Ejemplo n.º 8
0
        public string GetAduitMonthlyCarApplyData()
        {
            StringBuilder strData = new StringBuilder();

            try
            {
                if (string.IsNullOrEmpty(Request.Params["parkingId"]))
                {
                    return(string.Empty);
                }
                List <string> parkingIds = new List <string>();
                parkingIds.Add(Request.Params["parkingId"].ToString());

                string applyInfo = Request.Params["applyInfo"];

                DateTime startTime = DateTime.Parse(Request.Params["starttime"]);
                DateTime endTime   = DateTime.Parse(Request.Params["endtime"]);

                MonthlyCarApplyStatus?status = null;
                int intStatus = 0;
                if (!string.IsNullOrWhiteSpace(Request.Params["status"]) && int.TryParse(Request.Params["status"].ToString(), out intStatus))
                {
                    status = (MonthlyCarApplyStatus)intStatus;
                }
                int page = string.IsNullOrEmpty(Request.Params["page"]) ? 0 : int.Parse(Request.Params["page"]);
                int rows = string.IsNullOrEmpty(Request.Params["rows"]) ? 0 : int.Parse(Request.Params["rows"]);

                int total = 0;
                List <ParkMonthlyCarApply> models = ParkMonthlyCarApplyServices.QueryPage(parkingIds, applyInfo, status, startTime, endTime, rows, page, out total);

                var result = from p in models
                             select new
                {
                    ID             = p.ID,
                    RecordID       = p.RecordID,
                    PKID           = p.PKID,
                    CarTypeID      = p.CarTypeID,
                    CarModelID     = p.CarModelID,
                    ApplyName      = p.ApplyName,
                    ApplyMoblie    = p.ApplyMoblie,
                    PlateNo        = p.PlateNo,
                    PKLot          = p.PKLot,
                    FamilyAddress  = p.FamilyAddress,
                    ApplyRemark    = p.ApplyRemark,
                    ApplyStatus    = (int)p.ApplyStatus,
                    ApplyStatusDes = p.ApplyStatus.GetDescription(),
                    AuditRemark    = p.AuditRemark,
                    ApplyDateTime  = p.ApplyDateTime.ToString("yyyy-MM-dd HH:mm:ss"),
                    CarTypeName    = p.CarTypeName,
                    CarModelName   = p.CarModelName
                };

                strData.Append("{");
                strData.Append("\"total\":" + total + ",");
                strData.Append("\"rows\":" + JsonHelper.GetJsonString(result) + ",");
                strData.Append("\"index\":" + page);
                strData.Append("}");
            }
            catch (Exception ex)
            {
                ExceptionsServices.AddExceptions(ex, "查询月租车申请信息失败");
            }

            return(strData.ToString());
        }