/// <summary> /// [Tho.Bui] - Lấy dữ liệu Quốc Gia(Cat_Country) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Sal_BasicSalaryModel GetById(Guid id) { string status = string.Empty; var model = new Sal_BasicSalaryModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore <Sal_BasicSalaryEntity>(id, ConstantSql.hrm_Sal_sp_get_BasicSalaryById, ref status);//note if (entity != null) { model = entity.CopyData <Sal_BasicSalaryModel>(); } model.ActionStatus = status; return(model); }
public Sal_BasicSalaryModel Post([Bind] Sal_BasicSalaryModel model) { #region Validate string message = string.Empty; var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Sal_BasicSalaryModel>(model, "Sal_BasicSalary", ref message); if (!checkValidate) { model.ActionStatus = message; return(model); } #endregion ActionService service = new ActionService(UserLogin); model.Amount = model.GrossAmount.Encrypt(); return(service.UpdateOrCreate <Sal_BasicSalaryEntity, Sal_BasicSalaryModel>(model)); }
/// <summary> /// Xử lí thay doi trang thai /// </summary> /// <param name="contract"></param> /// <returns></returns> /// public ActionResult SetStatusSelected(List <Guid> selectedIds, string status, string userApproved) { var model = new Sal_BasicSalaryModel(); if (selectedIds != null) { var service = new RestServiceClient <Sal_BasicSalaryModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Hr_Service); model.IDs = String.Join(",", selectedIds); model.Status = status; //Guid Approved = Guid.Empty; //Guid.TryParse(userApproved, out Approved); //if (Approved == Guid.Empty) //{ // model.ActionStatus = "NoPermission"; // return Json(model); //} model = service.Put(_hrm_Hr_Service, "api/Sal_BasicSalary/", model); } return(Json(model)); }
public Sal_BasicSalaryModel Put([Bind] Sal_BasicSalaryModel model) { if (!string.IsNullOrEmpty(model.IDs)) { try { model.IDs = Common.DotNetToOracle(model.IDs); BaseService service = new BaseService(); string statusMessages = string.Empty; List <object> lstObj = new List <object>(); lstObj.Add(model.IDs); lstObj.Add(model.Status); service.UpdateData <Sal_BasicSalaryModel>(lstObj, ConstantSql.hrm_sal_sp_get_BasicSalary_UpdateStatus, ref statusMessages); model.ActionStatus = statusMessages; } catch (Exception) { throw; } } return(model); }