Ejemplo n.º 1
0
        /// <summary>
        /// Tạo mời một AttInOut
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult Add([Bind] Hre_AccidentModel model)
        {
            //var isAccess = CheckPermission(UserId, PrivilegeType.Create, ConstantPermission.Hre_Accident);
            //if (!isAccess)
            //{
            //    return PartialView("AccessDenied");
            //}
            var service = new RestServiceClient <Hre_AccidentModel>(UserLogin);

            service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
            var result = service.Put(_hrm_Hr_Service, "api/Hre_Accident/", model);

            return(Json(result));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// [Chuc.Nguyen] - Lấy dữ liệu bảng Tai Nạn(Hre_Accident) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Hre_AccidentModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Hre_AccidentModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Hre_AccidentEntity>(id, ConstantSql.hrm_hr_sp_get_AccidentById, ref status);

            //var entity = service.GetData<Hre_AccidentEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_AccidentById, ref status).FirstOrDefault();
            if (entity != null)
            {
                model = entity.CopyData <Hre_AccidentModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
Ejemplo n.º 3
0
        public Hre_AccidentModel Post([Bind] Hre_AccidentModel model)
        {
            #region Validate

            string message       = string.Empty;
            var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Hre_AccidentModel>(model, "Hre_Accident", ref message);
            if (!checkValidate)
            {
                model.ActionStatus = message;
                return(model);
            }

            #endregion
            ActionService service = new ActionService(UserLogin);
            return(service.UpdateOrCreate <Hre_AccidentEntity, Hre_AccidentModel>(model));
        }
Ejemplo n.º 4
0
 public ActionResult Create(Hre_AccidentModel model)
 {
     //var isAccess = CheckPermission(UserId, PrivilegeType.Create, ConstantPermission.Hre_Accident);
     //if (!isAccess)
     //{
     //    return PartialView("AccessDenied");
     //}
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient <Hre_AccidentModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/Hre_Accident/", model);
         ViewBag.MsgInsert = ConstantDisplay.HRM_HR_Accident_InsertSuccess.TranslateString();
     }
     return(View());
 }
Ejemplo n.º 5
0
 public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Hre_AccidentModel Accident)
 {
     //var isAccess = CheckPermission(UserId, PrivilegeType.Modify, ConstantPermission.Hre_Accident);
     //if (!isAccess)
     //{
     //    return PartialView("AccessDenied");
     //}
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient <Hre_AccidentModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/Hre_Accident/", Accident);
         //return Json(result);
         ViewBag.MsgUpdate = ConstantDisplay.HRM_HR_Accident_UpdateSuccess.TranslateString();
     }
     return(View());
 }