예제 #1
0
        public void ConfirmJob(int jobId, int substituteId, int status, string confirmNote)
        {
            DalJob.ConfirmJob(jobId, substituteId, status, confirmNote);

            NoticeSystem.NoticeType type;
            if (status == 2)
            {
                type = NoticeSystem.NoticeType.JobConfirmedBySubstitute;
            }
            else
            {
                type = NoticeSystem.NoticeType.JobDeclinedBySubstitute;
            }

            Substitute   substitute   = new Substitute(substituteId);
            NoticeSystem noticeSystem = new NoticeSystem(jobId, type, substitute.UserId, 0);

            noticeSystem.Send();
        }
        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);
            }
        }
예제 #3
0
 protected void JobList_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
 {
     if (e.CommandName != "Sort")
     {
         int jobId; int.TryParse(((System.Data.DataRowView)(e.Item.DataItem)).Row["JobId"].ToString(), out jobId);
         if (e.CommandName == "EditJob")
             Response.Redirect("EditJob.aspx?JobId=" + jobId.ToString());
         else if (e.CommandName == "Delete")
         {
             Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job();
             job.LoadByPrimaryKeyBase(jobId);
             if (job.m_substituteId > 0)
             {
                 Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute(job.m_substituteId);
                 Miami.Substitute.Bll.NoticeSystem noticeSystem = new Miami.Substitute.Bll.NoticeSystem(jobId, Miami.Substitute.Bll.NoticeSystem.NoticeType.AcceptedJobDeletedByClerk, substitute.UserId, Micajah.Common.Security.UserContext.Current.UserId);
                 noticeSystem.Send();
             }
             job.DeleteJob(jobId);
             Response.Redirect("Worksheet.aspx");
         }
     }
 }
예제 #4
0
 protected void JobList_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
 {
     if (e.CommandName != "Sort")
     {
         int jobId; int.TryParse(((System.Data.DataRowView)(e.Item.DataItem)).Row["JobId"].ToString(), out jobId);
         if (e.CommandName == "EditJob")
         {
             Response.Redirect("EditJob.aspx?JobId=" + jobId.ToString());
         }
         else if (e.CommandName == "Delete")
         {
             Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job();
             job.LoadByPrimaryKeyBase(jobId);
             if (job.m_substituteId > 0)
             {
                 Miami.Substitute.Bll.Substitute   substitute   = new Miami.Substitute.Bll.Substitute(job.m_substituteId);
                 Miami.Substitute.Bll.NoticeSystem noticeSystem = new Miami.Substitute.Bll.NoticeSystem(jobId, Miami.Substitute.Bll.NoticeSystem.NoticeType.AcceptedJobDeletedByClerk, substitute.UserId, Micajah.Common.Security.UserContext.Current.UserId);
                 noticeSystem.Send();
             }
             job.DeleteJob(jobId);
             Response.Redirect("Worksheet.aspx");
         }
     }
 }
예제 #5
0
        public void ConfirmJob(int jobId, int substituteId, int status, string confirmNote)
        {
            DalJob.ConfirmJob(jobId, substituteId, status, confirmNote);

            NoticeSystem.NoticeType type;
            if (status == 2)
                type = NoticeSystem.NoticeType.JobConfirmedBySubstitute;
            else
                type = NoticeSystem.NoticeType.JobDeclinedBySubstitute;

            Substitute substitute = new Substitute(substituteId);
            NoticeSystem noticeSystem = new NoticeSystem(jobId, type, substitute.UserId, 0);
            noticeSystem.Send();
        }