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); }
private void OnApplicationUpdated_Invoked(object sender, ExternalDataEventArgs e) { // Type cast the event args to the required type RefundApplicationUpdatedEventArgs args = (RefundApplicationUpdatedEventArgs)e; // Retrive the row to be updated (always the frist row i.e. Rows[0]) RefundApplicationRow row = args.UpdatedRefundRows[0]; //using (TransactionScope scope = new TransactionScope()) { // Update the database row IgrssAdapters.RefundApplicationAdapter.UpdateRefundApplication1(this.RefundId, row.OfficeId, row.RegistrationNo, 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, row.ActualStampValue); // Delete all the existing StampDetails for this Refund Application IgrssAdapters.RefundStampDetailsAdapter.DeleteRefundStampDetails(this.RefundId); // Re-Enter the Stamp Details foreach (DataRow StampDetail in args.StampDetails.Rows) { IgrssAdapters.RefundStampDetailsAdapter.InsertStampDetails(this.RefundId, (Guid)StampDetail["RevenueStampId"], (string)StampDetail["ReturnedQty"], (string)StampDetail["StampNumber"]); } // Delete all the existing Acts that were selected for this Refund Application IgrssAdapters.RefundActsApplicable.DeleteRefundOrders(this.RefundId); // Re-Enter the Acts that have been selected foreach (DataRow Act in args.ActsApplicable.Rows) { IgrssAdapters.RefundActsApplicable.InsertRefundActsApplicable(this.RefundId, (Guid)Act["ActId"], (bool)Act["Checked"], ""); } //scope.Complete(); } // The Application has been modified and will require verification from all again FeedbackData CurFeedback = VerificationList[verificationIndex]; WorkflowSupport.DeleteAlerts(CurFeedback.Alerts.ToArray()); this.verificationIndex = 0; }