Esempio n. 1
0
        public ActionResult _ContactEdit(string agreeCompId = "", long id = 0)
        {
            if (id <= 0)
            {
                return(View(new AgreeCompanyContact()
                {
                    AgreeCompId = agreeCompId, HotelId = UserContext.CurrentUser.HotelId
                }));
            }
            var info = AgreeCompanyContactBll.GetById(id);

            return(View(info));
        }
Esempio n. 2
0
        public ActionResult ContactDelete(long id)
        {
            var apiResult = new APIResult();

            try
            {
                AgreeCompanyContactBll.DeleteById(id);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }
            return(Json(apiResult));
        }
Esempio n. 3
0
        public JsonResult EditContact(AgreeCompanyContact model)
        {
            var apiResult = new APIResult();
            var user      = UserContext.CurrentUser;

            try
            {
                AgreeCompanyContactBll.AddOrUpdate(model, user.Id, user.Name, user.HotelId);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }

            return(Json(apiResult));
        }
Esempio n. 4
0
        public string GetContactList(string agreeCompId)
        {
            var datas = AgreeCompanyContactBll.GetList(UserContext.CurrentUser.HotelId, agreeCompId);

            return(JsonConvert.SerializeObject(datas));
        }