示例#1
0
 public JsonResult DeleteNews(long?id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         NewsService.Instance.DeleteNews(id.Value);
     }));
 }
示例#2
0
 public JsonResult AddCustomer(CustomerDto Customer)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         CustomerService.Instance.AddCustomer(Customer);
     }));
 }
示例#3
0
 public JsonResult OperateReportPrepare(long id, string note)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         ProjectService.OperateReportPrepare(id, UserHelper.GetCurrentUser().Id, note);
     }));
 }
示例#4
0
 public JsonResult DeleteOrder(long?id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         OrderService.Instance.DeleteOrder(id.Value);
     }));
 }
示例#5
0
 /// <summary>
 /// 更新用户余额
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="price"></param>
 /// <returns></returns>
 public JsonResult UpdateUserBalance(long?id, int?price, string remark)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         UserService.Instance.UpdateUserBalance(id.Value, price.Value, remark);
     }));
 }
示例#6
0
 /// <summary>
 /// 启用,禁用
 /// </summary>
 /// <param name="id"></param>
 /// <param name="status"></param>
 /// <returns></returns>
 public JsonResult SaveStatus(long id, bool status)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         CompanyService.SaveStatus(id, status);
     }));
 }
示例#7
0
 public JsonResult AcceptProject(long id, string note)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         ProjectService.AcceptProject(id, UserHelper.GetCurrentUser().Id, note);
     }));
 }
示例#8
0
 /// <summary>
 /// 用户登录
 /// </summary>
 /// <param name="userAccount"></param>
 /// <param name="password"></param>
 /// <param name="validateCode"></param>
 /// <param name="remember"></param>
 /// <returns></returns>
 public ActionResult UserLogin(string userAccount, string password, string validateCode, bool remember)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         string registerCode = string.Format("{0}", CookieHelper.GetCookie("RegisterCode"));
         if (String.Compare(validateCode, DESEncrypt.Decrypt(registerCode), true) != 0)
         {
             throw new ApplicationException("验证码有误");
         }
         //记住密码
         var rememberUser = new UserRememberModel {
             UserName = userAccount, Password = password, IsRemember = remember
         };
         if (remember)
         {
             string strValues = DESEncrypt.Encrypt(JsonConvert.SerializeObject(rememberUser));
             CookieHelper.WriteCookie(rememberCookieName, strValues, DateTime.Now.AddDays(7));
         }
         else
         {
             CookieHelper.RemoveCookie(rememberCookieName);
         }
         //登录逻辑
         var user = UserService.UserLogin(userAccount, CryptTools.Md5(password));
         UserHelper.SetAuth(user);
     }));
 }
示例#9
0
 public JsonResult OperateOuterTask(long projectId, OuterTaskModel model, string note)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         ProjectService.OperateOuterTask(projectId, model, UserHelper.GetCurrentUser().Id, note);
     }));
 }
示例#10
0
 /// <summary>
 /// 修改公司-保存
 /// </summary>
 /// <param name="company"></param>
 /// <param name="BuninessType"></param>
 /// <returns></returns>
 public JsonResult SaveInfo(CompanyModel company, UserModel user, List <string> BuninessType)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         CompanyService.Save(company, user, BuninessType);
     }));
 }
示例#11
0
 public JsonResult SendPromote(long?id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         PromoteService.Instance.SendPromote(id.Value);
     }));
 }
示例#12
0
 public JsonResult AdminLogin(string userName, string password)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         UserService.Instance.AdminLogin(userName, password);
     }));
 }
示例#13
0
 public JsonResult FinishRevaluation(long id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         RevaluationService.FinishRevaluation(id, UserHelper.GetCurrentUser().Id);
     }));
 }
示例#14
0
 public JsonResult DeletePayAmount(long?id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         PayAmountService.Instance.DeletePayAmount(id.Value);
     }));
 }
示例#15
0
 public JsonResult UpdateRule(ReturnRuleDto dto)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         PayAmountService.Instance.UpdateReturnRule(dto);
     }));
 }
示例#16
0
 public JsonResult ApproveRevaluationItem(RevaluationItemModel model)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         RevaluationService.ApproveRevaluationItem(model, UserHelper.GetCurrentUser().Id);
     }));
 }
示例#17
0
 public JsonResult UpdateOrderState(long id, string state)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         OrderService.Instance.UpdateOrderState(id, state);
     }));
 }
