protected void SubstituteList_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                int substituteId = Convert.ToInt32(e.CommandArgument);
                int jobId = Convert.ToInt32(lblJobId.Text);
                Job job = new Job();
                ArrayList jobOverLaps = job.GetOverlap(jobId, substituteId);
                if (jobOverLaps.Count > 0)
                {
                    for (int i = 0; i < jobOverLaps.Count; i++)
                        job.DeleteSubstituteFromJob(Convert.ToInt32(jobOverLaps[i]), substituteId);
                }

                job.SetSubstitute(jobId, substituteId, 3);
                Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute(substituteId);

                NoticeSystem noticeSystem = new NoticeSystem(jobId, NoticeSystem.NoticeType.JobAcceptedByClerk, substitute.UserId, Micajah.Common.Security.UserContext.Current.UserId);
                noticeSystem.Send();
                Response.Redirect("Worksheet.aspx", true);
            }
        }
Example #2
0
 protected void SubstituteList_Action(object sender, CommonGridViewActionEventArgs e)
 {
     Job job = new Job();
     job.SetSubstitute(Convert.ToInt32(lblJobId.Text), Convert.ToInt32(((System.Web.UI.WebControls.GridView)(sender)).SelectedValue), 3);
     Response.Redirect("Default.aspx");
 }