Пример #1
0
 public Rec_InterviewModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Rec_InterviewModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetByIdUseStore<Rec_InterviewEntity>(id, ConstantSql.hrm_rec_sp_get_InterviewById, ref status);//note
     if (entity != null)
     {
         model = entity.CopyData<Rec_InterviewModel>();
     }
     model.ActionStatus = status;
     return model;
 }
Пример #2
0
        public ActionResult ExportInterviewListByTemplate([DataSourceRequest] DataSourceRequest request, Rec_InterviewSearchModel model)
        {
            //return GetListDataAndReturn<Rec_InterviewModel, Rec_InterviewEntity, Rec_InterviewSearchModel>(request, model, ConstantSql.hrm_rec_sp_get_Interview);

            string status = string.Empty;
            var isDataTable = false;
            object obj = new Rec_InterviewModel();
            var services = new BaseService();
            var result = GetListData<Rec_InterviewModel, Rec_InterviewEntity, Rec_InterviewSearchModel>(request, model, ConstantSql.hrm_rec_sp_get_Interview, 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 = "Rec_InterviewModel",
                    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));

        }