private void btnSave_Click(object sender, RoutedEventArgs e) { ProjectDAL prjDAL = new ProjectDAL(); participationDAL pariDAL = new participationDAL(); Employee[] employeesToInsert = (Employee[])datagrid.ItemsSource; for (int i = 0; i < employeesToInsert.Length; i++) { if (employeesToInsert[i].IsSelected) { if (prjDAL.IsParticipatorExisted(prj, employeesToInsert[i])) { continue; } else { prjDAL.insertEmployeeToPrj(prj, employeesToInsert[i]); } } } prj.costinwage = prjDAL.costInWage(prj) * prjDAL.countPeriod(prj); prjDAL.updatePrj(prj); DialogResult = true; }
public ActionResult Create(ProjectViewModel modelJobBilling) { try { if (ModelState.IsValid) { modelJobBilling.JobSites.JobSitePhone = DataAccess.Entity.Common.FormatPhoneText(modelJobBilling.JobSites.JobSitePhone); modelJobBilling.JobSites.JobSiteMobilePhone = DataAccess.Entity.Common.FormatPhoneText(modelJobBilling.JobSites.JobSiteMobilePhone); modelJobBilling.JobSites.JobSiteFax = DataAccess.Entity.Common.FormatPhoneText(modelJobBilling.JobSites.JobSiteFax); var result = ProjectDAL.saveJobSiteInformation(modelJobBilling.JobSites); if (result <= 0) { ModelState.AddModelError(String.Empty, BusinessConstants.duplicateRecord); LoadProjectCombos(); return(View()); } } else { ModelState.AddModelError(String.Empty, BusinessConstants.duplicateRecord); LoadProjectCombos(); return(View()); } return(View()); } catch (Exception ex) { LoadProjectCombos(); ModelState.AddModelError(String.Empty, BusinessConstants.contactAdmin); return(View(modelJobBilling)); } }
public void TestUpdateProject() { ProjectDAL objProjectDAL = new ProjectDAL(); ProjectInfo objProjectInfo = new ProjectInfo(504, "HR Application", "HR Management System", "Abridge", DateTime.Now, DateTime.Now, 101, DateTime.Now, 101, DateTime.Now); objProjectDAL.UpdateProject(objProjectInfo); }
public ActionResult JobChecklist(string PRJID) { if (!string.IsNullOrWhiteSpace(PRJID)) { Session["PRJID"] = PRJID; } if (!string.IsNullOrWhiteSpace((string)Session["CommID"]) && Session["PRJID"] != null && Convert.ToInt32(Session["PRJID"]) > 0) { ViewBag.Title = string.Format("{0}", Session["PRJID"]); var id = Convert.ToInt32(Session["PRJID"]); var model = new JobActivationChecklistModel(); if (id > 0) { model.PRJID = id; model = ProjectDAL.getProjectActivationDetails(model); LoadActivationLookup(model); } return(View(model)); } else { return(RedirectToAction("index", "home")); } }
public void LoadActivationLookup(JobActivationChecklistModel model) { model = ProjectDAL.JobActivationLookup(model); IEnumerable <SelectListItem> ListCustomersType = model.ListCustomersType.Select(c => new SelectListItem { Value = Convert.ToString(c.CustomerTypeId), Text = c.Description }); ViewBag.ListCustomersType = ListCustomersType; IEnumerable <SelectListItem> ListJobType = model.ListJobTypes.Select(c => new SelectListItem { Value = Convert.ToString(c.JobTypeId), Text = c.JobTypeDesc }); ViewBag.ListJobType = ListJobType; IEnumerable <SelectListItem> ListResponses = model.ListResponses.Select(c => new SelectListItem { Value = Convert.ToString(c.ResponseId), Text = c.Response }); ViewBag.ListResponses = ListResponses; }
public ActionResult selectheight(string bid = "0") { if (!string.IsNullOrWhiteSpace((string)Session["CommID"]) && Session["PRJID"] != null && Convert.ToInt32(Session["PRJID"]) > 0) { LoadComboForHeight(); if (!string.IsNullOrWhiteSpace(bid) && bid != "0") { Session["BidId"] = bid; } else { bid = Convert.ToString(Session["BidId"]); } if (Session["BidId"] == null || bid != Convert.ToString(Session["BidId"])) { Session["BidId"] = bid; } int BidId = 0; BID01_Headers model = new BID01_Headers(); if (!string.IsNullOrWhiteSpace(bid)) { BidId = Convert.ToInt32(bid); model = ProjectDAL.SelectHeightByBid(BidId); Session["BIDMATID"] = model.BIDMatHeaderID; } return(View("detail/selectheight", model)); } else { return(Redirect("index")); } }
private void BTA_AddProject_Load(object sender, EventArgs e) { //Loading Projects into the DAta grid view ProjectDAL dal = new ProjectDAL(); DataTable dt = dal.Select_Project(); dataGridView_Projects.DataSource = dt; }
public ActionResult aiabilling(string id) { ViewBag.UOMTypes = new SelectList(Atlas.DataAccess.Entity.Common.getUnitofMeasure(), "UnitOfMeasure", "UomDescription"); //ar BidItems = ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)).Select(i=>i.BidItemId); ViewBag.BidItems = new SelectList(ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)), "BidItemId", "BidItemId"); //ViewBag.BidItems = new SelectList(BidItems, "BidItemId", "BidItemId"); return(View("billing/aiabilling")); }
public JsonResult RemoveRecord(int id, string section, string idName) { int result = -2; { result = ProjectDAL.RemoveLabourSectionRow(id, section, idName); } return(Json(result)); }
public void CheckProjectById() { ProjectDAL pobj = new ProjectDAL(); var p = pobj.GetProjectById(1); Assert.AreEqual(p.Project_Id, 1); Assert.AreEqual(p.Project_Name, "Exotics"); Assert.AreEqual(p.Priority, 1); }
public void ValidateProjectById() { ProjectDAL pobj = new ProjectDAL(); var p = pobj.GetProjectById(1); Assert.AreEqual(p.Project_Id, 1); Assert.AreEqual(p.Project_Name, "My Project"); Assert.AreEqual(p.Priority, 5); }
public void FindProjectById() { ProjectDAL pobj = new ProjectDAL(); var p = pobj.GetProjectById(1); Assert.AreEqual(p.Project_Id, 1); Assert.AreEqual(p.Project_Name, "Fiosd"); Assert.AreEqual(p.Priority, 7); }
public JsonResult saveEquipments(List <BID09_EquipmentBurden> EquipmentBurden) { int result = -2; { EquipmentBurden = ProjectDAL.saveEquipmentBurden(EquipmentBurden); } return(Json(EquipmentBurden)); }
public JsonResult saveotherCosts(List <BID08_OtherCosts> OtherCostsDetails) { int result = -2; { OtherCostsDetails = ProjectDAL.saveOtherCostsDetails(OtherCostsDetails); } return(Json(OtherCostsDetails)); }
public JsonResult saveCrewSize(List <BID06_CrewProfile> CrewProfile) { int result = -2; { CrewProfile = ProjectDAL.saveCrewProfile(CrewProfile); } return(Json(CrewProfile)); }
public JsonResult saveConcrete(List <BID07_Concrete> ConcreteDetails) { int result = -2; { ConcreteDetails = ProjectDAL.saveConcrete(ConcreteDetails); } return(Json(ConcreteDetails)); }
public JsonResult saveMainLabor(List <LabourDetails> labourDetails) { int result = -2; { labourDetails = ProjectDAL.saveMainLabour(labourDetails); } return(Json(labourDetails)); }
public JsonResult GetUOMDesc(string id) { string uom = ""; { uom = ProjectDAL.getUOMDesc(id); } return(Json(uom)); }
private void Window_Loaded(object sender, RoutedEventArgs e) { ProjectDAL prjDAL = new ProjectDAL(); colRankId.ItemsSource = new RankDAL().ListAll(); colDepartmentId.ItemsSource = new DepartmentDAL().ListAll(); loadAllParticipators(); gridPrj.DataContext = prj; txtPeriod.Text = prjDAL.countPeriod(prj).ToString(); }
public ActionResult CreateKPI() { KPIVM kpi = new KPIVM(); kpi.Assignments = Mapper.Map <List <AssignmentVM> >(AssignmentDAL.ReadAssignments()); kpi.Projects = Mapper.Map <List <ProjectVM> >(ProjectDAL.ReadProjects()); kpi.Sprints = Mapper.Map <List <SprintVM> >(SprintDAL.ReadSprints()); kpi.Stories = Mapper.Map <List <StoryVM> >(StoryDAL.ReadStorys()); return(View(kpi)); }
public ActionResult getCompanyAddressDetails(string companyId) { SAL01_Company company = new SAL01_Company(); if (!string.IsNullOrWhiteSpace(companyId)) { company = ProjectDAL.getCompanyAddressDetails(companyId); } return(Json(company)); }
public void TestGetProjectList() { ProjectDAL objProjectDAL = new ProjectDAL(); DataTable objDT = objProjectDAL.GetProjectList(); foreach (DataRow row in objDT.Rows) { Console.WriteLine(row[0].ToString()); } }
public void GetProjectById() { ProjectDAL pobj = new ProjectDAL(); var p = pobj.GetProjectById(2); Assert.AreEqual(p.Project_Id, 2); Assert.AreEqual(p.Project_Name, "HR Project"); Assert.AreNotEqual(p.Project_Name, "Admin Project"); Assert.AreEqual(p.Priority, 16); }
public ActionResult saveAiabilling(AIABilling modelBilling) { int id = modelBilling.PRJID; try { modelBilling.NetChangeByCO = Convert.ToDecimal(modelBilling.NetChangeByCO); modelBilling.OriginalContractSum = Convert.ToDecimal(modelBilling.OriginalContractSum); modelBilling.UnitPrice = Convert.ToDecimal(modelBilling.UnitPrice).ToString(); if (ModelState.IsValid) { if (!string.IsNullOrWhiteSpace(Convert.ToString(modelBilling.PRJID)) && Convert.ToInt32(modelBilling.PRJID) > 0) { var ResultId = AdminDal.saveAiaBilling(modelBilling); if (ResultId > 0) { return(RedirectToAction("billing", "admin")); } else { ViewBag.UOMTypes = new SelectList(Atlas.DataAccess.Entity.Common.getUnitofMeasure(), "UnitOfMeasure", "UomDescription"); //ar BidItems = ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)).Select(i=>i.BidItemId); ViewBag.BidItems = new SelectList(ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)), "BidItemId", "BidItemId"); ModelState.AddModelError("", BusinessConstants.ValidateEntries); return(View("billing/aiabilling", modelBilling)); } } else { ViewBag.UOMTypes = new SelectList(Atlas.DataAccess.Entity.Common.getUnitofMeasure(), "UnitOfMeasure", "UomDescription"); //ar BidItems = ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)).Select(i=>i.BidItemId); ViewBag.BidItems = new SelectList(ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)), "BidItemId", "BidItemId"); ModelState.AddModelError("", "Project cannot be saved! Please try again"); return(View("billing/aiabilling", modelBilling)); } } else { ViewBag.UOMTypes = new SelectList(Atlas.DataAccess.Entity.Common.getUnitofMeasure(), "UnitOfMeasure", "UomDescription"); //ar BidItems = ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)).Select(i=>i.BidItemId); ViewBag.BidItems = new SelectList(ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)), "BidItemId", "BidItemId"); ModelState.AddModelError("", BusinessConstants.ValidateEntries); return(View("billing/aiabilling", modelBilling)); } } catch (Exception e) { ViewBag.UOMTypes = new SelectList(Atlas.DataAccess.Entity.Common.getUnitofMeasure(), "UnitOfMeasure", "UomDescription"); //ar BidItems = ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)).Select(i=>i.BidItemId); ViewBag.BidItems = new SelectList(ProjectDAL.GetBidItemsByProject(Convert.ToInt32(id)), "BidItemId", "BidItemId"); Logger.SaveErr(e); ModelState.AddModelError("", BusinessConstants.contactAdmin); return(View("billing/aiabilling", modelBilling)); } }
/// <summary> /// Bind project dropdown. /// </summary> private void BindProjectsDropDown() { ProjectDAL projectDAL = new ProjectDAL(); DataTable dtProjects = projectDAL.GetAllProjects(); ddlProject.DataSource = dtProjects; ddlProject.DataTextField = "ProjectName"; ddlProject.DataValueField = "ProjectId"; ddlProject.DataBind(); ddlProject.Items.Insert(0, new ListItem("Select", "0")); }
public ActionResult UpdateKPI(string id) { KPIVM kpi = new KPIVM(); kpi = Mapper.Map <KPIVM>(KPI_DAL.ReadKPIById(id)); kpi.Stories = Mapper.Map <List <StoryVM> >(StoryDAL.ReadStorys()); kpi.Projects = Mapper.Map <List <ProjectVM> >(ProjectDAL.ReadProjects()); kpi.Sprints = Mapper.Map <List <SprintVM> >(SprintDAL.ReadSprints()); kpi.Assignments = Mapper.Map <List <AssignmentVM> >(AssignmentDAL.ReadAssignments()); return(View(kpi)); }
public static string insertProject(ProjectBO objProject) { if (!objProject.ProjectName.Equals("")) { return(ProjectDAL.insertProject(objProject)); } else { return(null); } }
protected void SaveProject() { Project newProject = new Project(); newProject.ProjectName = txtName.Text; newProject.Description = txtDesc.Text; newProject.Creator = GetLoggedUser(); newProject.CreateDate = System.DateTime.Now; ProjectDAL newDal = new ProjectDAL(); newDal.SaveProject(newProject); }
public ActionResult saveJobSiteDetails(PRJ01_Headers JobDetails) { JobDetails.CommID = (string)Session["CommID"]; var result = ProjectDAL.saveJobStatus(JobDetails); if (result > 0) { Session["PRJID"] = result; Session["JobStatusId"] = JobDetails.JobStatusId; } return(Json(result)); }
public ActionResult saveJobSitesInfo(PRJ04_JobSites JobSites) { int result = -2; if (!string.IsNullOrWhiteSpace(Convert.ToString(Session["CommID"]))) { JobSites.JobSitePhone = DataAccess.Entity.Common.FormatPhoneText(JobSites.JobSitePhone); JobSites.JobSiteMobilePhone = DataAccess.Entity.Common.FormatPhoneText(JobSites.JobSiteMobilePhone); JobSites.JobSiteFax = DataAccess.Entity.Common.FormatPhoneText(JobSites.JobSiteFax); result = ProjectDAL.saveJobSiteInformation(JobSites); } return(Json(result)); }