public ActionResult ApproveRecord(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 approval.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.ERROR, Width = 350 }); return(this.Direct()); } //get current product quantity from Equity Balance table Table Equity_CISRepo.Get_Product_Current_Quantity(Equity_CISRepo); if ((Equity_CISRepo.Order_Quantity) > Equity_CISRepo.Current_Quantity) { X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = "Sorry! Current Quantity is not enough for this transaction.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); return(this.Direct()); } Equity_CISRepo.Approve_Equity_CIS_Sell(Equity_CISRepo); X.Msg.Show(new MessageBoxConfig { Title = "Success", Message = "Order Successfully Approved.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); //ClearControls_Approve(); //Store store = X.GetCmp<Store>("ApproveECIS_SellStore"); //store.Reload(); var pvr = new Ext.Net.MVC.PartialViewResult { ViewName = "Equity_CIS_SellApprovePartial", ContainerId = "MainArea", RenderMode = RenderMode.AddTo, }; this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive(); return(pvr); } catch (Exception ex) { return(this.Direct()); } }
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 transaction has been selected.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.ERROR, Width = 350 }); return(this.Direct()); } //get current product quantity from Equity Balance table Table Equity_CISRepo.Get_Product_Current_Quantity(Equity_CISRepo); //if ((Equity_CISRepo.Order_Quantity) > Equity_CISRepo.Current_Quantity) //{ // X.Msg.Show(new MessageBoxConfig // { // Title = "Error", // Message = "Sorry! Current Quantity is not enough for this transaction.", // 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 // }); //} Equity_CISRepo.Reverse_Equity_CIS_Sell(Equity_CISRepo); X.Msg.Show(new MessageBoxConfig { Title = "Success", Message = "Transaction Successfully Reversed.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); //ClearControls_Reverse(); //Store store = X.GetCmp<Store>("ReverseECIS_SellStore"); //store.Reload(); //return this.Direct(); var pvr = new Ext.Net.MVC.PartialViewResult { ViewName = "Equity_CIS_SellReversePartial", ContainerId = "MainArea", RenderMode = RenderMode.AddTo, }; this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive(); return(pvr); } catch (Exception ex) { return(this.Direct()); } }
public ActionResult SaveRecord(Invest_Equity_CISRepo Equity_CISRepo) { try { if (Equity_CISRepo.isOrderUnique(Equity_CISRepo.Invest_No) == true) { X.Msg.Show(new MessageBoxConfig { Title = "Duplicate", Message = "Order already exist.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); return(this.Direct()); } //get current product quantity from Equity Balance table Table Equity_CISRepo.Get_Product_Current_Quantity(Equity_CISRepo); if ((Equity_CISRepo.Order_Quantity) > Equity_CISRepo.Current_Quantity) { X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = "Sorry! Current Quantity is not enough for this transaction.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); return(this.Direct()); } 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! Date must be equal to scheme working date of " + GlobalValue.Scheme_Today_Date.Date.ToString(), 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 }); } if (ModelState.IsValid) { this.Equity_CISRepo.sellSaveRecord(Equity_CISRepo); X.Msg.Show(new MessageBoxConfig { Title = "Success", Message = "Order Successfully Processed.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); //ClearControls(); // Store store = X.GetCmp<Store>("ecis_SellSFStore"); // store.Reload(); // return this.Direct(); var pvr = new Ext.Net.MVC.PartialViewResult { ViewName = "Equity_CIS_SellPartial", ContainerId = "MainArea", RenderMode = RenderMode.AddTo, }; this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive(); return(pvr); } else { string messages = string.Join(Environment.NewLine, ModelState.Values .SelectMany(x => x.Errors) .Select(x => x.ErrorMessage)); X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = messages, // " Insufficient data. Operation Aborted", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.ERROR, Width = 350 }); return(this.Direct()); } } catch (Exception ex) { throw ex; } }