示例#1
0
 /// <summary>
 /// [Son.Vo] - Lấy dữ liệu Relatives(Hre_Relatives) theo Id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Hre_RelativesModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Hre_RelativesModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetData<Hre_RelativesEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_RelativesById, ref status).FirstOrDefault();
     if (entity != null)
     {
         model = entity.CopyData<Hre_RelativesModel>();
     }
     model.ActionStatus = status;
     return model;
 }
示例#2
0
 public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Hre_RelativesModel Relatives)
 {
    
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient<Hre_RelativesModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/Hre_Relatives/", Relatives);
         //return Json(result);
         ViewBag.MsgUpdate = "Update success";
     }
     return View();
 }
示例#3
0
        public ActionResult ExportRelativesListByTemplate([DataSourceRequest] DataSourceRequest request, Hre_RelativesSearchModel model)
        {

            string status = string.Empty;
            var isDataTable = false;
            object obj = new Hre_RelativesModel();
            var actionServices = new ActionService(UserLogin);
            var result = GetListData<Hre_RelativesModel, Hre_RelativesEntity, Hre_RelativesSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_Relatives, ref status);

            if (model.IsCreateTemplateForDynamicGrid)
            {
                obj = result;
                isDataTable = false;
            }
            if (model != null && model.IsCreateTemplate)
            {

                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = obj,
                    FileName = "Hre_RelativesModel",
                    OutPutPath = path,
                    // HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = false
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            if (model.ExportId != Guid.Empty)
            {

                var fullPath = ExportService.Export(model.ExportId, result, null, model.ExportType);
                return Json(fullPath);
            }

            return Json(result.ToDataSourceResult(request));


            //return GetListDataAndReturn<Hre_RelativesModel, Hre_RelativesEntity, Hre_RelativesSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_Relatives);
        }
示例#4
0
 public ActionResult Create(Hre_RelativesModel model)
 {
   
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient<Hre_RelativesModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/Hre_Relatives/", model);
         ViewBag.MsgInsert = "Insert success";
     }
     return View();
 }