private bool UpdateStatus(int iStatus) { //Check if the Status value is changed, if yes then update the same if (ddlStatus.SelectedValue != hdnStatus.Value) { string strReason = txtReason.Text.Trim(); string strFJCID = (string)Session["FJCID"]; int iUserId = Convert.ToInt32(Session["UsrID"]); if (strReason == string.Empty && (iStatus == 15 || iStatus == 9))//only ask for comments when the status is changed to second approval, under review { lblErr.Text = "Please enter Reason(s) for change"; return(false); } else { //*****[11/20/2008]Comments are not mandatory for change of status***** //Commented by Ram on 23 Feb 2010 lblErr.Text = ""; _objCamperApp.UpdateStatus(strFJCID, iStatus, strReason, iUserId); return(true); } } else { return(false); } }
protected void btnUpdateStatus_OnClick(object sender, EventArgs e) { DataSet dsChangeDetails = objCamperApplication.GetChangeRequestDetails(strFJCID); structChangeDetails ChangeDetails = new structChangeDetails(); string strReason = txtareaUpdateComments.Text; if (!string.IsNullOrEmpty(strReason)) { if (dsChangeDetails.Tables[0].Rows.Count > 0) { ChangeDetails = objCamperApplication.SetChangeDetailsFromDataRow(dsChangeDetails.Tables[0].Rows[0]); } if (ddlRequestStatus.SelectedValue == Enum.Format(typeof(RequestStatus), RequestStatus.ClosedOrApproved, "D")) { if (sessionModifiedPenFJCApprovalStatus == ChangeDetails.Current_Status.ToString()) { string strNewFJCID = string.Empty; string answers = ConstructCamperAnswers(ChangeDetails.NewSession, ChangeDetails.NewSession_StartDate, ChangeDetails.NewSession_EndDate); objCamperApplication.CopyCamperApplicationForSessionChange(strFJCID, out strNewFJCID, Int32.Parse(secApprovalStatus), Convert.ToInt32(sessionModifiedCreditPending)); Session["FJCID"] = strNewFJCID; objCamperApplication.InsertCamperAnswers(strNewFJCID, answers, iUserID.ToString(), strReason); objCamperApplication.UpdateDetailsOnRequestType(strFJCID, strNewFJCID, ChangeDetails.RequestID, "", "Old application cancelled and new application created with second approval status", iUserID, null, null, Int32.Parse(Enum.Format(typeof(RequestStatus), RequestStatus.ClosedOrApproved, "D"))); } else if (cancellationPendingApprovalStatus == ChangeDetails.Current_Status.ToString()) { string strNewFJCID = string.Empty; objCamperApplication.UpdateStatus(strFJCID, Int32.Parse(cancellationPaymentCreditPending), strReason, iUserID); objCamperApplication.UpdateDetailsOnRequestType(strFJCID, string.Empty, ChangeDetails.RequestID, "", "Cancellation request approved and the payment will be applied for credit.", iUserID, null, null, Int32.Parse(Enum.Format(typeof(RequestStatus), RequestStatus.ClosedOrApproved, "D"))); } } else if (ddlRequestStatus.SelectedValue == Enum.Format(typeof(RequestStatus), RequestStatus.Rejected, "D")) { string strCamperAnswers = string.Empty; if (ChangeDetails.RequestType == 2) { strCamperAnswers = ConstructCamperAnswers(ChangeDetails.OldSession, ChangeDetails.OldSession_StartDate, ChangeDetails.OldSession_EndDate); } objCamperApplication.UpdateDetailsOnRequestType(strFJCID, string.Empty, ChangeDetails.RequestID, strCamperAnswers, string.Empty, iUserID, null, null, Int32.Parse(Enum.Format(typeof(RequestStatus), RequestStatus.Rejected, "D"))); } valobj.InnerHtml = ""; spnComments.Visible = false; string strMessage = ddlRequestStatus.SelectedValue == "3" ? "Request has been approved." : "Request has been rejected."; strScript = "<script language=javascript>" + (strMessage != string.Empty ? "alert('" + strMessage + "');" : string.Empty) + "window.opener.location.href = window.opener.location.href;" + "if (window.opener.progressWindow)" + "{ window.opener.progressWindow.close()" + "} window.close();</script>"; if (!ClientScript.IsStartupScriptRegistered("clientScript")) { ClientScript.RegisterStartupScript(Page.GetType(), "clientScript", strScript); } } else { valobj.InnerHtml = "<ul><li>Please enter comments</li></ul>"; spnComments.Visible = true; } }
void btnChkEligibility_Click(object sender, EventArgs e) { int iStatus, iCampId; string strModifiedBy, strFJCID, strComments; if (Page.IsValid) { bool isReadOnly = objGeneral.IsApplicationReadOnly(hdnFJCIDStep2_3.Value, Master.CamperUserId); //Modified by id taken from the Master Id strModifiedBy = Master.UserId; if (!isReadOnly) { InsertCamperAnswers(); } iCampId = Convert.ToInt32(ddlCamp.SelectedValue); strFJCID = hdnFJCIDStep2_3.Value; //comments used only by the Admin user strComments = txtComments.Text.Trim(); if (strFJCID != "" && strModifiedBy != "") { if (isReadOnly) { DataSet dsApp = CamperAppl.getCamperApplication(strFJCID); iStatus = Convert.ToInt32(dsApp.Tables[0].Rows[0]["Status"]); } else { //to update the camp value to the database (to be used for search functionality) CamperAppl.updateCamp(strFJCID, iCampId, strComments, Convert.ToInt32(Master.CamperUserId)); var objEligibility = EligibilityFactory.GetEligibility(FederationEnum.PJL); objEligibility.checkEligibility(strFJCID, out iStatus); } var checkStatus = (StatusInfo)Convert.ToInt32(Session["STATUS"]); if ((checkStatus == StatusInfo.SystemInEligible || checkStatus == StatusInfo.EligiblePJLottery) && (StatusInfo)iStatus != StatusInfo.SystemInEligible) { iStatus = (int)checkStatus; } Session["STATUS"] = iStatus; if (iStatus == Convert.ToInt32(StatusInfo.EligiblePJLottery)) { var strRedirUrl = "EnterLotteryInfo.aspx"; if (Master.UserId != Master.CamperUserId) //then the user is admin { strRedirUrl = ConfigurationManager.AppSettings["AdminRedirURL"]; } //to update the status to the database if (!isReadOnly) { //CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus); CamperAppl.UpdateStatus(strFJCID, iStatus, "", 0); } // Mark the special code as used var currentCode = Session["SpecialCodeValue"].ToString(); int campYearId = Convert.ToInt32(Application["CampYearID"]); SpecialCodeManager.UseCode(campYearId, Convert.ToInt32(FederationEnum.PJL), currentCode, Session["FJCID"].ToString()); Response.Redirect(strRedirUrl, false); } else if (iStatus == Convert.ToInt32(StatusInfo.SystemInEligible)) { if (!isReadOnly) { CamperAppl.submitCamperApplication(strFJCID, strComments, Convert.ToInt32(strModifiedBy), iStatus); } Response.Redirect("../ThankYou.aspx", false); } else //if he/she is eligible { // 2016-07-06 PJL now has new status Eligible - Registration at Camp for people who ware still waiting for camp registration // in this case, admin will move the status to Eligible when campers actually reigstered for camp. if (RadioButtonQ7Option3.Checked) { Session["STATUS"] = Convert.ToInt32(StatusInfo.EligiblePendingRegistrationCamp); } Session["FJCID"] = hdnFJCIDStep2_3.Value; Response.Redirect("../Step2_1.aspx"); } } } }
void btnSubmitApplication_Click(object sender, EventArgs e) { try { if (Page.IsValid) { if (!chkAgreement.Checked) { lblErrorMsg.Visible = true; return; } if (!objGeneral.IsApplicationReadOnly(hdnFJCID_OtherInfo.Value, Master.CamperUserId)) { ProcessCamperAnswers(); //Send Email to Parent one of the camper. //SendEmailNotification(); //ProcessPJLFile(); if ((Request.Url.Host != "localhost") && (Dns.GetHostAddresses(Request.Url.Host)[0].ToString() == ConfigurationManager.AppSettings["UATIP"])) { string strFolder; strFolder = ConfigurationManager.AppSettings["EmailNotificationFolderPath"]; if (Directory.Exists(strFolder)) { ProcessFile(strFolder); } else { Directory.CreateDirectory(strFolder); ProcessFile(strFolder); } } } // 2014-08-04 var status = (StatusInfo)Convert.ToInt32(Session["STATUS"]); if (status == StatusInfo.WinnerPJLottery) { Session["Status"] = (int)StatusInfo.SystemEligible; CamperAppl.UpdateStatus(Session["FJCID"].ToString(), (int)StatusInfo.SystemEligible, "", 0); } string strRedirURL; if (Master.UserId != Master.CamperUserId) //then the user is admin { strRedirURL = ConfigurationManager.AppSettings["AdminRedirURL"]; } else //the user is Camper { strRedirURL = "ThankYou.aspx"; } Response.Redirect(strRedirURL, false); } } catch (Exception ex) { Response.Write(ex.Message); } }