protected void ButtonLogin_Click(object sender, EventArgs e)
        {
            List <proc_CheckLogin_Result> user = null;
            releasedbEntities1            releasedbEntities = new releasedbEntities1();
            int    Empid    = int.Parse(UsrTxtbox.Text);
            string password = Usrpwd.Text;

            user = releasedbEntities.proc_CheckLogin(Empid, password).ToList();
            string EmpRole = user[0].EmployeeRole;

            if (EmpRole == "manager")
            {
                Session.Add("Empid", UsrTxtbox.Text);
                Response.Redirect("ManagerRole.aspx");
            }

            if (EmpRole == "developer")
            {
                Session.Add("Empid", UsrTxtbox.Text);
                Response.Redirect("DeveloperRole.aspx");
            }

            if (EmpRole == "tester")
            {
                Session.Add("Empid", UsrTxtbox.Text);
                Response.Redirect("TesterRole.aspx");
            }
        }
        protected void ButtonAddModule_Click(object sender, EventArgs e)
        {
            int mid;

            while (!Int32.TryParse(TextBoxModuleID.Text, out mid))
            {
                Message.Text = "Module ID is a number";
            }

            DateTime expected_start_date;

            while (!(DateTime.TryParse(TextBoxExpectedStartDate.Text, out expected_start_date)))
            {
                Message.Text = "Enter the Correct date";
            }

            DateTime expected_end_date;

            while (!(DateTime.TryParse(TextBoxExpectedEndDate.Text, out expected_end_date)))
            {
                Message.Text = "Enter the Correct date";
            }

            DateTime actual_start_date;

            while (!(DateTime.TryParse(TextBoxActualStartDate.Text, out actual_start_date)))
            {
                Message.Text = "Enter the Correct date";
            }

            DateTime actual_end_date;

            while (!(DateTime.TryParse(TextBoxActualEndDate.Text, out actual_end_date)))
            {
                Message.Text = "Enter the Correct date";
            }

            int pid = Convert.ToInt32(DropDownListPid.SelectedValue);

            LabelDeveloper.Text = "Select a developer to assign the project:";

            string SelectDeveloper = DropDownList1.SelectedValue;

            LabelTester.Text = "Select a tester to assign the project:";

            string SelectTester = DropDownList1.SelectedValue;

            using (releasedbEntities1 db = new releasedbEntities1())
            {
                db.S_InsertIntoModule_P(mid, expected_start_date,
                                        expected_end_date, actual_start_date, actual_end_date, pid);

                db.I_AssignModuleToDeveloper_P(SelectDeveloper, mid);

                db.I_AssignModuleToTester_P(SelectTester, mid);

                db.SaveChanges();
                Message.Text = "Project Added";
            }
        }
        protected void AddButton_Click(object sender, EventArgs e)
        {
            int    EmpId   = Convert.ToInt32(EmpIDBox.Text);
            string EmpName = EmpNameBox.Text;
            string Erole   = DropDownList1.SelectedValue;

            using (releasedbEntities1 db = new releasedbEntities1())
            {
                db.S_AddEmployee_p(EmpId, EmpName, Erole);
                db.SaveChanges();
                MessageLabel.Text = "Employee is added";
            }
        }
        protected void AssignButton_Click(object sender, EventArgs e)
        {
            int    ProjectId = Convert.ToInt32(DropDownList3.SelectedValue);
            string ProjName  = DropDownList1.SelectedValue;
            int    Tid       = Convert.ToInt32(DropDownList2.SelectedValue);

            using (releasedbEntities1 db = new releasedbEntities1())
            {
                db.S_AddTeamLeadtoProject_p(ProjectId, ProjName, Tid);
                db.SaveChanges();
                Label1.Text = "Team Lead ID is added";
            }
        }
Exemplo n.º 5
0
        protected void AddButton_Click1(object sender, EventArgs e)
        {
            int projid;

            while (!(Int32.TryParse(ProIDBox.Text, out projid)))
            {
                MessageLabel.Text = "Enter the Project ID";
            }

            string projname = ProjNameBox.Text;

            DateTime expected_start_date;

            while (!(DateTime.TryParse(TextBoxExpectedStartDate.Text, out expected_start_date)))
            {
                MessageLabel.Text = "Enter the Correct date";
            }

            DateTime expected_end_date;

            while (!(DateTime.TryParse(TextBoxExpectedEndDate.Text, out expected_end_date)))
            {
                MessageLabel.Text = "Enter the Correct date";
            }

            DateTime actual_start_date;

            while (!(DateTime.TryParse(TextBoxActualStartDate.Text, out actual_start_date)))
            {
                MessageLabel.Text = "Enter the Correct date";
            }

            DateTime actual_end_date;

            while (!(DateTime.TryParse(TextBoxActualEndDate.Text, out actual_end_date)))
            {
                MessageLabel.Text = "Enter the Correct date";
            }
            using (releasedbEntities1 db = new releasedbEntities1())
            {
                db.S_InsertIntoProject_p(projid, projname, expected_start_date,
                                         expected_end_date, actual_start_date, actual_end_date);
                db.SaveChanges();
                ProjNameBox.Text  = "";
                ProIDBox.Text     = "";
                MessageLabel.Text = "Project Added";
            }
        }
        protected void AddButton_Click1(object sender, EventArgs e)
        {
            int projid;

            while (!(Int32.TryParse(ProIDBox.Text, out projid)))
            {
                MessageLabel.Text = "Enter the Project ID";
            }
            string projname = ProjNameBox.Text;

            using (releasedbEntities1 db = new releasedbEntities1())
            {
                db.S_InsertIntoProject_p(projid, projname);
                db.SaveChanges();
                ProjNameBox.Text  = "";
                ProIDBox.Text     = "";
                MessageLabel.Text = "Project Added";
            }
        }