/// <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);
     }));
 }
 public JsonResult DeleteNews(long?id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         NewsService.Instance.DeleteNews(id.Value);
     }));
 }
Beispiel #3
0
 public JsonResult UpdateOrderState(long id, string state)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         OrderService.Instance.UpdateOrderState(id, state);
     }));
 }
Beispiel #4
0
 public JsonResult AddCustomer(CustomerDto Customer)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         CustomerService.Instance.AddCustomer(Customer);
     }));
 }
 public JsonResult UpdateUserPhone(int id, string phone, string code)
 {
     return(ExceptionCatch.WechatInvoke(() => UserService.Instance.UpdateUserByWechat(new UserDto()
     {
         Id = id, Phone = phone, Code = code
     })));
 }
 public JsonResult SendPromote(long?id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         PromoteService.Instance.SendPromote(id.Value);
     }));
 }
 public JsonResult UpdateUser(int id, string nickName, string phone, string iconUrl)
 {
     return(ExceptionCatch.WechatInvoke(() => UserService.Instance.UpdateUserByWechat(new UserDto()
     {
         Id = id, NickName = nickName, Phone = phone, IconUrl = iconUrl
     })));
 }
 public JsonResult ApproveRevaluationItem(RevaluationItemModel model)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         RevaluationService.ApproveRevaluationItem(model, UserHelper.GetCurrentUser().Id);
     }));
 }
Beispiel #9
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);
     }));
 }
 public JsonResult FinishRevaluation(long id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         RevaluationService.FinishRevaluation(id, UserHelper.GetCurrentUser().Id);
     }));
 }
Beispiel #11
0
 public JsonResult SendCode(string phone)
 {
     return(ExceptionCatch.WechatInvoke(() =>
     {
         UserService.Instance.SendSmsCode(phone);
     }, "发送成功"));
 }
Beispiel #12
0
 public JsonResult AcceptProject(long id, string note)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         ProjectService.AcceptProject(id, UserHelper.GetCurrentUser().Id, note);
     }));
 }
Beispiel #13
0
 public JsonResult OperateOuterTask(long projectId, OuterTaskModel model, string note)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         ProjectService.OperateOuterTask(projectId, model, UserHelper.GetCurrentUser().Id, note);
     }));
 }
Beispiel #14
0
 public JsonResult OperateReportPrepare(long id, string note)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         ProjectService.OperateReportPrepare(id, UserHelper.GetCurrentUser().Id, note);
     }));
 }
Beispiel #15
0
 public JsonResult OperateReportSend(long projectId, SummaryDataModel model, string note)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         ProjectService.OperateReportSend(projectId, model, UserHelper.GetCurrentUser().Id, note);
     }));
 }
 public JsonResult AdminLogin(string userName, string password)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         UserService.Instance.AdminLogin(userName, password);
     }));
 }
Beispiel #17
0
 public JsonResult DeletePayAmount(long?id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         PayAmountService.Instance.DeletePayAmount(id.Value);
     }));
 }
Beispiel #18
0
 public JsonResult UpdateRule(ReturnRuleDto dto)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         PayAmountService.Instance.UpdateReturnRule(dto);
     }));
 }
Beispiel #19
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);
     }));
 }
 public JsonResult Login(string userName, string password)
 {
     return(ExceptionCatch.WechatInvoke(() =>
     {
         UserService.Instance.CustomerLogin(userName, password);
     }));
 }
Beispiel #21
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);
     }));
 }
 public JsonResult BuyPromote(int promoteId)
 {
     return(ExceptionCatch.WechatInvoke(() =>
     {
         PromoteService.Instance.BuyPromote(promoteId);
     }));
 }
Beispiel #23
0
 public JsonResult DeleteOrder(long?id)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         OrderService.Instance.DeleteOrder(id.Value);
     }));
 }
Beispiel #24
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);
     }));
 }
Beispiel #25
0
 /// <summary>
 /// 保存密码
 /// </summary>
 /// <returns></returns>
 public ActionResult SavePassword(string newPassword)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         var curUser = UserHelper.GetCurrentUser();
         UserService.ChangePassword(curUser.Id, newPassword);
     }));
 }
Beispiel #26
0
 /// <summary>
 /// 退出
 /// </summary>
 /// <returns></returns>
 public ActionResult Logout()
 {
     return(ExceptionCatch.Invoke(() =>
     {
         CookieHelper.RemoveCookie(FormsAuthentication.FormsCookieName);
         FormsAuthentication.SignOut();
     }));
 }
Beispiel #27
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);
            }));
        }
Beispiel #28
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);
         }
     }));
 }
Beispiel #29
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);
     }));
 }
Beispiel #30
0
 public JsonResult UpSetUser(NewsDto news)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         if (news.Id > 0)
         {
             NewsService.Instance.UpdateNews(news);
         }
         else
         {
             NewsService.Instance.AddNews(news);
         }
     }));
 }