Exemplo n.º 1
0
    /// <summary>
    /// Blocks the slot for the purposes other than Customer Registration
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ibtnBlockSlot_Click(object sender, ImageClickEventArgs e)
    {
        var objeventappointment = new EEventAppointment
        {
            AppointmentID = Convert.ToInt32(ViewState["AppointmentID"]),
            EventID       = Convert.ToInt32(Session["EventID"]),
            Reason        = txtReason.Text,
            Subject       = "Blocked",
            ScheduleByID  = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId)
        };

        var masterDal = new MasterDAL();

        if (masterDal.UpdateAppointmentSlot(objeventappointment, Convert.ToInt16(EOperationMode.Update)) != -1)
        {
            Page.ClientScript.RegisterStartupScript(typeof(string), "js_blockappt", " parent.ClosePopUp();", true);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Adds a new appointmentslot
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void ibtnAddSlot_Click(object sender, ImageClickEventArgs e)
    {
        var masterDal           = new MasterDAL();
        var objeventappointment = new EEventAppointment {
            StartTime = txtstarttime.Text
        };

        if (txtendtime.Text.Trim().Length < 1)
        {
            objeventappointment.EndTime = Convert.ToDateTime(txtstarttime.Text).AddMinutes(15.00).ToString("hh:mm tt");
        }
        else
        {
            objeventappointment.EndTime = txtendtime.Text;
        }

        objeventappointment.EventID      = Convert.ToInt32(Request.QueryString["EventId"]);
        objeventappointment.StartDate    = Convert.ToDateTime(ViewState["EventDate"]).ToString();
        objeventappointment.EndDate      = Convert.ToDateTime(ViewState["EventDate"]).ToString();
        objeventappointment.ScheduleByID = 0;

        long returnresult = masterDal.UpdateAppointmentSlot(objeventappointment, Convert.ToInt16(EOperationMode.Insert));

        if (returnresult != -1)
        {
            if (returnresult == 0)
            {
                this.Page.ClientScript.RegisterStartupScript(typeof(string), "jscodeaddslot", " alert('Added slot time should fall between the event start and end timing.'); ", true);
            }
            else
            {
                this.Page.ClientScript.RegisterStartupScript(typeof(string), "jscodeaddslot", " parent.ClosePopUp();  ", true);
                //FillData(Convert.ToInt32(ViewState["EventID"]));
            }
        }
        else
        {
            this.Page.ClientScript.RegisterStartupScript(typeof(string), "jscodeaddslot", " alert('Slot could not be added because of database error.'); ", true);
        }
    }