Exemplo n.º 1
0
        public HttpResponseMessage vehiclecomplaint([FromBody] ComplaintsModel objComplaintsModel)
        {
            var re      = Request;
            var headers = re.Headers;

            if (headers.Contains("token"))
            {
                token = headers.GetValues("token").First();
            }
            var result = Authtoken.checkToken(token);

            if (result == true)
            {
                objComplaintsDL.insert_vehicleComplaints(objComplaintsModel);

                var resp = Request.CreateResponse <ResponseModel>(HttpStatusCode.OK,
                                                                  new ResponseModel()
                {
                    message = "complaint added successfully", statuscode = Convert.ToInt16(HttpStatusCode.OK)
                });
                return(resp);
            }
            else
            {
                var resp = Request.CreateResponse <ResponseModel>(HttpStatusCode.OK, new ResponseModel()
                {
                    message = "UnAuthorized", statuscode = Convert.ToInt16(HttpStatusCode.OK), error = true
                });
                return(resp);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///     更新投诉
        /// </summary>
        /// <param name="model">投诉对象</param>
        /// <returns>返回true时,表示更新成功;反之,表示更新失败</returns>
        /// <remarks>added by jimmy,2015-7-8</remarks>
        public ResultModel Update(ComplaintsModel model)
        {
            var result = new ResultModel
            {
                Data = _database.Db.Complaints.UpdateByComplaintsID(ComplaintsID: model.ComplaintsID,
                                                                    DealPeople: model.DealPeople, DealDate: model.DealDate, Flag: model.Flag, Comments: model.Comments)
            };

            return(result);
        }
 public IActionResult Post([FromBody]  ComplaintsModel complaintsModel)
 {
     try
     {
         var response = _complaintService.AddComplaint(complaintsModel);
         return(Ok(new { compaintId = response }));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, ex.Message);
         return(BadRequest());
     }
 }
Exemplo n.º 4
0
 public DataTable getdrivercomplaintlist(ComplaintsModel objComplaintsModel)
 {
     try
     {
         return(Execution.ExecuteParamerizedSelectCommand("sp_complaints", new SqlParameter[]
         {
             new SqlParameter("@Command", "SELECTBYUSERTYPE"),
         }));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 5
0
        private void SetPosition()
        {
            VisibilityList.Clear();


            for (int i = 0; i < deptList.Count; i++)
            {
                var menu = new ComplaintsModel();

                menu.ShowVisibility = Convert.ToBoolean(deptList[i].Visibility);


                VisibilityList.Add(menu);
            }
        }
Exemplo n.º 6
0
        public ComplaintsViewModel(IRegionManager regionManager, IEventAggregator ea)
        {
            _regionManager    = regionManager;
            _ea               = ea;
            deptList          = ComplaintsModel.XmlParser();
            RetrunViewCommand = new DelegateCommand <object>(RetrunView);
            var dept      = new string[] { "주민", "지적", "인감" };
            var deptIndex = 0;

            for (int i = 0; i < deptList.Count; i++)
            {
                var user = new NameCard();
                user.Name = deptList[i].Name;
                user.Team = deptList[i].Team;
                user.Work = deptList[i].Work;
                user.Tel  = deptList[i].Tel;

                user.ImagePath = System.IO.Path.GetFullPath($"D:\\images\\Complaunts\\{i}.jpg");

                user.DeptIndex = i;
                user.Dept      = deptList[i].Dept;

                user.OnClick += User_OnClick;
                UserList.Add(user);
            }

            SelectCommand = new DelegateCommand <string>(x =>
            {
                //_ea.GetEvent<VideoTimerResetEvent>().Publish(Message);

                var n = int.Parse(x);
                foreach (var item in UserList)
                {
                    item.IsSelected = item.DeptIndex == n;
                }
            });

            PopupCloseCommand = new DelegateCommand(() =>
            {
                //_ea.GetEvent<VideoTimerResetEvent>().Publish(Message);

                ShowPopup    = Visibility.Collapsed;
                SelectedItem = null;
            });

            SetPosition();
        }
        public IActionResult Complainments(ComplaintsModel model)
        {
            if (model.FormOption == "HANDLE" && model.Id != null)
            {
                var complaintToUpdate = _complaintsService.Get(model.Id);

                if (complaintToUpdate == null)
                {
                    return(Complainments());
                }

                complaintToUpdate.State = "Afgehandeld";

                _complaintsService.Update(complaintToUpdate);

                TempData["message"] = new AlertMessage {
                    CssClass = "alert-success", Id = string.Empty, Title = "Klacht afgehandeld.", Message = "Uw hebt de klacht succesvol afgehandeld!"
                };

                return(Complainments());
            }

            if (!ModelState.IsValid)
            {
                return(View());
            }

            var complaint = new Complaint
            {
                Department     = model.Department.ToString(),
                DateOfCreation = DateTime.UtcNow,
                EmailAddress   = User.FindFirstValue(ClaimTypes.Email),
                Description    = model.Description,
                Title          = model.Title,
                UserId         = User.FindFirstValue(ClaimTypes.UserData),
                Priority       = model.Priority.ToString(),
                State          = "In Behandeling"
            };

            _complaintsService.Create(complaint);

            TempData["message"] = new AlertMessage {
                CssClass = "alert-success", Id = string.Empty, Title = "Klacht ontvangen", Message = "Uw klacht is succesvol ontvangen!"
            };

            return(Complainments());
        }
Exemplo n.º 8
0
 public string AddComplaint(ComplaintsModel complaintsModel)
 {
     try
     {
         Complaint complaint = new Complaint()
         {
             CreatedDate = DateTime.UtcNow,
             Id          = Guid.NewGuid().ToString(),
             Message     = complaintsModel.Message,
             Status      = "Intiated",
             UserId      = "1"
         };
         return(_complaintDataProvider.AddComplaint(complaint));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 9
0
        public int insert_supervisorComplaints(ComplaintsModel objComplaintsModel)
        {
            try
            {
                return(Execution.ExecuteNonQuery_with_result("sp_complaints", new SqlParameter[]
                {
                    new SqlParameter("@Command", "INSERTSUPERVISORCOMP"),


                    new SqlParameter("complaintid", objComplaintsModel.complaintid),
                    new SqlParameter("@userId", objComplaintsModel.userid),
                    new SqlParameter("@others", objComplaintsModel.others),
                    new SqlParameter("@status", 1),
                }));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 新增投诉
        /// zhoub 20150716
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ResultModel AddComplaints(ComplaintsModel model)
        {
            var result = new ResultModel();

            using (var bt = this._database.Db.BeginTransaction())
            {
                try
                {
                    bt.Complaints.Insert(model);
                    orderService.UpdateOrderComplaintStatus(model.OrderID, 1);
                    bt.Commit();
                }
                catch (Exception ex)
                {
                    bt.Rollback();
                    result.IsValid = false;
                    result.Messages.Add(ex.Message);
                    throw;
                }
            }
            return(result);
        }
Exemplo n.º 11
0
        /// <summary>
        ///     加载数据
        /// </summary>
        /// <param name="id">对象系统Id</param>
        /// <returns></returns>
        public ActionResult Create(string id)
        {
            ComplaintsModel model = null;

            if (!string.IsNullOrEmpty(id))
            {
                var result = _complaintsService.GetComplaintsById(id);
                if (result.Data != null)
                {
                    model = result.Data;
                }
            }
            else
            {
                model = new ComplaintsModel();
            }
            //投诉状态
            var states = new Dictionary <int, string>();

            states.Add(2, "Handled");
            var list = new List <SelectListItem>();

            if (states != null)
            {
                foreach (var item in states)
                {
                    var info = new SelectListItem();
                    info.Selected = true;
                    info.Value    = item.Key.ToString();
                    info.Text     = item.Value;
                    list.Add(info);
                }
            }
            ViewData["flagList"] = list;
            return(PartialView(model));
        }
Exemplo n.º 12
0
        public ActionResult Create(ComplaintsModel model)
        {
            var admin = UserInfo.CurrentUserName;

            if (ModelState.IsValid)
            {
                var resultModel = new ResultModel();
                if (!string.IsNullOrEmpty(model.ComplaintsID))
                {
                    model.DealPeople = admin;
                    model.DealDate   = DateTime.Now;
                    model.Flag       = 2;
                    var result = _complaintsService.Update(model);
                    resultModel.Messages = new List <string>
                    {
                        result.Data > 0 ? "Handle complaint success" : "Handle complaint failed"
                    };
                    var opera = string.Format("处理投诉状态:{0},操作结果:{1}", JsonConverts.ToJson(model), result.Data > 0 ? "成功" : "失败");
                    LogPackage.InserAC_OperateLog(opera, "订单业务--投诉管理");
                }
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            return(PartialView(model));
        }
Exemplo n.º 13
0
 public static Complaints ToEntity(this ComplaintsModel model)
 {
     return(Mapper.Map <Complaints>(model));
 }