예제 #1
0
        public ActionResult Edit(Sys_AutoBackupModel model)
        {
            var service = new RestServiceClient <Sys_AutoBackupModel>(UserLogin);

            service.SetCookies(this.Request.Cookies, _hrm_Sys_Service);
            var result = service.Post(_hrm_Sys_Service, "api/Sys_AutoBackup/", model);

            return(Json(result));
        }
예제 #2
0
        /// <summary>
        /// [Tin.Nguyen] - Xóa hoặc chuyển đổi trạng thái của Dân Tộc(Cat_ExportItem) sang IsDelete
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Sys_AutoBackupModel DeleteOrRemove(string id)
        {
            //var spitId = id.Split(',');
            var model = new Sys_AutoBackupModel();
            //LibraryService.StartTaskScheduler(Common.ConvertToGuid(spitId[1]));
            ActionService service = new ActionService(UserLogin);
            var           result  = service.DeleteOrRemove <Sys_AutoBackupEntity, Sys_AutoBackupModel>(id);

            return(model);
        }
예제 #3
0
        public ActionResult Edit(Sys_AutoBackupModel model)
        {
            var isAccess = CheckPermission(UserId, PrivilegeType.Create, ConstantPermission.Cat_ExportItem);

            if (!isAccess)
            {
                return(PartialView("AccessDenied"));
            }
            var service = new RestServiceClient <Sys_AutoBackupModel>();

            service.SetCookies(this.Request.Cookies, _hrm_Sys_Service);
            var result = service.Post(_hrm_Sys_Service, "api/Sys_AutoBackup/", model);

            return(Json(result));
        }
예제 #4
0
        /// <summary>
        /// [Tin.Nguyen] - Lấy dữ liệu Dân Tộc(Cat_ExportItem) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Sys_AutoBackupModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Sys_AutoBackupModel();
            ActionService service = new ActionService(UserLogin);

            var entity = service.GetById <Sys_AutoBackupEntity>(id, ref status);

            if (entity != null)
            {
                model = entity.CopyData <Sys_AutoBackupModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
예제 #5
0
        public Sys_AutoBackupModel Post([Bind] Sys_AutoBackupModel model)
        {
            #region Validate
            string message       = string.Empty;
            var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Sys_AutoBackupModel>(model, "Sys_AutoBackup", ref message);
            if (!checkValidate)
            {
                model.ActionStatus = message;
                return(model);
            }
            #endregion


            ActionService service = new ActionService(UserLogin);
            return(service.UpdateOrCreate <Sys_AutoBackupEntity, Sys_AutoBackupModel>(model));
        }