public SigmaResultType ImportFile() { SigmaResultType result = new SigmaResultType(); try { var queryStr = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.QueryParameters; string fileType = queryStr["filetype"]; string filePath = queryStr["filepath"]; //string rootPath = System.Web.Configuration.WebConfigurationManager.AppSettings["DocumentUpload"]; //string targetPath = System.Web.Configuration.WebConfigurationManager.AppSettings["DocumentFolderRoot"]; string rootPath = ConfigMgr.GetImportFilePath(); filePath = rootPath + filePath; //fileType = "DrawingImage"; // ImportFile switch (fileType) { case "Drawing": //importDrawing importDrawing = new ImportDrawing(); ImportDrawingMgr importDrawing = new ImportDrawingMgr(); result = importDrawing.AddDrawing(filePath, ConfigMgr.GetExportFilePath()); break; case "DrawingImage": //ImportDrawing importDrawingImage = new ImportDrawing(); ImportDrawingMgr importDrawingImage = new ImportDrawingMgr(); //result = importDrawingImage.AddDrawingImage(filePath, targetPath); result = importDrawingImage.AddDrawingImage(filePath, ConfigMgr.GetTargetPath()); break; case "MTO": ImportMgr importMgr = new ImportMgr(); result = importMgr.ImportMTOFromExcel(filePath, ConfigMgr.GetExportFilePath()); break; case "CostCode": CostCodeMgr costcodeMgr = new CostCodeMgr(); result = costcodeMgr.ImportCostCodeFromExcel(filePath, ConfigMgr.GetExportFilePath()); break; case "ProjectCostCode": CostCodeMgr projectcostcodeMgr = new CostCodeMgr(); result = projectcostcodeMgr.ImportProjectCostCodeFromExcel(filePath, ConfigMgr.GetExportFilePath()); break; case "ClientCostCode": CostCodeMgr clientcostcodeMgr = new CostCodeMgr(); result = clientcostcodeMgr.ImportClientCostCodeFromExcel(filePath, ConfigMgr.GetExportFilePath()); break; case "HR": PersonnelMgr personnelMgr = new PersonnelMgr(); result = personnelMgr.ImportPersonnelFromExcel(filePath, ConfigMgr.GetExportFilePath()); break; case "User": SigmaUserMgr sigmauserMgr = new SigmaUserMgr(); result = sigmauserMgr.ImportSigmaUserFromExcel(filePath, ConfigMgr.GetExportFilePath()); break; case "MeterialLibrary": ImportMgr importMeterial = new ImportMgr(); result = importMeterial.ImportMeterialLib(filePath, ConfigMgr.GetExportFilePath()); break; case "EquipmentLibrary": ImportMgr importEquipment = new ImportMgr(); result = importEquipment.ImportEquipmentLib(filePath, ConfigMgr.GetExportFilePath()); break; case "ConsumableLibrary": ImportMgr importConsumable = new ImportMgr(); result = importConsumable.ImportConsumableLib(filePath, ConfigMgr.GetExportFilePath()); break; case "DrawingType": ImportMgr importDrawingType = new ImportMgr(); result = importDrawingType.ImportDrawingTypeLib(filePath, ConfigMgr.GetExportFilePath()); break; default: break; } return result; } catch (Exception ex) { // Log Exception ExceptionHelper.logException(ex); result.IsSuccessful = false; result.ErrorMessage = ex.Message; return result; } }
public SigmaResultType MultiPersonnel(List<TypePersonnel> listObj) { SigmaResultType result = new SigmaResultType(); try { PersonnelMgr personnelMgr = new PersonnelMgr(); result = personnelMgr.MultiPersonnel(listObj); return result; } catch (Exception ex) { // Log Exception ExceptionHelper.logException(ex); result.IsSuccessful = false; result.ErrorMessage = ex.Message; return result; } }
public SigmaResultType ListPersonnel() { SigmaResultType result = new SigmaResultType(); try { var queryStr = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.QueryParameters; string max = queryStr["max"]; string offset = queryStr["offset"]; List<string> s_option = new List<string>(); List<string> s_key = new List<string>(); s_option.Add("@FirstName"); s_option.Add("@LastName"); s_option.Add("@Company"); s_key.Add(queryStr["FirstName"]); s_key.Add(queryStr["LastName"]); s_key.Add(queryStr["Company"]); string o_option = queryStr["o_option"]; string o_desc = queryStr["o_desc"]; PersonnelMgr personnelMgr = new PersonnelMgr(); result = personnelMgr.ListPersonnel(offset, max, s_option, s_key, o_option, o_desc); return result; } catch (Exception ex) { // Log Exception ExceptionHelper.logException(ex); result.IsSuccessful = false; result.ErrorMessage = ex.Message; return result; } }
public SigmaResultType AddPersonnel(TypePersonnel objPersonnel) { SigmaResultType result = new SigmaResultType(); try { PersonnelMgr personnelMgr = new PersonnelMgr(); result = personnelMgr.AddPersonnel(objPersonnel); return result; } catch (Exception ex) { // Log Exception ExceptionHelper.logException(ex); result.IsSuccessful = false; result.ErrorMessage = ex.Message; return result; } }
public SigmaResultType GetPersonnel(string personnelId) { SigmaResultType result = new SigmaResultType(); try { PersonnelMgr personnelMgr = new PersonnelMgr(); result = personnelMgr.GetPersonnel(personnelId); return result; } catch (Exception ex) { // Log Exception ExceptionHelper.logException(ex); result.IsSuccessful = false; result.ErrorMessage = ex.Message; return result; } }