Exemple #1
0
 /// <summary>
 /// Author:Gavin
 /// Description:加入使用企业
 /// Create Data:2017-03-18
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult SubmitServerCompany(string id)
 {
     try
     {
         LZY.BX.Model.User user = new UserService().Get(CurrentUser.User.UserId);
         cService.AddServerCompany(user, id);
         AuthMng.Instance.InitUserCookie(HttpContext, new UserCookie(
                                             new AuthUser
         {
             User           = CurrentUser.User,
             UseCompany     = CurrentUser.UseCompany,
             ServiceCompany = cService.GetServiceInfo(user)
         }));
         return(ResultSuccess("操作成功.", "../Order/Order"));
     }
     catch (DataExistException e)
     {
         return(Json(new { error = e.Message }));
     }
 }
Exemple #2
0
 /// <summary>
 /// Author:Gavin
 /// Description:加入使用(服务)企业
 /// Create Data:2017-03-18
 /// </summary>
 /// <param name="appType"></param>
 /// <param name="id"></param>
 /// <returns></returns>
 public ActionResult AddCompany(AppType appType, string id)
 {
     try
     {
         if (AppType.Use == appType)
         {
             cService.AddCompany(ApiUser.Current, id);
         }
         else if (AppType.Service == appType)
         {
             cService.AddServerCompany(ApiUser.Current, id);
         }
         //更新缓存
         ApiUser.UpdateCurrent(ApiUser.Current.UserId);
         return(Json(new { status = 0 }));
     }
     catch (DataExistException e)
     {
         return(Json(new { error = e.Message }));
     }
 }