示例#1
0
 protected void btnApproveCompOff_Click(object sender, EventArgs e)
 {
     try
     {
         string errorMessage = string.Empty;
         if (ValidateAndSaveRotaCompOffEntries(hdnfCompOffRotaEmployeeNo.Value, ref errorMessage))
         {
             CompOffModalPopupExtender.Hide();
             if (SaveAttendanceDetails() > 0)
             {
                 ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(),
                                                     @"alert('Comp-off/Rota and the attendance details has been saved successfully.');", true);
                 if (ddlSearchCriteria.SelectedIndex >= 0)
                 {
                     BindAttendanceSummaryGrid(ddlSearchCriteria.SelectedValue);
                 }
             }
             else
             {
                 ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(),
                                                     @"alert('Unable to save attendance details, please contact your Administrator.');", true);
             }
         }
         else
         {
             ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(),
                                                 @"alert('" + errorMessage + " /r/nUnable to save comp-off/rota details, please contact your Administrator.');", true);
         }
     }
     catch (Exception ex)
     {
         TroyLiteExceptionManager.HandleException(ex);
     }
 }
示例#2
0
 protected void btnCancelCompOff_Click(object sender, EventArgs e)
 {
     try
     {
         hdnfRequestDayInfo.Value        = string.Empty;
         hdnfRequestSenderId.Value       = string.Empty;
         hdnfCompOffRotaEmployeeNo.Value = string.Empty;
         txtCompOffReason.Text           = string.Empty;
         lblStatus.Text = string.Empty;
         ddlRotaAlternativeDays.Items.Clear();
         CompOffModalPopupExtender.Hide();
         updPnlRotaCompOff.Update();
     }
     catch (Exception ex)
     {
         TroyLiteExceptionManager.HandleException(ex);
     }
 }
示例#3
0
    private bool ShowCompOffRotaPopup(Button btnSender)
    {
        if (btnSender != null)
        {
            // Get the date value for the current request.

            DateTime requestDate = getDateValueForTheRequest(btnSender);

            hdnfRequestDayInfo.Value        = requestDate.ToShortDateString();
            hdnfCompOffRotaEmployeeNo.Value = btnSender.CommandArgument.Split(new char[] { '/' })[0];
            hdnfRequestSenderId.Value       = btnSender.ID;

            DataTable consequenceDates = GetConsequenceOneWeekDate(requestDate);
            ddlRotaAlternativeDays.DataSource     = consequenceDates;
            ddlRotaAlternativeDays.DataTextField  = "LongDate";
            ddlRotaAlternativeDays.DataValueField = "ShortDate";
            ddlRotaAlternativeDays.DataBind();

            updPnlRotaCompOff.Update();
            CompOffModalPopupExtender.Show();
            return(true);
        }
        return(false);
    }