public ActionResult ReverseRecord(Invest_Equity_CISRepo Equity_CISRepo) { try { if (string.IsNullOrEmpty(Equity_CISRepo.Invest_No)) { X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = "Sorry! No Order has been selected for reversal.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.ERROR, Width = 350 }); return(this.Direct()); } //get GL balance from GL_Account Table Equity_CISRepo.Get_GL_Balance(Equity_CISRepo); //if ((Equity_CISRepo.GL_Balance * -1) < Equity_CISRepo.Total_Cost) //{ // X.Msg.Show(new MessageBoxConfig // { // Title = "Error", // Message = "Sorry! Insufficient Cash in Scheme Account.", // Buttons = MessageBox.Button.OK, // Icon = MessageBox.Icon.INFO, // Width = 350 // }); // return this.Direct(); //} GlobalValue.Get_Scheme_Today_Date(Equity_CISRepo.Scheme_Id); //if (!string.IsNullOrEmpty(Equity_CISRepo.Scheme_Id)) //{ // GlobalValue.Get_Scheme_Today_Date(Equity_CISRepo.Scheme_Id); // if (Equity_CISRepo.Order_Date != GlobalValue.Scheme_Today_Date) // { // X.Msg.Show(new MessageBoxConfig // { // Title = "Error", // Message = "Sorry! This transaction can not be reversed. Process aborted", // Buttons = MessageBox.Button.OK, // Icon = MessageBox.Icon.INFO, // Width = 350 // }); // return this.Direct(); // } //} //else //{ // X.Msg.Show(new MessageBoxConfig // { // Title = "Error", // Message = "Scheme cannot be verified.", // Buttons = MessageBox.Button.OK, // Icon = MessageBox.Icon.INFO, // Width = 350 // }); //} // update Invest_Equity table //Update Invest_Equity_Balance table Equity_CISRepo.Reverse_Equity_CIS(Equity_CISRepo); X.Msg.Show(new MessageBoxConfig { Title = "Success", Message = "Order Successfully Reversed.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); var pvr = new Ext.Net.MVC.PartialViewResult { ViewName = "Equity_CISReversePartial", ContainerId = "MainArea", RenderMode = RenderMode.AddTo, }; this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive(); return(pvr); } catch (Exception ex) { return(this.Direct()); } }