Example #1
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User();
        DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId);
        int      locationId; int.TryParse(dv[0]["LocationId"].ToString(), out locationId);

        Miami.Substitute.Bll.Substitute subst = new Miami.Substitute.Bll.Substitute();
        subst.LoadByUserId(UserId);

        (new Miami.Substitute.Dal.User()).UpdateSubstitute(locationId, Micajah.Common.Security.UserContext.Current.UserId, subst.SubstituteId, Preferred.Checked, AltPhone.Text, Notes.Text);
        ClientScript.RegisterStartupScript(Page.GetType(), "CloseAndRebindScript", "CloseAndRebind();", true);
    }
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User();
        DataView dv = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId);
        int locationId; int.TryParse(dv[0]["LocationId"].ToString(), out locationId);

        Miami.Substitute.Bll.Substitute subst = new Miami.Substitute.Bll.Substitute();
        subst.LoadByUserId(UserId);

        (new Miami.Substitute.Dal.User()).UpdateSubstitute(locationId, Micajah.Common.Security.UserContext.Current.UserId, subst.SubstituteId, Preferred.Checked, AltPhone.Text, Notes.Text);
        ClientScript.RegisterStartupScript(Page.GetType(), "CloseAndRebindScript", "CloseAndRebind();", true);
    }
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        Miami.Substitute.Bll.Job job = new Miami.Substitute.Bll.Job(JobId);
        Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute(job.m_substituteId);

        Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User();
        DataView userView = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId);

        string confirmNote = String.Format("Confirmed by Clerk {0} on {1} {2}", userView[0]["FirstName"].ToString().Trim() + " " + userView[0]["LastName"].ToString().Trim(), DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString());
        job.ConfirmJob(JobId, substitute.SubstituteId, 2, confirmNote + " " + Notes.Text);

        ClientScript.RegisterStartupScript(Page.GetType(), "WorksheetCloseAndRebindScript", "CloseAndRebind();", true);
    }
Example #4
0
    protected void SaveButton_Click(object sender, EventArgs e)
    {
        Miami.Substitute.Bll.Job        job        = new Miami.Substitute.Bll.Job(JobId);
        Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute(job.m_substituteId);

        Miami.Substitute.Dal.User user = new Miami.Substitute.Dal.User();
        DataView userView = user.LoadForMain(Micajah.Common.Security.UserContext.Current.UserId);

        string confirmNote = String.Format("Confirmed by Clerk {0} on {1} {2}", userView[0]["FirstName"].ToString().Trim() + " " + userView[0]["LastName"].ToString().Trim(), DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString());

        job.ConfirmJob(JobId, substitute.SubstituteId, 2, confirmNote + " " + Notes.Text);

        ClientScript.RegisterStartupScript(Page.GetType(), "WorksheetCloseAndRebindScript", "CloseAndRebind();", true);
    }
        protected void PrintLocation_CheckedChanged(object sender, EventArgs e)
        {
            int userId; int.TryParse(((System.Web.UI.WebControls.CheckBox)(sender)).ValidationGroup, out userId);

            Miami.Substitute.Bll.Preferred preferred = new Miami.Substitute.Bll.Preferred();
            Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute();

            substitute.LoadByUserId(userId);
            int substId = substitute.SubstituteId;
            int locId = Convert.ToInt32(lblLocationSelected.Text);

            preferred.DeleteForClerkSubstitute(locId, substId);

            if (((System.Web.UI.WebControls.CheckBox)(sender)).Checked)
                preferred.ClerkInsert(locId, substId);
        }
        protected void SubstituteAssignment_CheckedChanged(object sender, EventArgs e)
        {
            int substId; int.TryParse(((System.Web.UI.WebControls.CheckBox)(sender)).ValidationGroup, out substId);

            Miami.Substitute.Bll.Preferred preferred = new Miami.Substitute.Bll.Preferred();
            Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute();

            Dal.Job job = new Miami.Substitute.Dal.Job();
            job.LoadByPrimaryKeyBase(Convert.ToInt32(Request.QueryString["JobId"]));
            int locId = job.LocationId;

            preferred.DeleteForClerkSubstitute(locId, substId);

            if (((System.Web.UI.WebControls.CheckBox)(sender)).Checked)
                preferred.ClerkInsert(locId, substId);
        }
