Пример #1
0
 // Method to update staff requests
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     tpsData.updateRequest(staff_grid.Rows[staff_grid.SelectedIndex].Cells[0].Text, staff_grid.Rows[staff_grid.SelectedIndex].Cells[2].Text, staff_grid.Rows[staff_grid.SelectedIndex].Cells[3].Text, staff_grid.Rows[staff_grid.SelectedIndex].Cells[4].Text, staff_grid.Rows[staff_grid.SelectedIndex].Cells[5].Text, ddlStatus.SelectedValue);
     Session["Title"]   = "<h1>Request Updated</h1>";
     Session["Message"] = "The request has been updated. Please contact TPS for any and all questions. Thank you and have a great day!";
     Server.Transfer("success.aspx", true);
 }
        // Method to handle new requests added
        protected void UpdateRequest_Click(object sender, EventArgs e)
        {
            // Error handling checks
            if (tbLocation.Text != "" && tbSalary.Text != "" && selectedStaff[0] != "")
            {
                string stafflist = selectedStaff[0];

                if (selectedStaff[1] != "")
                {
                    stafflist += "," + selectedStaff[1];

                    if (selectedStaff[2] != "")
                    {
                        stafflist += "," + selectedStaff[2];
                    }
                }

                // Update request and redirect
                tpsData.updateRequest(tbSearch.Text, stafflist, tbLocation.Text, ddlWork.SelectedValue, tbSalary.Text, myDict["status"]);
                Session["Title"]   = "<h1>Request Updated</h1>";
                Session["Message"] = "Your request has been updated and is up for review. Please contact TPS for any and all questions. Thank you and have a great day!";
                Server.Transfer("success.aspx", true);
            }
        }