if (ApplicationId > 0)
{
string Message = string.Empty;
CourtApplicationDisposalsDTO courtApplicationDisposalsDTO = new CourtApplicationDisposalsDTO();
if (courtApplicationDisposalsDTO != null)
{
courtApplicationDisposalsDTO.DisposalsId = DisposalsId;
courtApplicationDisposalsDTO.ApplicationId = ApplicationId;
if (!string.IsNullOrWhiteSpace(txtDateOfFinalJudgement.Text))
{
courtApplicationDisposalsDTO.DtFinalJudOrder = Convert.ToDateTime(txtDateOfFinalJudgement.Text);
//set disposal based on final order date
courtApplicationDisposalsDTO.IsDisposed = true;
}
else
{
courtApplicationDisposalsDTO.IsDisposed = false;
}
if (Convert.ToInt64(ddlCourtNames.SelectedValue) > 0)
{
courtApplicationDisposalsDTO.CourtId = Convert.ToInt64(ddlCourtNames.SelectedValue);
}
if (Convert.ToInt64(ddlOverallResult.SelectedValue) > 0)
{
courtApplicationDisposalsDTO.CourtResult = Convert.ToInt64(ddlOverallResult.SelectedValue);
}
//Update
if (courtApplicationDisposalsDTO.DisposalsId > 0)
{
courtApplicationDisposalsDTO.UpdatedBy = CurrentUser.UserId;
courtApplicationDisposalsDTO.UpdatedIPAddress = CurrentUser.IpAddress;
Message = "Disposal Details Updated Successfully";
}
else//Insert
{
courtApplicationDisposalsDTO.CreatedBy = CurrentUser.UserId;
courtApplicationDisposalsDTO.CreatedIPAddress = CurrentUser.IpAddress;
Message = "Disposal Details saved Successfully";
}
//Insert or Update
long retDisposalsId = 0;
using (var client = ServiceClient<ICourtApplicationManager>.Create(ObjectConstants.CourtApplicationManager))
{
retDisposalsId = client.Instance.InsertOrUpdateCourtApplicationDisposals(courtApplicationDisposalsDTO);
}
if (retDisposalsId > 0)
{
SetFadeMesssage(Message);
}
else
{
SetModalPopupMesssage("Error", "Disposal Details Failed to Save...");
}
DisposalsId = retDisposalsId;
//Refresh UI.
LoadUI();
}
}
else
{
SetModalPopupMesssage("Error", "No Application Found...");
}
No comments:
Post a Comment