示例#18
0
 public JsonResult OperateReportSend(long projectId, SummaryDataModel model, string note)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         ProjectService.OperateReportSend(projectId, model, UserHelper.GetCurrentUser().Id, note);
     }));
 }
示例#19
0
 /// <summary>
 /// 添加公司-保存
 /// </summary>
 /// <param name="company"></param>
 /// <param name="user"></param>
 /// <param name="BuninessType"></param>
 /// <returns></returns>
 public JsonResult Save(CompanyModel company, UserModel user, List <string> BuninessType)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         user.Password = CryptTools.Md5(user.Password);
         CompanyService.Create(company, user, BuninessType);
     }));
 }
示例#20
0
 /// <summary>
 /// 保存密码
 /// </summary>
 /// <returns></returns>
 public ActionResult SavePassword(string newPassword)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         var curUser = UserHelper.GetCurrentUser();
         UserService.ChangePassword(curUser.Id, newPassword);
     }));
 }
示例#21
0
 /// <summary>
 /// 退出
 /// </summary>
 /// <returns></returns>
 public ActionResult Logout()
 {
     return(ExceptionCatch.Invoke(() =>
     {
         CookieHelper.RemoveCookie(FormsAuthentication.FormsCookieName);
         FormsAuthentication.SignOut();
     }));
 }
示例#22
0
        public JsonResult OperateReportEstimate(long projectId, SummaryDataModel model, string note)
        {
            string data = JsonConvert.SerializeObject(model);

            return(ExceptionCatch.Invoke(() =>
            {
                ProjectService.OperateReportEstimate(projectId, model, UserHelper.GetCurrentUser().Id, note);
            }));
        }
示例#23
0
 public JsonResult UpdateCustomer(CustomerDto customer)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         CustomerService.Instance.UpdateCustomer(customer);
         if (!string.IsNullOrEmpty(customer.OpenId))
         {
             var c = CustomerService.Instance.GetCustomer(customer.Id);
             WechatService.SendCustomerMessage(string.Format("问题:{0},回复:{1}", c.Question, customer.Answer), customer.OpenId);
         }
     }));
 }
示例#24
0
 /// <summary>
 /// 修改密码
 /// </summary>
 /// <param name="id"></param>
 /// <param name="password"></param>
 /// <returns></returns>
 public JsonResult ChangePassword(long companyId, string password)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         var user = UserService.GetUserList(companyId).FirstOrDefault();
         if (user == null)
         {
             throw new ServiceException("公司不存在用户");
         }
         UserService.ChangePassword(user.Id, password);
     }));
 }
示例#25
0
 public JsonResult UpSetUser(NewsDto news)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         if (news.Id > 0)
         {
             NewsService.Instance.UpdateNews(news);
         }
         else
         {
             NewsService.Instance.AddNews(news);
         }
     }));
 }
示例#26
0
 public JsonResult UpSetMatch(MatchDto match)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         if (match.Id > 0)
         {
             MatchService.Instance.UpdateMatch(match);
         }
         else
         {
             MatchService.Instance.AddMatch(match);
         }
     }));
 }
示例#27
0
 public JsonResult UpSetPayAmount(PayAmountDto PayAmount)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         if (PayAmount.Id > 0)
         {
             PayAmountService.Instance.UpdatePayAmount(PayAmount);
         }
         else
         {
             PayAmountService.Instance.AddPayAmount(PayAmount);
         }
     }));
 }
示例#28
0
 public JsonResult UpSetGoods(GoodsDto Goods)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         if (Goods.Id > 0)
         {
             GoodsService.Instance.UpdateGoods(Goods);
         }
         else
         {
             GoodsService.Instance.AddGoods(Goods);
         }
     }));
 }
示例#29
0
 public JsonResult UpSetOrder(OrderDto Order)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         if (Order.Id > 0)
         {
             OrderService.Instance.UpdateOrder(Order);
         }
         else
         {
             OrderService.Instance.AddOrder(Order);
         }
     }));
 }
示例#30
0
 public JsonResult UpdateUser(UserDto user)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         if (user.Id > 0)
         {
             UserService.Instance.UpdateUser(user);
         }
         else
         {
             user.IsAdmin = true;
             UserService.Instance.AddAdminUser(user);
         }
     }));
 }