protected void DropDownProject_SelectedIndexChanged(object sender, EventArgs e) { int id = Convert.ToInt16(DropDownProject.SelectedValue); ProjectMaster master = db.ProjectMasters.Where(m => m.Pid == id).FirstOrDefault(); HiddenField1.Value = master.ProjectId.ToString(); }
public async Task <string> StartProjectProcessingAsync(ProjectMaster projectMaster) { using (var httpClient = new HttpClient()) { httpClient.BaseAddress = Uri; httpClient.DefaultRequestHeaders.Accept.Clear(); try { var response = await httpClient.GetAsync(Uri).ConfigureAwait(true); if (response.IsSuccessStatusCode) { await response.Content.ReadAsStringAsync().ConfigureAwait(true); } } catch (Exception exception) { Console.WriteLine(exception.Message); return(exception.Message); } string status = string.Format("Project {0} has been Processed Successfully.", projectMaster.ProjectName); return(status); } }
public HttpResponseMessage InsertProjectMaster(ProjectMaster projectMaster) { var newObj = new ProjectMaster() { Id = Guid.NewGuid(), ProjectCode = projectMaster.ProjectCode, BuildProjectCode = projectMaster.BuildProjectCode, ContractorOrgCode = projectMaster.ContractorOrgCode, GeneralContractorCode = projectMaster.GeneralContractorCode, GeneralContractorName = projectMaster.GeneralContractorName, ProjectName = projectMaster.ProjectName, ProjectActivityType = projectMaster.ProjectActivityType, ProjectDescription = projectMaster.ProjectDescription, ProjectCategory = projectMaster.ProjectCategory, IsMajorProject = projectMaster.IsMajorProject, OwnerName = projectMaster.OwnerName, BuildCorporationCode = projectMaster.BuildCorporationCode, BuilderLicenceNum = projectMaster.BuilderLicenceNum, AreaCode = projectMaster.AreaCode, TotalContractAmt = projectMaster.TotalContractAmt, BuildingArea = projectMaster.BuildingArea, StartDate = projectMaster.StartDate, CompleteDate = projectMaster.CompleteDate, ProjectSource = projectMaster.ProjectSource, ProjectStatus = projectMaster.ProjectStatus }; var result = _projectMaster.InsertProjectMaster(newObj); if (result) { return(toJson(null, OperatingState.Success, "添加成功")); } return(toJson(null, OperatingState.Failure, "添加失败")); }
public ActionResult CreateNewAttendence(ProjectMaster master) { long roleId = (long)IDictionary[1].Id; return(View()); }
public async Task <int> UpdateProjectMaster(int userID, int companyid, ProjectMasterViewModel projectMasterModel) { ProjectMaster projectMaster = new ProjectMaster { Project_ID = projectMasterModel.ProjectID, User_ID = userID, Project_Name = projectMasterModel.ProjectName, Address = projectMasterModel.StreetAddress, City = projectMasterModel.City, Status_ID = projectMasterModel.ProjectStatusID != null?string.Join(",", projectMasterModel.ProjectStatusID) : string.Empty, Project_Type_ID = projectMasterModel.ProjectTypeID != null?string.Join(",", projectMasterModel.ProjectTypeID) : string.Empty, Project_Manager_id = projectMasterModel.ProjectManagerID != null?string.Join(",", projectMasterModel.ProjectManagerID) : string.Empty, Project_Group_ID = string.Join(",", projectMasterModel.ProjectGroupID), State = projectMasterModel.State, Zip = projectMasterModel.Zip, Latitude = projectMasterModel.Latitude, Longitude = projectMasterModel.Longitude, Internal_Notes = projectMasterModel.InternalNotes, Lot_Info = projectMasterModel.LotInfo, Sub_Notes = projectMasterModel.SubNotes, Project_Prefix = projectMasterModel.JobsitePrefix, Country_ID = projectMasterModel.CountryID, Permit_No = projectMasterModel.Permit, Org_ID = companyid, Contract_Price = projectMasterModel.ContractPrice }; projectMaster = await _projectMasterRepository.UpdateAsync(projectMaster); return(projectMaster.Project_ID); }
public bool ProcessMenuFile(ProjectMaster projectMaster) { try { var universeFileMenuContext = new BaseRepository <UniverseFileMenu>(); var directoryPath = Path.Combine(projectMaster.PhysicalPath, "Menu"); var allFiles = Directory.GetFiles(directoryPath, "*.csv", SearchOption.TopDirectoryOnly); var listItems = new List <UniverseFileMenu>(); foreach (var file in allFiles) { var methodBlockList = File.ReadAllLines(file, Encoding.UTF7).Skip(1).ToList(); methodBlockList.RemoveAll(l => l.Length <= 0); var stream = new StreamReader(file); var csvReader = new CsvReader(stream, true); while (csvReader.ReadNextRecord()) { listItems.Add(new UniverseFileMenu { ProjectId = projectMaster._id, ActionExecuted = csvReader[3], MenuId = csvReader[0], MenuDescription = csvReader[2] ?? "", MenuTitle = csvReader[1] }); } universeFileMenuContext.InsertMany(listItems); } return(true); } catch (Exception exception) { Console.WriteLine(exception); return(false); } }
public async Task <IHttpActionResult> Post([FromBody] ProjectMaster projectMaster) { if (!ModelState.IsValid) { return(ResponseMessage(Request.CreateResponse(HttpStatusCode.InternalServerError, ModelState))); } using (_codeVortoService = new CodeVortoService()) { var totalFiles = Directory.GetFiles(projectMaster.PhysicalPath, "*.*", SearchOption.AllDirectories).Length; projectMaster.TotalFiles = totalFiles; projectMaster.UploadedDate = DateTime.Now; projectMaster.UploadedTime = DateTime.Now; projectMaster.SolutionId = projectMaster.LanguageId; var project = await _codeVortoService.ProjectMasterRepository .AddNewItem(projectMaster).ConfigureAwait(false); if (project == null) { return(BadRequest("Project name already exist")); } return(Ok(project)); } }
//this is to delete the project public void DeleteProject(int Id) { ProjectMaster promas = _context.ProjectM.FirstOrDefault(p => p.ProjectId == Id); _context.ProjectM.Remove(promas); _context.SaveChanges(); }
public List <ProjectMaster> GetProjectNameListByParam(ProjectMaster projectMaster) { try { ISelectingCommon iDataAccessSelect = new DALGetCommonSelecting(); return(iDataAccessSelect.GetProjectNameListByParam(projectMaster)); } catch (Exception ex) { throw ex; } }
//this is to add the leader in project member table public void AddProjectmembersL(ProjectMaster promas) { Projectmembers promem = new Projectmembers(); promem.ProjectId = promas.ProjectId; promem.MemberId = promas.LeaderID; promem.ActAs = As.leader; _repocontext.AddProjectmembersL(promem); }
//this project is used to update the project public void UpdateProject(int Id, ProjectMaster promas) { ProjectMaster promaster = _context.ProjectM.FirstOrDefault(p => p.ProjectId == Id); promaster.ProjectDescription = promas.ProjectDescription; promaster.TechnologyUsed = promas.TechnologyUsed; promaster.Name = promas.Name; _context.SaveChanges(); }
public IActionResult Edit(ProjectMaster projectMaster) { if (ModelState.IsValid) { lowCostHousingDBcontext.Update <ProjectMaster>(projectMaster); lowCostHousingDBcontext.SaveChanges(); return(RedirectToAction("Index")); } return(View()); }
public void WrongType() { ProjectMaster master = ProjectMasterHelper.CreateDefaultProject(); string xml = SerializationHelper.SerializeToString(master); Assert.That(xml, Is.StringContaining("Hierarchy.xml")); Assert.Throws <InvalidOperationException>(() => SerializationHelper.DeserializeFromString <ProjectHierarchy>(xml)); }
/// <summary> /// Delete the ProjectMaster /// </summary> /// <param name="projectMaster"></param> /// <returns></returns> public bool DeleteProjectMaster(ProjectMaster projectMaster) { if (projectMaster == null) { throw new ArgumentException("projectMaster is null"); } bool result = _projectMaster.Delete(projectMaster); return(result); }
public bool ValidateDirStructure(ProjectMaster projectMaster) { var allDirectories = Directory.GetDirectories(projectMaster.PhysicalPath).ToList(); var requiredDirectories = new List <string> { "Menu", "I-Descriptors" }; var directoryNames = (from d in allDirectories let dir = new DirectoryInfo(d) select dir.Name).ToList(); bool isPresent = requiredDirectories.All(d => directoryNames.Any(r => r == d)); return(isPresent); }
/// <summary> /// Insert the ProjectMaster /// </summary> /// <param name="projectMaster"></param> /// <returns></returns> public bool InsertProjectMaster(ProjectMaster projectMaster) { if (projectMaster == null) { throw new ArgumentNullException("projectMaster is null"); } bool result = _projectMaster.Insert(projectMaster); return(result); }
/// <summary> /// Updates the ProjectMaster /// </summary> /// <param name="projectMaster"></param> /// <returns></returns> public bool UpdateProjectMaster(ProjectMaster projectMaster) { if (projectMaster == null) { throw new ArgumentNullException("projectMaster is null"); } bool result = _projectMaster.SingleUpdate(projectMaster); return(result); }
public static EditorModel CreateNewModel() { EditorModel model = new EditorModel { Filename = "Project.xml", EquipmentHierarchy = new Hierarchy(), Project = ProjectMaster.NewProject() }; return(model); }
public HttpResponseMessage UpdatePayRollDetai(ProjectMaster projectMaster) { if (projectMaster.Id == Guid.Empty) { return(toJson(null, OperatingState.Failure, "Id不能为空")); } var obj = _projectMaster.GetProjectMasterById(projectMaster.Id); if (projectMaster.ProjectSource == null) { projectMaster.ProjectSource = obj.ProjectSource; } if (projectMaster.BuildProjectCode == null) { projectMaster.BuildProjectCode = obj.BuildProjectCode; } if (projectMaster.StartDate == null) { projectMaster.StartDate = obj.StartDate; } if (projectMaster.CompleteDate == null) { projectMaster.CompleteDate = obj.CompleteDate; } if (projectMaster.ProjectCode == null) { projectMaster.ProjectCode = obj.ProjectCode; } if (projectMaster.ContractorOrgCode == null) { projectMaster.ContractorOrgCode = obj.ContractorOrgCode; } if (projectMaster.ProjectName == null) { projectMaster.ProjectName = obj.ProjectName; } if (projectMaster.ProjectActivityType == null) { projectMaster.ProjectActivityType = obj.ProjectActivityType; } if (projectMaster.ProjectDescription == null) { projectMaster.ProjectDescription = obj.ProjectDescription; } var result = _projectMaster.UpdateProjectMaster(projectMaster); if (result) { return(toJson(null, OperatingState.Success, "修改成功")); } return(toJson(null, OperatingState.Failure, "修改失败")); }
public List <ProjectMaster> GetProjectNameListByParam(ProjectMaster projectMaster) { var list = new List <ProjectMaster>(); try { list = _CommonManager.GetProjectNameListByParam(projectMaster); } catch (Exception ex) { } return(list); }
public void ProcessUniVerseJclFiles(ProjectMaster projectMaster) { var fileMasterRepository = new BaseRepository <FileMaster>(); var filter = fileMasterRepository.Filter.Eq(f => f.FileTypeReference.FileTypeName, "Jcl") & fileMasterRepository.Filter.Eq(f => f.ProjectId, projectMaster._id); var jclFiles = fileMasterRepository.FindWithLookup(filter).ToList(); foreach (var fileMaster in jclFiles) { var fileLines = File.ReadAllLines(fileMaster.FilePath); var lineDetails = UniVerseBasicUtils.UniVerseUtils.RemoveCommentedAndBlankLines(fileLines); lineDetails.PrintToConsole(); } }
/// <summary> /// The SaveProject /// </summary> /// <param name="ProjectMaster">The ProjectMaster<see cref="ProjectMaster"/></param> /// <returns>The <see cref="int"/></returns> public int SaveProject(ProjectMaster ProjectMaster) { try { using (var _context = new DatabaseContext()) { _context.ProjectMaster.Add(ProjectMaster); return(_context.SaveChanges()); } } catch (Exception) { throw; } }
public ActionResult <IEnumerable <ProjectMaster> > Post(ProjectMaster projectMaster) { //Validate Model Fields //Check for Duplicate if (ModelState.IsValid) { _context.ProjectMaster.Add(projectMaster); _context.SaveChanges(); return(CreatedAtAction("Get", new { id = projectMaster.Id }, projectMaster)); } else { return(BadRequest()); } }
public void ProcessUniVerseDataDictionary(ProjectMaster projectMaster) { var fileMasterRepository = new BaseRepository <FileMaster>(); var filter = fileMasterRepository.Filter.Eq(f => f.FileTypeReference.FileTypeName, "Entity") & fileMasterRepository.Filter.Eq(f => f.ProjectId, projectMaster._id); var entityFiles = fileMasterRepository.FindWithLookup(filter).ToList(); foreach (var fileMaster in entityFiles) { var modifiedPath = ReplaceContentsForEscapeChar(fileMaster.FilePath, fileMaster.FileTypeReference.Delimiter ?? ','); Console.WriteLine(modifiedPath); PrepareDataDictionary(fileMaster, modifiedPath); File.Delete(modifiedPath); } }
public static ProjectMaster NewProject() { ProjectMaster project = new ProjectMaster { Equipment = new EquipmentDefinition { Hierarchy = new ProjectHierarchy { format = ProjectFileFormat.Excel, href = "Hierarchy.xlsx" } } }; return(project); }
private void _callGenCode() { string err = validData(); if (err != null) { MessageBox.Show(err); return; } connector.Catalog = txtCatalog.Text; //ProjectMaster projectMaster = new ProjectMaster(connector.ConnectionString, txtNamesSpace.Text, txtDirectory.Text); ProjectMaster.createProject(connector.ConnectionString, txtNamesSpace.Text, txtDirectory.Text); ProjectMaster.Instance.genTable(); //projectMaster.genTable(); }
public ActionResult Add(ProjectMaster ProjectMaster) { if (ModelState.IsValid) { var result = _IProject.SaveProject(ProjectMaster); if (result > 0) { TempData["ProjectMessage"] = "Project Added Successfully"; ModelState.Clear(); return(RedirectToAction("Add")); } } return(View(ProjectMaster)); }
public static ProjectMaster NewProject() { ProjectMaster project = new ProjectMaster { Equipment = new EquipmentDefinition { Hierarchy = new ProjectHierarchy { format = ProjectFileFormat.Excel, href = "Hierarchy.xlsx" } } }; return project; }
public static ProjectMaster CreateDefaultProject() { ProjectMaster master = new ProjectMaster { Equipment = new EquipmentDefinition() { Hierarchy = new ProjectHierarchy() { href = "Hierarchy.xml" } } }; Assert.That(master.Equipment.Hierarchy.href, Is.Not.Null); return(master); }
//method for addition of project public void AddProject(ProjectMaster projectmas) { int count = 0; List <ProjectMaster> prolist = _repocontext.GetAllProjects(); foreach (ProjectMaster pro in prolist) { if (pro.Name == projectmas.Name) { count++; throw new Exception("already exist"); } } if (count == 0) { _repocontext.AddNewProject(projectmas); } }
public IActionResult Put(int id, [FromBody] ProjectMaster value) { try { _service.UpdateProject(id, value); return(Ok()); } catch (TimeoutException e) { Console.WriteLine(e.StackTrace); return(StatusCode(102)); } catch (Exception e) { Console.WriteLine(e.StackTrace); return(StatusCode(500)); } }