private bool GetIsBiddingJob(int estRevID) { //Is Bidding Job var estRev = _db.Sales_JobMasterList_EstRev.Find(estRevID); var job = new SpecProjectDetail(estRev.JobID); return(job.IsBidTo); }
public void Authorization(int estRevID) { var employeesEnabledSpecificationTemplateEdit = new int[] { 12, 28, 8, 93 }; var employeesEnabledCostTemplateEdit = new int[] { 12, 28, 8, 93 }; Value.IsAuthorized = false; Value.IsResponseOwner = false; Value.IsRequestOwner = false; Value.IsLocked = false; Value.IsSpecificationTemplateEditEnabled = false; Value.IsCostTemplateEditEnabled = false; var role = new EmployeeRole(Value.EmployeeID); if (role.IsInRoles(FsMembershipAuthorizationArray.PageEstimationEstimatorOnlyControlsEnabled)) { Value.IsAuthorized = true; Value.IsResponseOwner = true; } if (role.IsInRoles(FsMembershipAuthorizationArray.PageEstimationModifyContentsEnabled)) { Value.IsAuthorized = true; Value.IsRequestOwner = true; } // if (!Value.IsRequestOwner) return; Value.EstRevID = estRevID; var est = _db.Sales_JobMasterList_EstRev.Find(estRevID); Value.ProjectID = est.JobID; var job = new SpecProjectDetail(est.JobID); if (Value.EmployeeID != job.Sales && Value.EmployeeID != job.Sa1ID) { Value.IsRequestOwner = false; } if (Value.EmployeeID == 12 || Value.EmployeeID == 28) { Value.IsRequestOwner = true; Value.IsResponseOwner = true; } // Value.IsSpecificationTemplateEditEnabled = employeesEnabledSpecificationTemplateEdit.Contains(Value.EmployeeID); Value.IsCostTemplateEditEnabled = employeesEnabledCostTemplateEdit.Contains(Value.EmployeeID); _db.Entry(Value).State = EntityState.Modified; _db.SaveChanges(); }
public static string GetFilePath(int estRevID, string folderPath) { var est = new MyEstRev(estRevID); var p = new SpecProjectDetail(est.Value.JobID); string jobNumber = p.JobNumber; folderPath += jobNumber + "\\"; if ((!System.IO.Directory.Exists(folderPath))) { System.IO.Directory.CreateDirectory(folderPath); } return(folderPath); }