public void UpdateRefundApplication(Guid InstanceId, RefundApplicationUpdatedEventArgs args) { if (null != RefundApplicationUpdated) { RefundApplicationUpdated(null, args); } }
/// <summary> /// Updating RefundApplication records /// </summary> /// <param name="Parameter">Formview parameter</param> /// <param name="StampDetails">Datatable of stampdetails</param> /// <param name="ActsApplicable">Datatable of ActsApplicable</param> /// <param name="RefundApplicationId">The Primary key of RefundApplication table</param> /// <param name="AlertId">AlertId</param> /// <param name="Verified">Verified</param> /// <returns>true, a record updated sucessfully</returns> public bool UpdateRefundApplicationNew(FormViewParameter Parameter, DataTable StampDetails, DataTable ActsApplicable, Guid RefundApplicationId, Guid AlertId, bool Verified) { string curUser = Thread.CurrentPrincipal.Identity.Name; try { #region This functionality must be done in Workflow //IGRSS.DataAccessLayer.Refund.RefundApplicationRow row = (RefundApplicationRow) Parameter.Values; //IgrssAdapters.RefundApplicationAdapter.UpdateRefundApplication(RefundApplicationId, row.OfficeId, row.RegistrationNo, // row.RefundPrefix, row.RefundSlNo, row.RefundYear, row.TypeOfRefund, row.ApplicationDate, row.VendorLicenseId, // row.PurchasedDate, row.TotalValueOfStamps, row.ReasonForNotUsing, row.ApplicantName, row.ApplicantAddress, // row.City, row.District, row.PinCode, row.PhoneNo, row.Remarks); //IgrssAdapters.RefundStampDetailsAdapter.DeleteRefundStampDetails(RefundApplicationId); //foreach (DataRow StampDetail in StampDetails.Rows) //{ // IgrssAdapters.RefundStampDetailsAdapter.InsertStampDetails(RefundApplicationId, (Guid) StampDetail["RevenueStampId"], (string) StampDetail["ReturnedQty"], (string) StampDetail["StampNumber"]); //} //IgrssAdapters.RefundActsApplicable.DeleteRefundOrders(RefundApplicationId); //foreach (DataRow Act in ActsApplicable.Rows) //{ // IgrssAdapters.RefundActsApplicable.InsertRefundActsApplicable(RefundApplicationId, (Guid) Act["ActId"], (bool) Act["Checked"], ""); //} #endregion // Get the Workflow Instance Id from table Guid WfInstanceId = (Guid)IgrssAdapters.RefundApplicationAdapter.GetWorkflowInstanceById(RefundApplicationId); // Check if the user has verified the application or just updated if (Verified) { // Create the FeedbackEventArgs object FeedbackEventArgs args = new FeedbackEventArgs(WfInstanceId, AlertId, curUser); WorkflowMediator.RefundServices.ValidateRefundApplication(WfInstanceId, args); } else { // The record has not been verified just updated RefundApplicationUpdatedEventArgs args = new RefundApplicationUpdatedEventArgs(WfInstanceId, (RefundApplicationRow)Parameter.Values, StampDetails, ActsApplicable); WorkflowMediator.RefundServices.UpdateRefundApplication(WfInstanceId, args); } } catch (Exception ex) { if (ExceptionPolicy.HandleException(ex, "DAL")) throw; } return true; }