private void BindGridViewProjects() { ProjectBusinessLogic projectBusinessLogic = new ProjectBusinessLogic(); this.gridViewProjects.DataSource = projectBusinessLogic.GetAll(); this.gridViewProjects.DataBind(); }
public string UpdateProject(ProjectModel requestObj, string selectedUsers) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); obj.UpdateProject(requestObj, selectedUsers); return("Hello World"); }
public void GetUsersWithAccessForProject(string projectId) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetUsersWithAccessForProject(projectId); hdnUsersWithAccess.Value = result; }
private void BindData(string projectID) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetProjectDetailsById(projectID); if (result != null) { lbalActualEnd.Text = result.ActualEndDate; lblActualStart.Text = result.ActualStartDate; lblAddress.Text = result.Address; lblEstimate.Text = result.ProjectEstimate; lblExpectedEnd.Text = result.EstimatedEndDate; lblExpectedStart.Text = result.EstimatedStartDate; lblName.Text = result.ProjectName; lblOtherContact1Name.Text = result.Contact1Name; lblOtherContact1Number.Text = result.Contact1number; lblOtherContact2Name.Text = result.Contact2Name; lblOtherContact2Number.Text = result.Contact2Number; lblOtherContact3Name.Text = result.Contact3Name; lblOtherContact3Number.Text = result.Contact3Number; lblPinCode.Text = result.PinCode; lblPrimaryContactName.Text = result.PrimaryContactName; lblPrimaryContactNumber.Text = result.PrimaryNumber; } //var tasks = obj.GetAllProjectTasksByProjectd(projectID); //grdFollowUp.DataSource = tasks; //grdFollowUp.DataBind(); }
public string DeleteTask(int taskId) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.DeleteProjectTask(taskId); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public string GetCompleteProjectDetailWithTasks(string projectId) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetCompleteProjectDetailWithTasks(projectId); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public string GetAllProjectTasksByPhasesId(string phaseId) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetAllProjectTasksByPhasesId(phaseId); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public string GetAllProjectIncome(string pageNumber, string searchTerm, string fromDate, string toDate) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetAllProjectIncome(pageNumber, searchTerm, fromDate, toDate); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public string GetAllExpenseCategory() { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetAllExpenseCategory(); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public bool SaveProjectIncome(string projectId, string phase, string incomeDate, string comments, string name, string amount) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.SaveProjectIncome(projectId, phase, incomeDate, "0", comments, name, amount); //var json = new JavaScriptSerializer().Serialize(result); return(result); }
public ProjectsDataController(IRepository <ProjectBase> ObjectOfProjectRepository, EUow ObjectOfUnitOfWork) { //set unit of work with connection string to connect to database _ObjectUnitOfWork = ObjectOfUnitOfWork; ObjectOfProjectRepository.SetUnitWork(_ObjectUnitOfWork); _objectOfProjectRepository = ObjectOfProjectRepository; _ObjectOfProjectBusinessLogic = new ProjectBusinessLogic(_objectOfProjectRepository); }
public string GetStartAndEndDateByTaskId(string taskId) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetStartAndEndDateByTaskId(taskId); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public string GetAllProjectExpenses(string pageNumber, string searchTerm, string category) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetAllProjectExpenses(pageNumber, searchTerm, category); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public string DeleteIncome(int incomeId) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.DeleteProjectIncome(incomeId); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public bool SaveProjectExpense(string projectId, string phase, string category, string expenseDate, string comments, string name, string amount, int expenseID) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); bool result = false; result = obj.SaveProjectExpense(projectId, phase, category, expenseDate, "0", comments, name, amount, expenseID); //var json = new JavaScriptSerializer().Serialize(result); return(result); }
public string GetProjectIncomeReport(string pageNumber, string searchTerm, string fromDate, string toDate) { ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetProjectIncomeExcel(pageNumber, searchTerm, fromDate, toDate); var directory = HttpContext.Current.Server.MapPath("~/"); var filename = Path.Combine(directory, "Download", "ProjectIncome.xlsx"); File.WriteAllBytes(filename, result); return(new JavaScriptSerializer().Serialize(filename)); }
protected void btnDelete_Click(object sender, EventArgs e) { ProjectBusinessLogic projectBusinessLogic = new ProjectBusinessLogic(); Project project = projectBusinessLogic.GetByID(Convert.ToInt32(HfDeleteID.Value)); projectBusinessLogic.Delete(project); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "delHideModalScript", Util.GetScriptToHideModalDialog("deleteModal"), false); BindGridViewProjects(); }
protected Project GetCurrentProjet() { if (string.IsNullOrWhiteSpace(this.dDListProjects.SelectedValue)) { return(null); } int projectID = Convert.ToInt32(this.dDListProjects.SelectedValue); ProjectBusinessLogic projectBusinessLogic = new ProjectBusinessLogic(); Project project = projectBusinessLogic.GetByID(projectID); return(project); }
public string MarkProjectAsCompleted(string projectId) { UserModel objUser = new UserModel(); string userID = string.Empty; if (HttpContext.Current.Session["User"] != null) { objUser = (UserModel)Session["User"]; userID = objUser.UserId.ToString(); } ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.MarkProjectAsCompleted(projectId, userID); var json = new JavaScriptSerializer().Serialize(result); return(json); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ProjectBusinessLogic projectBusinessLogic = new ProjectBusinessLogic(); var list = projectBusinessLogic.GetAll().OrderBy(o => o.Name).ToList(); this.dDListProjects.DataSource = list; this.dDListProjects.DataBind(); if (list.Count() >= 1) { this.dDListProjects.SelectedIndex = 0; this.gridViewActivities.DataSource = list[0].Activities; this.gridViewActivities.DataBind(); } } }
public string GetAllProjectSubTasksByTaskIdAndUserId(string taskId) { UserModel objUser = new UserModel(); string userID = string.Empty; if (HttpContext.Current.Session["User"] != null) { objUser = (UserModel)Session["User"]; userID = objUser.UserId.ToString(); } ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetAllProjectSubTasksByTaskIdAndUserId(taskId, userID); var json = new JavaScriptSerializer().Serialize(result); return(json); }
protected void btnAddNewProject_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(this.txtNewPrjectName.Text)) { lblNewPrjectMessage.Text = "O nome deve ser preenchido!"; return; } if (string.IsNullOrWhiteSpace(this.txtNewPrjectDescription.Text)) { lblNewPrjectMessage.Text = "A descrição deve ser preenchido!"; return; } ProjectBusinessLogic projectBusinessLogic = new ProjectBusinessLogic(); Project project = new Project() { Name = txtNewPrjectName.Text, Description = txtNewPrjectDescription.Text }; IResultOperation result = projectBusinessLogic.InsertWithRule(project); if (result.Status != ResultOperationStatus.OK) { lblNewPrjectMessage.Text = result.Message; return; } BindGridViewProjects(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddHideModalScript", Util.GetScriptToHideModalDialog("addModal"), false); this.txtNewPrjectName.Text = string.Empty; this.txtNewPrjectDescription.Text = string.Empty; }
public string AddSubTaskToUser(string taskId, string startDate, string endDate, string userId, string subTaskName, string comments) { UserModel objUser = new UserModel(); string addedBy = string.Empty; if (HttpContext.Current.Session["User"] != null) { objUser = (UserModel)Session["User"]; addedBy = objUser.UserId.ToString(); } ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.AddSubTaskToUser(taskId, startDate, endDate, userId, subTaskName, addedBy, comments); var json = new JavaScriptSerializer().Serialize(result); return(json); }
protected void btnUpdateProject_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(this.txtEditProjectName.Text)) { lblEditPrjectMessage.Text = "O nome deve ser preenchido!"; return; } if (string.IsNullOrWhiteSpace(this.txtEditProjectDescription.Text)) { lblEditPrjectMessage.Text = "A descrição deve ser preenchido!"; return; } ProjectBusinessLogic projectBusinessLogic = new ProjectBusinessLogic(); Project project = projectBusinessLogic.GetByID(Convert.ToInt32(HfUpdateID.Value)); string currentName = project.Name; project.Name = txtEditProjectName.Text; project.Description = txtEditProjectDescription.Text; IResultOperation result = projectBusinessLogic.UpdatetWithRule(project); if (result.Status != ResultOperationStatus.OK) { this.lblEditPrjectMessage.Text = result.Message; project.Name = currentName; return; } BindGridViewProjects(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "EditHideModalScript", Util.GetScriptToHideModalDialog("editModal"), false); lblEditPrjectMessage.Text = string.Empty; }
public string GetAllProjects(int pageNumber, string searchTerm, int numberOfRecords, bool showHiddenProjects) { UserModel objUser = new UserModel(); string userID = string.Empty; if (HttpContext.Current.Session["User"] != null) { objUser = (UserModel)Session["User"]; userID = objUser.UserId.ToString(); } else { return(string.Empty); } ProjectBusinessLogic obj = new ProjectBusinessLogic(); var result = obj.GetAllProjects(pageNumber, searchTerm, numberOfRecords, showHiddenProjects, userID); var json = new JavaScriptSerializer().Serialize(result); return(json); }
public ProjectsController(IProjectRepository projectRepository) { _projectBll = new ProjectBusinessLogic(projectRepository); }