public string Post(ReleaseManagementModel userLogin) { try { string token = null; bool value = bl.checkinguserlogin(userLogin.Username, userLogin.Password); if (value) { IAuthContainerModel model = GetJWTContainerModel(userLogin.Username, userLogin.Role); IAuthService authService = new JWTService(model.SecretKey); token = authService.GenerateToken(model); var message = Request.CreateResponse(HttpStatusCode.OK, "Authentication successfull"); message.Headers.Add("JWT_TOKEN", token); return(token); } else { return(token); } } catch (Exception e) { return(null); } }
public bool Put(string value, ReleaseManagementModel manager) { try { bool updated = false; string email = bl.GetEmail(manager.Username); updated = bl.UpdateModuleStatustoManager(value); if (updated) { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("*****@*****.**"); mail.To.Add(email); mail.Subject = "Module Status Update To Manager"; mail.Body = manager.Username + " " + "Modules Completed Successfully"; SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "dbinfosys29"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); } return(updated); } catch (Exception e) { return(false); } }
public bool Put([FromBody] ReleaseManagementModel model) { try { bool updated = false; string email = bl.GetEmail(model.Username); updated = bl.UpdateForgotPassword(model.Username, model.Password); if (updated) { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("*****@*****.**"); mail.To.Add(email); mail.Subject = "Password updation Status"; mail.Body = email + "Password updated Successfully"; SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "dbinfosys29"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); } return(updated); } catch (Exception e) { return(false); } }
public bool AssignModuleToTester(ReleaseManagementModel manager) { manager.ModuleStatus = "In Progress(T)"; bool modStatus = false; bool insertRoleStatus = false; string empId = dal.GetEmployeeIdForName(manager.EmployeeName); manager.EmployeeId = empId; bool assignedStatus = dal.AssignModuleToEmployee(manager); if (assignedStatus == true) { modStatus = dal.UpdateModuleStatus(manager.ModuleId, manager.ModuleStatus); } else { modStatus = false; } string role = "Tester"; if (modStatus == true) { insertRoleStatus = dal.InsertRole(manager.EmployeeId, role, manager.ModuleId); } return(insertRoleStatus); }
public List <ReleaseManagementModel> GetAllTesterModules(string P_Id, string username) { ReleaseManagementModel tests = null; List <ReleaseManagementModel> testers = new List <ReleaseManagementModel>(); cmdGetAllTestModules = new SqlCommand("Proc_GetModulesForTester", conn); cmdGetAllTestModules.Parameters.AddWithValue("@p_Id", P_Id); cmdGetAllTestModules.Parameters.AddWithValue("@username", username); cmdGetAllTestModules.CommandType = CommandType.StoredProcedure; conn.Open(); SqlDataReader drmodules = cmdGetAllTestModules.ExecuteReader(); while (drmodules.Read()) { tests = new ReleaseManagementModel(); tests.ModuleId = drmodules[0].ToString(); tests.ModuleName = drmodules[1].ToString(); tests.ModuleDescription = drmodules[2].ToString(); tests.ModuleStatus = drmodules[3].ToString(); tests.ModuleStartDate = Convert.ToDateTime(drmodules[4].ToString()); tests.ModuleEndDate = Convert.ToDateTime(drmodules[5].ToString()); testers.Add(tests); } return(testers); }
//Manager First part public bool InsertProjects(ReleaseManagementModel manager) { bool _inserted = false; cmdInsertProjects = new SqlCommand("proc_InsertProjects", conn); cmdInsertProjects.Parameters.Add("@projectname", SqlDbType.VarChar, 40); cmdInsertProjects.Parameters.Add("@projectdescription", SqlDbType.VarChar, 70); cmdInsertProjects.Parameters.Add("@fromdate", SqlDbType.DateTime); cmdInsertProjects.Parameters.Add("@todate", SqlDbType.DateTime); cmdInsertProjects.CommandType = CommandType.StoredProcedure; if (conn.State == ConnectionState.Open) { conn.Close(); } conn.Open(); cmdInsertProjects.Parameters[0].Value = manager.ProjectName; cmdInsertProjects.Parameters[1].Value = manager.ProjectDescription; cmdInsertProjects.Parameters[2].Value = manager.ProjectStartDate; cmdInsertProjects.Parameters[3].Value = manager.ProjectEndDate; if (cmdInsertProjects.ExecuteNonQuery() > 0) { _inserted = true; } else { _inserted = false; } conn.Close(); return(_inserted); }
//tester2 public List <ReleaseManagementModel> bugFixedModuleData(string username) { cmdFixModuleData = new SqlCommand("testerBugFixModule", conn); cmdFixModuleData.Parameters.AddWithValue("@username", username); cmdFixModuleData.CommandType = CommandType.StoredProcedure; List <ReleaseManagementModel> bFMMs = new List <ReleaseManagementModel>(); conn.Open(); SqlDataReader drBFMM = cmdFixModuleData.ExecuteReader(); ReleaseManagementModel bFMM = null; while (drBFMM.Read()) { bFMM = new ReleaseManagementModel(); bFMM.ModuleId = drBFMM[0].ToString(); bFMM.ModuleName = drBFMM[1].ToString(); bFMM.Bugname = drBFMM[2].ToString(); bFMM.Bugstatus = drBFMM[3].ToString(); bFMMs.Add(bFMM); } conn.Close(); return(bFMMs); }
public List <ReleaseManagementModel> GetEmployeesToAssign() { List <ReleaseManagementModel> assignedEmployees = GetAllAssignedEmployees(); List <ReleaseManagementModel> allEmployees = GetAllEmployees(); List <ReleaseManagementModel> Employees = new List <ReleaseManagementModel>(); ReleaseManagementModel employee; int count = 0; for (int i = 0; i < allEmployees.Count; i++) { count = 0; for (int j = 0; j < assignedEmployees.Count; j++) { if (allEmployees[i].EmployeeId == assignedEmployees[j].EmployeeId) { count++; } } if (count == 0) { employee = new ReleaseManagementModel(); employee.EmployeeName = allEmployees[i].EmployeeName; employee.EmployeeId = allEmployees[i].EmployeeId; Employees.Add(employee); } } if (Employees.Count != 0) { return(Employees); } else { return(allEmployees); } }
//Insert modules public bool InsertProjectModules(ReleaseManagementModel manager) { bool _insertedmodule = false; cmdInsertModules = new SqlCommand("proc_InsertModules", conn); cmdInsertModules.Parameters.Add("@projectid", SqlDbType.VarChar, 10); cmdInsertModules.Parameters.Add("@module_name", SqlDbType.VarChar, 20); cmdInsertModules.Parameters.Add("@module_description", SqlDbType.VarChar, 70); cmdInsertModules.Parameters.Add("@module_status", SqlDbType.VarChar, 40); cmdInsertModules.Parameters.Add("@from_date", SqlDbType.DateTime); cmdInsertModules.Parameters.Add("@to_date", SqlDbType.DateTime); cmdInsertModules.CommandType = CommandType.StoredProcedure; if (conn.State == ConnectionState.Open) { conn.Close(); } conn.Open(); cmdInsertModules.Parameters[0].Value = manager.ProjectId; cmdInsertModules.Parameters[1].Value = manager.ModuleName; cmdInsertModules.Parameters[2].Value = manager.ModuleDescription; cmdInsertModules.Parameters[3].Value = manager.ModuleStatus; cmdInsertModules.Parameters[4].Value = manager.ModuleStartDate; cmdInsertModules.Parameters[5].Value = manager.ModuleEndDate; if (cmdInsertModules.ExecuteNonQuery() > 0) { _insertedmodule = true; } else { _insertedmodule = false; } conn.Close(); return(_insertedmodule); }
//Get All Modules public List <ReleaseManagementModel> GetAllModules(string projectId) { cmdGetAllModulesForManager = new SqlCommand("proc_GetAllModules", conn); cmdGetAllModulesForManager.Parameters.AddWithValue("@projectId", projectId); cmdGetAllModulesForManager.CommandType = CommandType.StoredProcedure; List <ReleaseManagementModel> managers = new List <ReleaseManagementModel>(); if (conn.State == ConnectionState.Open) { conn.Close(); } conn.Open(); SqlDataReader drmodules = cmdGetAllModulesForManager.ExecuteReader(); ReleaseManagementModel manager = null; while (drmodules.Read()) { manager = new ReleaseManagementModel(); manager.ModuleId = drmodules[0].ToString(); manager.ModuleName = drmodules[1].ToString(); manager.ModuleDescription = drmodules[2].ToString(); manager.ModuleStatus = drmodules[3].ToString(); manager.ModuleStartDate = Convert.ToDateTime(drmodules[4]); manager.ModuleEndDate = Convert.ToDateTime(drmodules[5]); managers.Add(manager); } conn.Close(); return(managers); }
public bool UpdateEmployee(ReleaseManagementModel admin) { bool updated = false; cmdUpdateEmps = new SqlCommand("proc_UpdateEmployee", conn); cmdUpdateEmps.Parameters.Add("@emp_id", SqlDbType.VarChar, 4); cmdUpdateEmps.Parameters.Add("@emp_name", SqlDbType.VarChar, 30); cmdUpdateEmps.Parameters.Add("@employee_email", SqlDbType.VarChar, 30); cmdUpdateEmps.CommandType = CommandType.StoredProcedure; OpenConnection(); //doubt cmdUpdateEmps.Parameters[0].Value = admin.EmployeeName; cmdUpdateEmps.Parameters[1].Value = admin.Employee_mail; if (cmdUpdateEmps.ExecuteNonQuery() > 0) { updated = true; } else { updated = false; } conn.Close(); return(updated); }
public bool UpdateEmpDetails(ReleaseManagementModel admin) { bool updated = false; updated = dal.UpdateEmployee(admin); return(updated); }
// POST api/values public bool Post([FromBody] ReleaseManagementModel value) { try { return(bl.AssignModuleToTester(value)); } catch (Exception e) { return(false); } }
// PUT api/values/5 //public bool Put(string modulename,string module) //{ // return bl.UpdateModuleStatusAfterTesting(modulename); //} public bool Put(string modulename, [FromBody] ReleaseManagementModel values) { try { return(bl.UpdateModuleStatusAfterTesting(values.ModuleId)); } catch (Exception e) { return(false); } }
public bool post(string username, [FromBody] ReleaseManagementModel value) { try { return(bl.InsertProjectDetails(username, value)); } catch (Exception e) { return(false); } }
public bool Put([FromBody] ReleaseManagementModel admin) { try { bool update = false; update = bl.UpdateEmpDetails(admin); return(update); } catch (Exception e) { return(false); } }
public ReleaseManagementModel GetBugFixedModule(string moduleId) { DataSet dsGetBugFixedModules = dal.GetBugFixedModules(moduleId); ReleaseManagementModel bugFixedModule = new ReleaseManagementModel(); foreach (DataRow row in dsGetBugFixedModules.Tables[0].Rows) { bugFixedModule.ModuleId = row[0].ToString(); bugFixedModule.ModuleName = row[1].ToString(); bugFixedModule.ModuleDescription = row[2].ToString(); bugFixedModule.ModuleStatus = row[3].ToString(); } return(bugFixedModule); }
public List <ReleaseManagementModel> GetAllModuleDetails() { List <ReleaseManagementModel> modules = new List <ReleaseManagementModel>(); DataSet dsGetAllModuleDetails = dal.GetAllModuleDetails(); ReleaseManagementModel module; foreach (DataRow row in dsGetAllModuleDetails.Tables[0].Rows) { module = new ReleaseManagementModel(); module.ModuleId = row[0].ToString(); module.ModuleName = row[1].ToString(); modules.Add(module); } return(modules); }
public List <ReleaseManagementModel> GetAllEmployees() { List <ReleaseManagementModel> employees = new List <ReleaseManagementModel>(); DataSet dsGetAllEmployees = dal.GetAllEmployees(); ReleaseManagementModel employee; foreach (DataRow row in dsGetAllEmployees.Tables[0].Rows) { employee = new ReleaseManagementModel(); employee.EmployeeId = row[1].ToString(); employee.EmployeeName = row[2].ToString(); employees.Add(employee); } return(employees); }
// Get All ModuleNames And ModuleDescription// public List <ReleaseManagementModel> GetAllModuleNamesAndModuleDescription(string moduleId) { List <ReleaseManagementModel> Modules = new List <ReleaseManagementModel>(); DataSet dsGetAllModulesAndModuleDescription = dal.GetModuleNamesAndModuleDescription(moduleId); ReleaseManagementModel bug; foreach (DataRow row in dsGetAllModulesAndModuleDescription.Tables[0].Rows) { bug = new ReleaseManagementModel(); bug.ModuleId = row[0].ToString(); bug.ModuleName = row[1].ToString(); bug.ModuleDescription = row[2].ToString(); Modules.Add(bug); } return(Modules); }
public ReleaseManagementModel testerCreateBug(ReleaseManagementModel tCB) { cmdCreateBug = new SqlCommand("proc_createBug", conn); cmdCreateBug.CommandType = CommandType.StoredProcedure; cmdCreateBug.Parameters.AddWithValue("@module_Id", tCB.ModuleId); cmdCreateBug.Parameters.AddWithValue("@bug_name", tCB.Bugname); cmdCreateBug.Parameters.AddWithValue("@bug_status", tCB.Bugstatus); conn.Open(); if (cmdCreateBug.ExecuteNonQuery() > 0) { return(tCB); } return(tCB); }
//Get All ModuleNames And BugNames and BugStatus// public List <ReleaseManagementModel> GetAllModuleNamesAndBugNames(string username) { List <ReleaseManagementModel> Modules = new List <ReleaseManagementModel>(); DataSet dsGetAllModules = dal.GetAllModuleNamesAndBugNames(username); ReleaseManagementModel bug; foreach (DataRow row in dsGetAllModules.Tables[0].Rows) { bug = new ReleaseManagementModel(); bug.ModuleId = row[0].ToString(); bug.ModuleName = row[1].ToString(); bug.Bugstatus = row[2].ToString(); bug.Bugname = row[3].ToString(); Modules.Add(bug); } return(Modules); }
public ReleaseManagementModel Post([FromBody] ReleaseManagementModel tcb) { try { if (tcb != null) { return(bl.testerCreateBug(tcb)); } else { return(new ReleaseManagementModel()); } } catch (Exception e) { return(new ReleaseManagementModel()); } }
public List <ReleaseManagementModel> GetAllProjectsForDeveloperFromManager(string username) { List <ReleaseManagementModel> projects = new List <ReleaseManagementModel>(); DataSet dsGetProject = dal.GetAllProjectForDeveloperFromManager(username); ReleaseManagementModel project; foreach (DataRow row in dsGetProject.Tables[0].Rows) { project = new ReleaseManagementModel(); project.ProjectId = row[0].ToString(); project.ProjectName = row[1].ToString(); project.ProjectDescription = row[2].ToString(); project.ProjectStartDate = Convert.ToDateTime(row[3].ToString()); project.ProjectEndDate = Convert.ToDateTime(row[4].ToString()); projects.Add(project); } return(projects); }
//Get All modules assigned by manager public List <ReleaseManagementModel> GetAllModulesForDeveloper(string projectId, string username) { List <ReleaseManagementModel> modules = new List <ReleaseManagementModel>(); DataSet dsGetModules = dal.GetAllmodulesForDeveloper(projectId, username); ReleaseManagementModel module; foreach (DataRow row in dsGetModules.Tables[0].Rows) { module = new ReleaseManagementModel(); module.ModuleId = row[0].ToString(); module.ModuleName = row[1].ToString(); module.ModuleDescription = row[2].ToString(); module.ModuleStatus = row[3].ToString(); module.ModuleStartDate = Convert.ToDateTime(row[4].ToString()); module.ModuleEndDate = Convert.ToDateTime(row[5].ToString()); modules.Add(module); } return(modules); }
public List <ReleaseManagementModel> GetProjects(string username) { DataSet dsGetprojectId = dal.GetProjectDetails(username); List <ReleaseManagementModel> projects = new List <ReleaseManagementModel>(); ReleaseManagementModel project; foreach (DataRow row in dsGetprojectId.Tables[0].Rows) { project = new ReleaseManagementModel(); project.ProjectId = row[0].ToString(); project.ProjectName = row[1].ToString(); projects.Add(project); } for (int i = 0; i < projects.Count; i++) { projects[i].TotalModules = dal.GetModuleCount(projects[i].ProjectId); projects[i].ModuleCount = dal.GetCompletedModuleCount(projects[i].ProjectId); } return(projects); }
public List <ReleaseManagementModel> GetAllCompletedProjects(string username) { DataSet dsGetprojectId = dal.GetProjectId(username); List <ReleaseManagementModel> projects = new List <ReleaseManagementModel>(); ReleaseManagementModel project; foreach (DataRow row in dsGetprojectId.Tables[0].Rows) { project = new ReleaseManagementModel(); project.ProjectId = row[0].ToString(); project.ProjectName = row[1].ToString(); projects.Add(project); } for (int i = 0; i < projects.Count; i++) { projects[i].TotalModules = dal.GetModuleCount(projects[i].ProjectId); projects[i].ModuleCount = dal.GetCompletedModulesCount(projects[i].ProjectId); } List <ReleaseManagementModel> completedProjects = new List <ReleaseManagementModel>(); ReleaseManagementModel completedProject = null; for (int i = 0; i < projects.Count; i++) { if (projects[i].TotalModules == projects[i].ModuleCount) { DataSet dscompletedproject = dal.GetCompletedProject(projects[i].ProjectId); foreach (DataRow row in dscompletedproject.Tables[0].Rows) { completedProject = new ReleaseManagementModel(); completedProject.ProjectName = row[0].ToString(); completedProject.ProjectDescription = row[1].ToString(); completedProject.ProjectStartDate = Convert.ToDateTime(row[2].ToString()); completedProject.ProjectEndDate = Convert.ToDateTime(row[3].ToString()); completedProjects.Add(completedProject); } } } return(completedProjects); }
public List <ReleaseManagementModel> GetAllEmployeesForAdmin() { cmdGetEmps = new SqlCommand("proc_GetAllEmployeeForAdmin", conn); cmdGetEmps.CommandType = CommandType.StoredProcedure; List <ReleaseManagementModel> admins = new List <ReleaseManagementModel>(); OpenConnection(); SqlDataReader drUsers = cmdGetEmps.ExecuteReader(); ReleaseManagementModel admin = null; while (drUsers.Read()) { admin = new ReleaseManagementModel(); admin.EmployeeName = drUsers[2].ToString(); admin.Employee_mail = drUsers[3].ToString(); admins.Add(admin); } conn.Close(); return(admins); }
public bool InsertProjectDetails(string username, ReleaseManagementModel manager) { string projectName = manager.ProjectName; int count = dal.GetProjectCount(projectName); string projectId = ""; bool status = false; if (count == 0) { status = dal.InsertProjects(manager); } string employeeId = dal.GetEmployeeId(username); if (status == true) { projectId = dal.GetProjectIdForManager(projectName); } string role = "Manager"; return(dal.InsertRoles(employeeId, role, projectId)); }
public bool AssignModuleToEmployee(ReleaseManagementModel manager) { bool assignModuleToDeveloperStatus = false; cmdAssignModuleToEmployee = new SqlCommand("proc_AssignProjecttoEmployee", conn); cmdAssignModuleToEmployee.Parameters.AddWithValue("@ModuleId", manager.ModuleId); cmdAssignModuleToEmployee.Parameters.AddWithValue("@EmployeeId", manager.EmployeeId); cmdAssignModuleToEmployee.Parameters.AddWithValue("@EmpstartDate", manager.EmpStartDate); cmdAssignModuleToEmployee.Parameters.AddWithValue("@EmpEndDate", manager.EmpEndDate); cmdAssignModuleToEmployee.CommandType = CommandType.StoredProcedure; if (conn.State == ConnectionState.Open) { conn.Close(); } conn.Open(); if (cmdAssignModuleToEmployee.ExecuteNonQuery() > 0) { assignModuleToDeveloperStatus = true; } conn.Close(); return(assignModuleToDeveloperStatus); }