Example #7
0
        protected void PrintLocation_CheckedChanged(object sender, EventArgs e)
        {
            int userId; int.TryParse(((System.Web.UI.WebControls.CheckBox)(sender)).ValidationGroup, out userId);

            Miami.Substitute.Bll.Preferred  preferred  = new Miami.Substitute.Bll.Preferred();
            Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute();

            substitute.LoadByUserId(userId);
            int substId = substitute.SubstituteId;
            int locId   = Convert.ToInt32(lblLocationSelected.Text);

            preferred.DeleteForClerkSubstitute(locId, substId);

            if (((System.Web.UI.WebControls.CheckBox)(sender)).Checked)
            {
                preferred.ClerkInsert(locId, substId);
            }
        }
        protected void SubstituteAssignment_CheckedChanged(object sender, EventArgs e)
        {
            int substId; int.TryParse(((System.Web.UI.WebControls.CheckBox)(sender)).ValidationGroup, out substId);

            Miami.Substitute.Bll.Preferred  preferred  = new Miami.Substitute.Bll.Preferred();
            Miami.Substitute.Bll.Substitute substitute = new Miami.Substitute.Bll.Substitute();

            Dal.Job job = new Miami.Substitute.Dal.Job();
            job.LoadByPrimaryKeyBase(Convert.ToInt32(Request.QueryString["JobId"]));
            int locId = job.LocationId;

            preferred.DeleteForClerkSubstitute(locId, substId);

            if (((System.Web.UI.WebControls.CheckBox)(sender)).Checked)
            {
                preferred.ClerkInsert(locId, substId);
            }
        }
        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 #10
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");
         }
     }
 }
        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 #12
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");
         }
     }
 }
Example #13
0
        public NoticeSystem(int jobId, NoticeType noticeType, int substituteUserId, int clerkUserId)
        {
            try
            {
                JobId = jobId;
                type = noticeType;
                SubstituteUserId = substituteUserId;

                Substitute substitute = new Substitute();
                substitute.LoadByUserId(SubstituteUserId);
                SubstituteId = substitute.SubstituteId;

                Job job = new Job(jobId);
                jobView = job.LoadByPrimaryKey(jobId);
                substituteView = (new Miami.Substitute.Dal.User()).LoadForMain(SubstituteUserId)[0];

                int.TryParse(jobView["LocationId"].ToString(), out LocationId);
                DataView dv = (new Dal.Job()).GetEmployee(LocationId);
                if (clerkUserId > 0)
                    ClerkUserId = clerkUserId;
                else if (dv.Count > 0)
                    ClerkUserId = Convert.ToInt32(dv[0]["Employee_Number"]);

                clerkView = (new Miami.Substitute.Dal.User()).LoadForMain(ClerkUserId)[0];

                switch (type)
                {
                    case NoticeType.AcceptedJobCancelledBySubstitute: // Send to Clerks
                    case NoticeType.JobAppliedForBySubstitute:
                        from = new MailAddress(substituteView["Email"].ToString());

                        if (substituteView["Email"].ToString().Trim().Length > 0)
                            to.Add(new MailAddress(clerkView["Email"].ToString()));

                        if (dv != null)
                            foreach (DataRow dr in dv.Table.Rows)
                                cc.Add(new MailAddress(dr["Employee_email_address"].ToString()));
                        break;

                    case NoticeType.AcceptedJobDeletedByClerk: // Send to Substitute
                    case NoticeType.JobAcceptedByClerk:
                    case NoticeType.JobConfirmedBySubstitute:
                    case NoticeType.JobDeclinedBySubstitute:
                        from = new MailAddress(clerkView["Email"].ToString());
                        if (substituteView["Email"].ToString().Trim().Length > 0)
                            to.Add(new MailAddress(substituteView["Email"].ToString()));

                        if (dv != null)
                            foreach (DataRow dr in dv.Table.Rows)
                            {
                                if (type != NoticeType.JobAcceptedByClerk)
                                    cc.Add(new MailAddress(dr["Employee_email_address"].ToString()));

                                if (from.Address.Length == 0)
                                    from = new MailAddress(dr["Employee_email_address"].ToString());
                            }
                        break;
                }
            }
            catch { }
        }