public ActionResult ApproveRecord(string RECEIPT_ID, Remit_ReceiptRepo ReceiptRepo)
        {
            try
            {
                if (RECEIPT_ID == string.Empty)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No 'Receipt' has been selected for approval.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }
                GlobalValue.Get_Scheme_Today_Date(ReceiptRepo.Scheme_Id);

                if (ReceiptRepo.ApproveReceiptRecord(RECEIPT_ID, ReceiptRepo))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Success",
                        Message = "Receipt Successfully Approved.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    ClearControls_Approve();
                    Store store = X.GetCmp <Store>("receiptStore");
                    store.Reload();

                    return(this.Direct());
                }
                else
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Operation  failed.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }
            }
            catch (Exception ex)
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = "Error in approving payment. process aborted. Contact system admin.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.ERROR,
                    Width   = 350
                });
                return(this.Direct());
            }
        }
示例#2
0
        public ActionResult CloseRecord(string ESF_ID, string Scheme_Id)
        {
            try
            {
                if (ESF_ID == string.Empty)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No 'Employee Scheme_Fund' has been selected for closure.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (!string.IsNullOrEmpty(Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(Scheme_Id);
                }
                else
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Scheme cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                ESFRepo.CloseESFRecord(ESF_ID);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Employee Scheme_Fund Successfully Closed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                ClearControls_Close();
                Store store = X.GetCmp <Store>("CloseesfStore");
                store.Reload();

                return(this.Direct());
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
        //  Approve Contribution
        public bool ApprovedRecord(Remit_Contribution_Trans_LogRepo conLogRepo)
        {
            try
            {
                //get scheme_today_date
                GlobalValue.Get_Scheme_Today_Date(conLogRepo.Scheme_Id);

                //Get Connection
                AppSettings app = new AppSettings();
                con = app.GetConnection();
                DynamicParameters param = new DynamicParameters();

                param.Add("p_Con_Id", conLogRepo.Con_Log_Id, DbType.String, ParameterDirection.Input);
                param.Add("p_Total_Contribution", conLogRepo.Total_Contribution, DbType.Decimal, ParameterDirection.Input);
                param.Add("p_Con_Balance", conLogRepo.Total_Contribution, DbType.Decimal, ParameterDirection.Input);
                param.Add("p_Total_Balance", conLogRepo.Total_Contribution, DbType.Decimal, ParameterDirection.Input);
                param.Add("p_Auth_Id", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);
                //param.Add("p_Auth_Date", value: GlobalValue.Scheme_Today_Date, dbType: DbType.Date, direction: ParameterDirection.Input);
                param.Add("p_LOG_STATUS", "ACTIVE", DbType.String, ParameterDirection.Input);
                param.Add("p_AUTH_STATUS", "AUTHORIZED", DbType.String, ParameterDirection.Input);
                param.Add("p_REQ_STATUS", "ACTIVE", DbType.String, ParameterDirection.Input);
                param.Add("p_EmpNo", conLogRepo.Total_Contribute, DbType.Decimal, ParameterDirection.Input);
                int result = con.Execute(sql: "UPD_REMIT_CONLOG_FORAPPOVAL", param: param, commandType: CommandType.StoredProcedure);



                if (result < 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                    if (con != null)
                    {
                        con = null;
                    }
                }
            }
        }
示例#4
0
        public ActionResult ApproveRecord(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if (WithdrawalRepo.PortOut_No == string.Empty)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No record has been selected for approval.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);

                ///approve pending withdrawal

                WithdrawalRepo.Approve_Unit_PortOut(WithdrawalRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Porting Out Successfully Approved.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_Approve();
                //Store store = X.GetCmp<Store>("ApproveRequestPortOutStore");
                //store.Reload();

                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "PortOutApprovePartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#5
0
        public ActionResult ApprovedRetmit_Record(Remit_Contribution_Upload_LogRepo conLogRepo)
        {
            try
            {
                if (!string.IsNullOrEmpty(conLogRepo.Con_Log_Id))
                {
                    //check if pending list exist for employer
                    var app = new AppSettings();
                    con = app.GetConnection();

                    GlobalValue.Get_Scheme_Today_Date(conLogRepo.Scheme_Id);

                    if (this.RemitConRepo.ApprovedRecord(conLogRepo))
                    {
                        X.Mask.Hide();
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Success",
                            Message = "Remittance batch upload approved succesfully.",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        ClearControls();
                    }
                    return(this.Direct());
                }
                else
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Select a batch to approve.", // " Insufficient data. Operation Aborted",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }
                //return this.Direct();
            }
            catch (Exception ex)
            {
                X.Mask.Hide();
                throw ex;
            }
        }
        public void SaveRecord(Remit_ReceiptRepo ReceiptRepo)
        {
            GlobalValue.Get_Scheme_Today_Date(ReceiptRepo.Scheme_Id);
            //put trans scope here

            try
            {
                //Get Connection
                AppSettings app = new AppSettings();
                con = app.GetConnection();
                DynamicParameters param = new DynamicParameters();

                param.Add(name: "P_RECEIPT_ID", value: ReceiptRepo.Receipt_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_ES_ID", value: ReceiptRepo.ES_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_TRANS_AMOUNT", value: ReceiptRepo.Trans_Amount, dbType: DbType.Decimal, direction: ParameterDirection.Input);
                param.Add(name: "P_ACTUAL_RECEIPT_DATE", value: ReceiptRepo.Actual_Receipt_Date, dbType: DbType.DateTime, direction: ParameterDirection.Input);
                param.Add(name: "P_NARRATION", value: ReceiptRepo.Narration, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_NARRATION_SYSTEM", value: ReceiptRepo.Narration, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_PAYMENT_MODE", value: ReceiptRepo.Payment_Mode, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_INSTRUMENT_NO", value: ReceiptRepo.Instrument_No, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_MAKER_ID", value: GlobalValue.User_ID, dbType: DbType.String, direction: ParameterDirection.Input);
                param.Add(name: "P_MAKE_DATE", value: GlobalValue.Scheme_Today_Date, dbType: DbType.DateTime, direction: ParameterDirection.Input);

                con.Execute("MIX_REMIT_RECEIPT", param, commandType: CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                    if (con != null)
                    {
                        con = null;
                    }
                }
            }
        }
        public ActionResult GetSchemeDate(EndOfDayRepo EODRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(EODRepo.Scheme_Id))
                {
                }

                else
                {
                    GlobalValue.Get_Scheme_Today_Date(EODRepo.Scheme_Id);
                    this.GetCmp <DateField>("EOD_Scheme_Today_Date").SetValue(GlobalValue.Scheme_Today_Date);
                    EODRepo.GetSchemeList(EODRepo);
                    this.GetCmp <TextField>("txtschemeEOD").SetValue(EODRepo.Scheme_Name);
                }
                return(this.Direct());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public ActionResult DeleteRetmit_Record(Remit_Contribution_Upload_LogRepo conLogRepo)
        {
            try
            {
                if (!string.IsNullOrEmpty(conLogRepo.Con_Log_Id))
                {
                    //check if pending list exist for employer
                    var app = new AppSettings();
                    con = app.GetConnection();

                    if (conLogRepo.isValidDelete(conLogRepo.Con_Log_Id) == true)
                    {
                        X.Mask.Hide();
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! There is a pending purchase for this schedule. Process aborted.",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });
                        return(this.Direct());
                    }

                    GlobalValue.Get_Scheme_Today_Date((conLogRepo.Scheme_Id));

                    if (this.RemitConRepo.DeleteRecord(conLogRepo))
                    {
                        X.Mask.Hide();
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Success",
                            Message = "Remittance batch upload deleted succesfully.",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        ClearControls();
                    }
                    return(this.Direct());
                }
                else
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Select a batch to delete.", // " Insufficient data. Operation Aborted",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }
                //return this.Direct();
            }
            catch (Exception ex)
            {
                X.Mask.Hide();
                string ora_code = ex.Message.Substring(0, 9);
                if (ora_code == "ORA-20000")
                {
                    ora_code = "Record already exist. Process aborted..";
                }
                else if (ora_code == "ORA-20100")
                {
                    ora_code = "Not all records are supplied. Process aborted..";
                }
                else
                {
                    ora_code = ex.ToString();
                }
                X.Mask.Hide();
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = ora_code,
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                // log.Write(level: Serilog.Events.LogEventLevel.Information, messageTemplate: ex.Message + " " + DateTime.Now);
                return(this.Direct());
            }
        }
        public ActionResult RunEOD(EndOfDayRepo EODRepo)
        {
            // if (ModelState.IsValid)

            {
                if (string.IsNullOrEmpty(EODRepo.Scheme_Id))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! Scheme must be selected",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    return(this.Direct());
                }


                EODRepo.GetSystemDate(EODRepo);

                if (EODRepo.Scheme_Today_Date > EODRepo.System_Date)
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! End of Day can not be ran for.  " + EODRepo.Scheme_Name + ". System Date is invalid",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (!string.IsNullOrEmpty(EODRepo.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(EODRepo.Scheme_Id);
                    EODRepo.Scheme_Today_Date = GlobalValue.Scheme_Today_Date;
                    if (EODRepo.Scheme_Today_Date != EODRepo.Confirm_Date)
                    {
                        X.Mask.Hide();
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Wrong Date " + EODRepo.Scheme_Name,
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });
                        return(this.Direct());
                    }
                }
                else
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Scheme cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }


                if (EODRepo.Scheme_Today_Date != EODRepo.Confirm_Date)
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! Wrong Date " + EODRepo.Scheme_Name,
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                //if (EODRepo.RunEOD(EODRepo) == true)
                var app = new AppSettings();

                TransactionOptions tsOp = new TransactionOptions();
                tsOp.IsolationLevel = System.Transactions.IsolationLevel.Snapshot;
                TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew, tsOp);
                tsOp.Timeout = TimeSpan.FromMinutes(120000);

                using (OracleConnection conn = new OracleConnection(app.conString()))  //
                {
                    try
                    {
                        conn.Open();


                        //Check if not end of year.

                        var paramRed = new DynamicParameters();
                        // paramRed.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramRed.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramRed.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_IS_EOY", paramRed, commandType: CommandType.StoredProcedure);
                        int redem = paramRed.Get <int>("VDATA");
                        if (redem > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Sorry! Please run End Of Year." + Environment.NewLine + "Proces aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }


                        //Payment
                        var paramRe = new DynamicParameters();
                        paramRe.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramRe.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramRe.Add("VDATA", null, DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_PENDING_PAYMENT", paramRe, commandType: CommandType.StoredProcedure);
                        int receipt = paramRe.Get <int>("VDATA");
                        if (receipt > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Pending Payment exist for this Scheme." + Environment.NewLine + "Process aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }

                        //Purchases
                        var paramPu = new DynamicParameters();
                        paramPu.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramPu.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramPu.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_PENDING_PURCHASE", paramPu, commandType: CommandType.StoredProcedure);
                        int purchase = paramPu.Get <int>("VDATA");
                        if (purchase > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Pending Unit Purchase exist for this Scheme." + Environment.NewLine + "Process aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }

                        ////Redemption
                        //var paramRed = new DynamicParameters();
                        //paramRed.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        //paramRed.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        //paramRed.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        //conn.Execute("EOD_PENDING_REDEMPTION", paramRed, commandType: CommandType.StoredProcedure);
                        //int redem = paramRed.Get<int>("VDATA");
                        //if (redem > 0)
                        //{
                        //    X.Mask.Hide();
                        //    X.Msg.Show(new MessageBoxConfig
                        //    {
                        //        Title = "Error",
                        //        Message = "Pending Redemption exists for this Scheme." + Environment.NewLine + "Proces aborted",
                        //        Buttons = MessageBox.Button.OK,
                        //        Icon = MessageBox.Icon.ERROR,
                        //        Width = 350
                        //    });
                        //    return this.Direct();
                        //}
                        // GL(Journal)

                        var paramJo = new DynamicParameters();
                        paramJo.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramJo.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramJo.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_PENDING_JOURNAL", paramJo, commandType: CommandType.StoredProcedure);
                        int journal = paramJo.Get <int>("VDATA");
                        if (journal > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Pending Journal exist for this Scheme." + Environment.NewLine + "Process aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }

                        //check for pending investments - TBILL / MM
                        var paramIn = new DynamicParameters();
                        paramIn.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramIn.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramIn.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_PENDING_MMTB", paramIn, commandType: CommandType.StoredProcedure);
                        int MM = paramIn.Get <int>("VDATA");
                        if (MM > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Pending Money Market / T-Bill / Bond exist for this Scheme." + Environment.NewLine + "Process aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }

                        //check for pending investments - EQUITY / CIS
                        var paramInE = new DynamicParameters();
                        paramInE.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramInE.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramInE.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_PENDING_EQCIS", paramInE, commandType: CommandType.StoredProcedure);
                        int MME = paramInE.Get <int>("VDATA");
                        if (MME > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Pending Equity / CIS exist for this Scheme." + Environment.NewLine + "Process aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }

                        // check uquity prices AND CIS prices
                        var paramInEp = new DynamicParameters();
                        paramInEp.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramInEp.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramInEp.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_PENDING_EQPRICES", paramInEp, commandType: CommandType.StoredProcedure);
                        int MMEpp = paramInEp.Get <int>("VDATA");
                        if (MMEpp > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Sorry, Equity/CIS prices are required for " + EODRepo.Scheme_Today_Date + Environment.NewLine + "Process aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }


                        // check pending PortIns
                        var paramInEpPortin = new DynamicParameters();
                        paramInEpPortin.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramInEpPortin.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramInEpPortin.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_PENDING_PORTINGIN", paramInEpPortin, commandType: CommandType.StoredProcedure);
                        int MMEppPortin = paramInEpPortin.Get <int>("VDATA");
                        if (MMEppPortin > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Sorry, Pending Port-In exist for this scheme. Process aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }

                        // check pending benefit tranfer to employer
                        var paramInEpPortinEmp = new DynamicParameters();
                        paramInEpPortinEmp.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramInEpPortinEmp.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramInEpPortinEmp.Add("VDATA", "", DbType.Int32, ParameterDirection.Output);
                        conn.Execute("EOD_PENDING_BTOE", paramInEpPortinEmp, commandType: CommandType.StoredProcedure);
                        int MMEppPortinEmp = paramInEpPortinEmp.Get <int>("VDATA");
                        if (MMEppPortinEmp > 0)
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Sorry, Pending Benfit Transfer to Emplpyer exist for this scheme. Process aborted",
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.ERROR,
                                Width   = 350
                            });
                            return(this.Direct());
                        }


                        //Accrue investment interest -- HIT RECEIVABLE AND INVESTMENT INC0ME WITH ACCRUALS
                        var paramMMA = new DynamicParameters();
                        paramMMA.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramMMA.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramMMA.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input);
                        conn.Execute("EOD_ACCRUE_MMTBIL", paramMMA, commandType: CommandType.StoredProcedure);

                        //check for bonds interest payment
                        var paramMMAMb = new DynamicParameters();
                        paramMMAMb.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramMMAMb.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramMMAMb.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input);
                        conn.Execute("EOD_BOND_INT_PAY", paramMMAMb, commandType: CommandType.StoredProcedure);


                        //check for securities maturity and ?rollovers
                        var paramMMAM = new DynamicParameters();
                        paramMMAM.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramMMAM.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramMMAM.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input);
                        conn.Execute("EOD_ACCRUE_MMTBILMATURITY", paramMMAM, commandType: CommandType.StoredProcedure);



                        //VALUE EQUITY /CIS
                        //update gl_account_table
                        var paramVEQUI = new DynamicParameters();
                        paramVEQUI.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramVEQUI.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramVEQUI.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input);
                        conn.Execute("EOD_VALUE_EQUITY", paramVEQUI, commandType: CommandType.StoredProcedure);

                        //update portfolio report tables
                        var paramVEQUIr = new DynamicParameters();
                        paramVEQUIr.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramVEQUIr.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        paramVEQUIr.Add("P_MAKER_ID", GlobalValue.User_ID, DbType.String, ParameterDirection.Input);
                        conn.Execute("EOD_PORT_REPORTS", paramVEQUIr, commandType: CommandType.StoredProcedure);


                        //ACCRUE AND APPLY FEES EOD_ACCRUE_SF_FEES
                        var paramACCAPP = new DynamicParameters();
                        paramACCAPP.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramACCAPP.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_ACCRUE_SF_FEES", paramACCAPP, commandType: CommandType.StoredProcedure);


                        //ACCRUE AND APPLY FUND MANAGER FEES
                        var paramFMACCAPP = new DynamicParameters();
                        paramFMACCAPP.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramFMACCAPP.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_ACCRUE_FM_FEES", paramFMACCAPP, commandType: CommandType.StoredProcedure);

                        //update total unit
                        var paramUPPoo = new DynamicParameters();
                        paramUPPoo.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        //paramUPPoo.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_UPD_SF", paramUPPoo, commandType: CommandType.StoredProcedure);


                        //calculate unit price

                        var paramUPP = new DynamicParameters();
                        paramUPP.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramUPP.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_CAL_U_PRICE", paramUPP, commandType: CommandType.StoredProcedure);

                        //log unit price / NAV / AUM PER SCHEME FUND for next day
                        var paramMMAUMUP = new DynamicParameters();
                        paramMMAUMUP.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramMMAUMUP.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_LOG_UNITP", paramMMAUMUP, commandType: CommandType.StoredProcedure);


                        // Apply surchage on contributions due for surchage
                        DynamicParameters param = new DynamicParameters();
                        param.Add(name: "P_SCHEME_ID", value: EODRepo.Scheme_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                        param.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_SURCHARGE_CON_LOG", param, commandType: CommandType.StoredProcedure);


                        // move today date to next date
                        DynamicParameters parama = new DynamicParameters();
                        parama.Add(name: "P_SCHEME_ID", value: EODRepo.Scheme_Id, dbType: DbType.String, direction: ParameterDirection.Input);
                        parama.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_NEXT_DATE", parama, commandType: CommandType.StoredProcedure);

                        // flag retired
                        var paramTBU = new DynamicParameters();
                        paramTBU.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramTBU.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("Z_UNCLAIMED", paramTBU, commandType: CommandType.StoredProcedure);

                        // RENEW EMAIL SENDING -STATEMENT
                        var paramEMAIL = new DynamicParameters();
                        paramEMAIL.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramEMAIL.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_EMAIL_SEND_RENEW", paramEMAIL, commandType: CommandType.StoredProcedure);

                        // RENEW EMAIL SENDING - LOGIN
                        var paramEMAILLOGIN = new DynamicParameters();
                        paramEMAILLOGIN.Add("P_SCHEME_ID", EODRepo.Scheme_Id, DbType.String, ParameterDirection.Input);
                        paramEMAILLOGIN.Add("P_VALUE_DATE", EODRepo.Scheme_Today_Date, DbType.Date, ParameterDirection.Input);
                        conn.Execute("EOD_EMAIL_SEND_RENEW_LOGIN", paramEMAILLOGIN, commandType: CommandType.StoredProcedure);


                        ts.Complete();
                        {
                            X.Mask.Hide();
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Success",
                                Message = "END OF DAY SUCCESSFULLY EXECUTED FOR  " + EODRepo.Scheme_Name,
                                Buttons = MessageBox.Button.OK,
                                Icon    = MessageBox.Icon.INFO,
                                Width   = 350
                            });
                            var x = X.GetCmp <FormPanel>("frmEOD");
                            x.Reset();
                            return(this.Direct());
                        }
                    }

                    catch (Exception ex)
                    {
                        X.Mask.Hide();
                        throw ex;
                    }
                    finally
                    {
                        X.Mask.Hide();
                        ts.Dispose();
                        if (conn.State == ConnectionState.Open)
                        {
                            X.Mask.Hide();
                            conn.Close();
                        }
                    }
                }
            }
        }
        public ActionResult ReverseRecord(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if (WithdrawalRepo.Withdrawal_No == string.Empty)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No Port In has been selected for reversal.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(WithdrawalRepo.Reverse_Reason))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Reversal Reason is required.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                WithdrawalRepo.GetESFList(WithdrawalRepo.ESF_Id);

                GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);

                //// validate scheme date
                //if (!string.IsNullOrEmpty(WithdrawalRepo.Scheme_Id))
                //{
                //    GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);
                //    if (WithdrawalRepo.Trans_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 = "Employee account cannot be verified.",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350

                //    });
                //}
                ///reverse port in

                WithdrawalRepo.Reverse_Unit_PortIn(WithdrawalRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Porting In Successfully Reversed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "PortInReversePartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public ActionResult ReassignSaveRecord(pfm_SchemeRepo pfm_schemerepo)
        {
            var log = new LoggerConfiguration().WriteTo.Seq("http://localhost:5341").CreateLogger();

            try
            {
                GlobalValue.Get_Scheme_Today_Date(pfm_schemerepo.Scheme_Id);

                pfm_schemerepo.Maker_Id    = GlobalValue.User_ID;
                pfm_schemerepo.Make_Date   = GlobalValue.Scheme_Today_Date;
                pfm_schemerepo.Maker_Id    = GlobalValue.User_ID;
                pfm_schemerepo.Update_Date = GlobalValue.Scheme_Today_Date;
                if (ModelState.IsValid)
                {
                    if (string.IsNullOrEmpty(pfm_schemerepo.Scheme_Id))
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Please select a record to re-assign a different custodian.",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.ERROR,
                            Width   = 350
                        });
                        return(this.Direct());
                    }

                    this.schemerepo.ReassignSaveRecord(pfm_schemerepo);

                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Success",
                        Message = "Saved Successfully.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    Store store = X.GetCmp <Store>("ReassignSchemeStore");
                    store.Reload();
                    var reset = X.GetCmp <FormPanel>("ReassignSchemePan");
                    reset.Reset();

                    return(this.Direct());
                }
                string messages = string.Join(Environment.NewLine, ModelState.Values.SelectMany(x => x.Errors).Select(x => x.ErrorMessage).FirstOrDefault());
                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)
            {
                string ora_code = ex.Message.Substring(0, 9);
                if (ora_code == "ORA-20000")
                {
                    ora_code = "Record already exist. Process aborted..";
                }
                else if (ora_code == "ORA-20100")
                {
                    ora_code = "Record is uniquely defined in the system. Process aborted..";
                }
                else
                {
                    ora_code = ex.ToString();
                }
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = ora_code,
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                log.Write(level: Serilog.Events.LogEventLevel.Information, messageTemplate: ex.Message + " " + DateTime.Now);
                return(this.Direct());
            }
            finally
            {
            }
        }
示例#12
0
        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;
            }
        }
        //public ActionResult AddReversePurchaseTab(string containerId = "MainArea")
        //{
        //    var pvr = new Ext.Net.MVC.PartialViewResult
        //    {
        //        ViewName = "ReversePurchasePartial",
        //        ContainerId = containerId,
        //        RenderMode = RenderMode.AddTo,
        //    };
        //    this.GetCmp<TabPanel>(containerId).SetLastTabAsActive();
        //    return pvr;
        //}


        public ActionResult SaveRecord_Port(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if ((WithdrawalRepo.Employee_Amount + WithdrawalRepo.Employee_Amount) <= 0)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Total port-in amount must be more than 0",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (!WithdrawalRepo.Trans_Date.HasValue)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry!Invalid Date",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                // validate scheme date
                if (!string.IsNullOrEmpty(WithdrawalRepo.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);
                    if (WithdrawalRepo.Trans_Date != GlobalValue.Scheme_Today_Date)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry!Date must be equal to scheme working date ",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }
                }
                else
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Employee account cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }


                if (string.IsNullOrEmpty(WithdrawalRepo.Previous_Trustee))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Previous Trustee is a required field",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(WithdrawalRepo.GL_Account_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Receiving Account is a required field",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }


                WithdrawalRepo.GetESFList(WithdrawalRepo.ESF_Id);


                if (WithdrawalRepo.ESF_Id != null)
                {
                    this.WithdrawalRepo.SaveRecord_Port(WithdrawalRepo);

                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Success",
                        Message = "Port In Successfully Processed.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    var pvr = new Ext.Net.MVC.PartialViewResult
                    {
                        ViewName    = "PortInPartial",
                        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;
            }
        }
        //Reverse benefit payment
        public ActionResult ReversePayRecord(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(WithdrawalRepo.Withdrawal_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No Benefit has been selected for reversal.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(WithdrawalRepo.Reverse_Reason))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please enter Reason for Reversal. Process aborted",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                //// validate scheme date
                //if (!string.IsNullOrEmpty(WithdrawalRepo.Scheme_Id))
                //{
                GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);
                //    if (WithdrawalRepo.Pay_Date_Benefit != 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 = "Employee account cannot be verified.",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350

                //    });
                //}

                WithdrawalRepo.Reverse_Unit_Withdrawal(WithdrawalRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Benefit Paid Successfully Reversed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_Reverse();
                //Store store = X.GetCmp<Store>("ReverseRequestWithStore");
                //store.Reload();

                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "WithdrawalReversePartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public ActionResult ReverseRecord(Remit_ReceiptRepo ReceiptRepo)
        {
            try
            {
                if (ReceiptRepo.Receipt_Id == string.Empty)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No 'Receipt' has been selected for Reversal.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                GlobalValue.Get_Scheme_Today_Date(ReceiptRepo.Scheme_Id);

                //if (!string.IsNullOrEmpty(ReceiptRepo.Scheme_Id))
                //{
                //    GlobalValue.Get_Scheme_Today_Date(ReceiptRepo.Scheme_Id);
                //    if (ReceiptRepo.Actual_Receipt_Date != GlobalValue.Scheme_Today_Date)
                //    {
                //        X.Msg.Show(new MessageBoxConfig
                //        {
                //            Title = "Error",
                //            Message = "Sorry! This transaction can not be reversed. Process aborted" + 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 = "Employer Scheme cannot be verified.",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350

                //    });
                //    return this.Direct();

                //}


                if (string.IsNullOrEmpty(ReceiptRepo.Reverse_Reason))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Reason is required.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                //if (!string.IsNullOrEmpty(ReceiptRepo.ES_Id))
                //{
                //    ReceiptRepo.Scheme_Id = ReceiptRepo.ES_Id.Substring(ReceiptRepo.ES_Id.Length - 2);
                //}
                //if (!string.IsNullOrEmpty(ReceiptRepo.Scheme_Id))
                //{
                //    GlobalValue.Get_Scheme_Today_Date(ReceiptRepo.Scheme_Id);
                //}

                if (ReceiptRepo.ReverseReceiptRecord(ReceiptRepo))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Success",
                        Message = "Receipt Successfully Reversed.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    ClearControls_Reverse();
                    Store store = X.GetCmp <Store>("RreceiptStore");
                    store.Reload();

                    return(this.Direct());
                }
                else
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Operation  failed.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }
            }
            catch (Exception ex)
            {
                return(this.Direct());
            }
        }
示例#16
0
        // reverse port out
        public ActionResult ReverseRecord(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(WithdrawalRepo.PortOut_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No record has been selected for Payment.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(WithdrawalRepo.GL_Account_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Problem with Bank Account.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }
                if (string.IsNullOrEmpty(WithdrawalRepo.Reverse_Reason))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Reason for Reversal is required",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                //  WithdrawalRepo.GetESFList(WithdrawalRepo.ESF_Id);

                //get GL balance from GL_Account Table
                WithdrawalRepo.Get_GL_Balance(WithdrawalRepo);

                //if (WithdrawalRepo.Total_Benefit > WithdrawalRepo.GL_Balance * -1)
                //{
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "Sorry! Insufficient Account Balance.Process aborted.",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.ERROR,
                //        Width = 350
                //    });
                //    return this.Direct();
                //}


                //if (string.IsNullOrEmpty(WithdrawalRepo.Payment_Mode))
                //{
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "Payment Mode is required",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.ERROR,
                //        Width = 350
                //    });
                //    return this.Direct();
                //}

                //if (!WithdrawalRepo.Pay_Date_Benefit.HasValue)
                //{
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "Payment Date is required",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350
                //    });

                //    return this.Direct();
                //}

                ///pay pending withdrawal
                ///
                //if (!string.IsNullOrEmpty(WithdrawalRepo.Scheme_Id))
                //{
                GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);
                //    if (WithdrawalRepo.Pay_Date_Benefit != GlobalValue.Scheme_Today_Date)
                //    {
                //        X.Mask.Hide();
                //        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.Mask.Hide();
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "Scheme cannot be verified.",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350

                //    });
                //}

                WithdrawalRepo.Reverse_Unit_PortOut(WithdrawalRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Port-Out Successfully Reversed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_Reverse();
                //Store store = X.GetCmp<Store>("ReverseRequestPortOutStore");
                //store.Reload();

                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "PortOutReversePartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //public ActionResult AddReversePurchaseTab(string containerId = "MainArea")
        //{
        //    var pvr = new Ext.Net.MVC.PartialViewResult
        //    {
        //        ViewName = "ReversePurchasePartial",
        //        ContainerId = containerId,
        //        RenderMode = RenderMode.AddTo,
        //    };
        //    this.GetCmp<TabPanel>(containerId).SetLastTabAsActive();
        //    return pvr;
        //}


        public ActionResult SaveRecord(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if (!WithdrawalRepo.Trans_Request_Date.HasValue)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Actual Request Date is a required field",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                //if (string.IsNullOrEmpty(WithdrawalRepo.Type))
                //{
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "'Amount / Unit' is a required field",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350
                //    });

                //    return this.Direct();
                //}


                if (string.IsNullOrEmpty(WithdrawalRepo.Withdrawal_Reason))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Withdrawal Reason is a required field",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }


                //check if unit will move to employer
                if (this.GetCmp <Checkbox>("frmWD_Suspense").Checked == true)
                {
                    WithdrawalRepo.Total_Withdrawal_Amount = Math.Round(WithdrawalRepo.Total_Withdrawal_Temp * WithdrawalRepo.Unit_Price, 2);
                    WithdrawalRepo.Total_Withdrawal_Unit   = WithdrawalRepo.Total_Withdrawal_Temp;
                    WithdrawalRepo.To_Employer             = Math.Round(WithdrawalRepo.Total_Unit_Balance - WithdrawalRepo.Total_Withdrawal_Unit, 4);
                }
                else
                {
                    WithdrawalRepo.Total_Withdrawal_Amount = Math.Round(WithdrawalRepo.Total_Withdrawal_Temp * WithdrawalRepo.Unit_Price, 2);
                    WithdrawalRepo.Total_Withdrawal_Unit   = WithdrawalRepo.Total_Withdrawal_Temp;
                    WithdrawalRepo.To_Employer             = 0;
                }



                // check if there is a pending request for the employee scheme fund

                if (WithdrawalRepo.GetcheckESFList(WithdrawalRepo) == true)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! There is already a pending request for the Employee Account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                // validate scheme date
                if (!string.IsNullOrEmpty(WithdrawalRepo.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);
                    if (WithdrawalRepo.Trans_Request_Date > GlobalValue.Scheme_Today_Date)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Request date can not be above the scheme working date ",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }
                }
                else
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Employee account cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }

                WithdrawalRepo.GetESFList(WithdrawalRepo.ESF_Id);

                WithdrawalRepo.Total_Withdrawal_Unit = Math.Round(WithdrawalRepo.Total_Withdrawal_Unit, 4);
                WithdrawalRepo.Total_Unit_Balance    = Math.Round(WithdrawalRepo.Total_Unit_Balance, 4);

                if (WithdrawalRepo.Total_Withdrawal_Unit > WithdrawalRepo.Total_Unit_Balance)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry!Total Withdrawal(Unit) can not be more than Total Unit",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }


                if (ModelState.IsValid)
                {
                    this.WithdrawalRepo.SaveRecord(WithdrawalRepo);

                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Success",
                        Message = "Withdrawal Successfully Processed.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    // ClearControls();
                    //Store store = X.GetCmp<Store>("WithdrawalESFStore");
                    //store.Reload();
                    //return this.Direct();
                    var pvr = new Ext.Net.MVC.PartialViewResult
                    {
                        ViewName    = "WithdrawalPartial",
                        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;
            }
        }
示例#18
0
        public ActionResult PayRecord(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(WithdrawalRepo.PortOut_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No record has been selected for Payment.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(WithdrawalRepo.GL_Account_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select Bank Account.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }


                WithdrawalRepo.GetESFPortOutList(WithdrawalRepo.PortOut_No);

                //get GL balance from GL_Account Table
                WithdrawalRepo.Get_GL_Balance(WithdrawalRepo);

                if (WithdrawalRepo.Total_Benefit > WithdrawalRepo.GL_Balance * -1)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! Insufficient Account Balance.Process aborted.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }



                if (string.IsNullOrEmpty(WithdrawalRepo.Payment_Mode))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Payment Mode is required",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (!WithdrawalRepo.Pay_Date_Benefit.HasValue)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Payment Date is required",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (!string.IsNullOrEmpty(WithdrawalRepo.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);
                    if (WithdrawalRepo.Pay_Date_Benefit != GlobalValue.Scheme_Today_Date)
                    {
                        X.Mask.Hide();
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Transaction 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.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Scheme cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }
                ///pay pending withdrawal

                WithdrawalRepo.Pay_Unit_PortOut(WithdrawalRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Port-Out Successfully Paid.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_Pay();
                //Store store = X.GetCmp<Store>("PayRequestPortOutStore");
                //store.Reload();

                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "PortOutPayPartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#19
0
        // approve sec bond
        public ActionResult ReverseRecordSec(BondRepo MM_TBill)
        {
            try
            {
                if (string.IsNullOrEmpty(MM_TBill.Invest_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No Investment 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
                MM_TBill.Get_GL_Balance(MM_TBill);

                //if ((TransFixRepo.GL_Balance * -1) < TransFixRepo.Amount_Invested)
                //{
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "Sorry! Insufficient Cash in Scheme-Fund Bank Account.",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350
                //    });

                //    return this.Direct();
                //}
                GlobalValue.Get_Scheme_Today_Date(MM_TBill.Scheme_Id);

                //if (!string.IsNullOrEmpty(MM_TBill.Scheme_Id))
                //{
                //    GlobalValue.Get_Scheme_Today_Date(MM_TBill.Scheme_Id);
                //    if (MM_TBill.Settlement_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

                //    });
                //}

                MM_TBill.Reverse_MM_TBill(MM_TBill);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Investment Successfully Reversed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_Sec();
                //Store storesec = X.GetCmp<Store>("Reversedsecbondstore");
                //storesec.Reload();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "ReverseSecBondPartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                return(this.Direct());
            }
        }
示例#20
0
        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());
            }
        }
示例#21
0
        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());
                }

                //check if issuer exist
                Equity_CISRepo.ck_issuer(Equity_CISRepo);

                if ((Equity_CISRepo.CH_NUMBER <= 0))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! Unregistered Issuer",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(Equity_CISRepo.Issuer_Id))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please Select Issuer.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        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! Cash balance 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! Order 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.SaveRecord(Equity_CISRepo);

                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Success",
                        Message = "Order Successfully Processed.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    var pvr = new Ext.Net.MVC.PartialViewResult
                    {
                        ViewName    = "Equity_CISPartial",
                        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)
            {
                string ora_code = ex.Message.Substring(0, 9);
                if (ora_code == "ORA-20000")
                {
                    ora_code = "Record already exist. Process aborted..";
                }
                else if (ora_code == "ORA-20100")
                {
                    ora_code = "Not all records are supplied. Process aborted..";
                }
                else
                {
                    ora_code = ex.ToString();
                }
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = ora_code,
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //log.Write(level: Serilog.Events.LogEventLevel.Information, messageTemplate: ex.Message + " " + DateTime.Now);
                return(this.Direct());
            }
        }
示例#22
0
        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());
            }
        }
        //public ActionResult AddReversePurchaseTab(string containerId = "MainArea")
        //{
        //    var pvr = new Ext.Net.MVC.PartialViewResult
        //    {
        //        ViewName = "ReversePurchasePartial",
        //        ContainerId = containerId,
        //        RenderMode = RenderMode.AddTo,
        //    };
        //    this.GetCmp<TabPanel>(containerId).SetLastTabAsActive();
        //    return pvr;
        //}


        public ActionResult SaveRecord(Remit_WithdrawalRepo WithdrawalRepo, Remit_ReceiptRepo ReceiptRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(ReceiptRepo.ES_Id))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select Employer Account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(WithdrawalRepo.GL_Account_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select Bank Account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (!WithdrawalRepo.Trans_Request_Date.HasValue)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Actual Request Date is a required field",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }



                if (string.IsNullOrEmpty(WithdrawalRepo.Withdrawal_Reason))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Withdrawal Reason is a required field",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }


                // check if there is a pending request for the employee scheme fund

                if (WithdrawalRepo.GetcheckESFListEmp(WithdrawalRepo) == true)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! There is already a pending request for the Employee Account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                // validate scheme date
                if (!string.IsNullOrEmpty(WithdrawalRepo.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);
                    if (WithdrawalRepo.Trans_Request_Date != GlobalValue.Scheme_Today_Date)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Request date must be equal to scheme working date ",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }
                }
                else
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Employee account cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }

                ////get GL balance from GL_Account Table
                //WithdrawalRepo.Get_GL_Balance(WithdrawalRepo);

                //if (WithdrawalRepo.Total_Withdrawal_Amount > WithdrawalRepo.GL_Balance * -1)
                //{
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "Sorry! Insufficient Account Balance.Process aborted.",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.ERROR,
                //        Width = 350
                //    });
                //    return this.Direct();
                //}

                WithdrawalRepo.GetESFList(WithdrawalRepo.ESF_Id);

                WithdrawalRepo.Total_Withdrawal_Unit = Math.Round(WithdrawalRepo.Total_Withdrawal_Unit, 4);
                WithdrawalRepo.Total_Unit_Balance    = Math.Round(WithdrawalRepo.Total_Unit_Balance, 4);

                if (WithdrawalRepo.Total_Withdrawal_Unit > WithdrawalRepo.Total_Unit_Balance)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry!Total Withdrawal(Unit) can not be more than Total Unit",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }


                //if (ModelState.IsValid)
                //{
                this.WithdrawalRepo.SaveRecord_TE(WithdrawalRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Benefit Transfer Successfully Processed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                // ClearControls();
                //Store store = X.GetCmp<Store>("WithdrawalESFStore");
                //store.Reload();
                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "WithdrawalPartial",
                    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;
            }
        }
示例#24
0
        // SELL BONDS
        public ActionResult ReceiptMBondRecord(BondRepo BondRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(BondRepo.Invest_No))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No Investment has been selected for approval.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                //get record
                BondRepo.GetFMRecord(BondRepo);

                if (string.IsNullOrEmpty(BondRepo.Receipt_Date.ToString()))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Date is required.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (!string.IsNullOrEmpty(BondRepo.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(BondRepo.Scheme_Id);
                    if (BondRepo.Receipt_Date > GlobalValue.Scheme_Today_Date)
                    {
                        X.Mask.Hide();
                        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.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Scheme cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }

                //if (BondRepo.Principal_Amount > 0 && BondRepo.Invest_Status == "ACTIVE")
                //{
                //    X.Mask.Hide();
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "Please Principal can not be received. Process aborted",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350
                //    });

                //    return this.Direct();
                //}

                if (BondRepo.Principal_Amount <= 0 && BondRepo.Interest_Amount <= 0)
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please enter 'Principal Amount' or 'Interest Amount' to confirm investment payment",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (BondRepo.Principal_Amount > BondRepo.Principal_Bal)
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please Principal Amount can not be more than Principal Balance. Process aborted",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (BondRepo.Interest_Amount > BondRepo.Interest_Accrued)
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please Interest Amount can not be more than Accrued Interest. Process aborted",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }


                if (string.IsNullOrEmpty(BondRepo.Credit_Account_No))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Credit Bank Account is required.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                BondRepo.Interest_Accrued = BondRepo.Interest_Accrued - BondRepo.Interest_Amount;
                BondRepo.Interest_Paid    = BondRepo.Interest_Paid + BondRepo.Interest_Amount;
                BondRepo.Interest_Bal     = BondRepo.Interest_Bal - BondRepo.Interest_Amount;
                BondRepo.Principal_Paid   = BondRepo.Principal_Paid + BondRepo.Principal_Amount;
                BondRepo.Principal_Bal    = BondRepo.Principal_Bal - BondRepo.Principal_Amount;

                BondRepo.Receipt_Bond_Sell(BondRepo);
                X.Mask.Hide();
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Investment Payment Successfully Confirmed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControlsMB();
                //Store store = X.GetCmp<Store>("ReceiptMBfixedincomestore");
                //store.RemoveAll();

                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "SellSecBondPartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                X.Mask.Hide();
                return(this.Direct());
            }
        }
示例#25
0
        // REVERSE BOND SALE
        public ActionResult ReverseReceiptRecord_Bonds(Invest_Trans_Fix_Repo TransFixRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(TransFixRepo.TID))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No Investment Sale has been selected for reversal.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                //get record
                TransFixRepo.GetFMRecord(TransFixRepo);

                if (!string.IsNullOrEmpty(TransFixRepo.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(TransFixRepo.Scheme_Id);
                    if (TransFixRepo.Receipt_Date > GlobalValue.Scheme_Today_Date)
                    {
                        X.Mask.Hide();
                        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.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Scheme cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }

                //TransFixRepo.Interest_Accrued = TransFixRepo.Interest_Accrued + TransFixRepo.Interest_Amount;
                //TransFixRepo.Interest_Paid = TransFixRepo.Interest_Paid - TransFixRepo.Interest_Amount;
                //TransFixRepo.Interest_Bal = TransFixRepo.Interest_Bal + TransFixRepo.Interest_Amount;
                //TransFixRepo.Principal_Paid = TransFixRepo.Principal_Paid - TransFixRepo.Principal_Amount;
                //TransFixRepo.Principal_Bal = TransFixRepo.Principal_Bal + TransFixRepo.Principal_Amount;

                TransFixRepo.Sale_MM_TBill_Reverse(TransFixRepo);
                X.Mask.Hide();
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Investment Sale Successfully Reversed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_ReverseR_Bonds();
                //Store store = X.GetCmp<Store>("ReverseReceiptBondsstore");
                //store.RemoveAll();

                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "SellReversePartial_Bonds",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                X.Mask.Hide();
                return(this.Direct());
            }
        }
示例#26
0
        public ActionResult Approve_Pending_Batch(crm_EmployeeBatchLogRepo repo_emplog)
        {
            try
            {
                if (repo_emplog.Unit_Price <= 0)
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please enter a valid unit price",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }


                if (string.IsNullOrEmpty(repo_emplog.Fund_Id) || string.IsNullOrEmpty(repo_emplog.Scheme_Id))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select employer account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(repo_emplog.New_Trustee))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select new trustee",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (!repo_emplog.Pay_Date_Benefit.HasValue)
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select Port-Out Date",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }


                if (string.IsNullOrEmpty(repo_emplog.GL_Account_No))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please bank account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                if (!string.IsNullOrEmpty(repo_emplog.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(repo_emplog.Scheme_Id);
                    if (repo_emplog.Pay_Date_Benefit != GlobalValue.Scheme_Today_Date)
                    {
                        X.Mask.Hide();
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Transaction 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.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Scheme cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }

                //check if amount is enough
                //do

                repo_emplog.Portout(repo_emplog);
                X.Mask.Hide();
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Batch  Port-Out Processed Successfully.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName = "BatchPortOut",
                    //Model = empList,
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };

                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();

                return(pvr);
            }
            catch (Exception ex)
            {
                X.Mask.Hide();
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = ex.ToString(),
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.ERROR,
                    Width   = 350
                });
                return(this.Direct());
            }
        }
        public ActionResult ApproveRecord(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if (WithdrawalRepo.Withdrawal_No == string.Empty)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No Request has been selected for approval.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }


                WithdrawalRepo.GetESFList(WithdrawalRepo.ESF_Id);

                WithdrawalRepo.Total_Withdrawal_Unit = Math.Round(WithdrawalRepo.Total_Withdrawal_Unit, 4);
                WithdrawalRepo.Total_Unit_Balance    = Math.Round(WithdrawalRepo.Total_Unit_Balance, 4);

                if (WithdrawalRepo.Total_Withdrawal_Unit > WithdrawalRepo.Total_Unit_Balance)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry!Total Withdrawal(Unit) can not be more than Total Unit.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }
                GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);

                ///approve pending withdrawal

                WithdrawalRepo.Approve_Unit_Withdrawal(WithdrawalRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Benefit Request Successfully Approved.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_Approve();
                //Store store = X.GetCmp<Store>("ApproveRequestWithStore");
                //store.Reload();

                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "WithdrawalApprovePartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MianArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#28
0
        public ActionResult Sec_SaveRecord(BondRepo MM_TBill)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    if (MM_TBill.isOrderUnique(MM_TBill.Invest_No) == true)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Duplicate",
                            Message = "Investment already exist.",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });
                        return(this.Direct());
                    }

                    //check if issuer exist
                    MM_TBill.ck_issuer(MM_TBill);

                    if ((MM_TBill.CH_NUMBER <= 0))
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Unregistered Issuer",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }

                    if ((MM_TBill.Cost) <= 0)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Invalid Cost",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }


                    //get GL balance from GL_Account Table
                    MM_TBill.Get_GL_Balance(MM_TBill);
                    MM_TBill.GL_Balance    = Math.Round(MM_TBill.GL_Balance, 2);
                    MM_TBill.Cost          = Math.Round(MM_TBill.Cost, 2);
                    MM_TBill.Brokerage_Fee = Math.Round(MM_TBill.Brokerage_Fee, 2);

                    if ((MM_TBill.GL_Balance * -1) < MM_TBill.Cost + MM_TBill.Brokerage_Fee)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Cash balance is not enough for this investment",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }

                    if (MM_TBill.Last_Coupon_Payment_Date < MM_TBill.Start_Date)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Last Coupon Payment Date can not be before Start Date",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }

                    if (MM_TBill.Amount_Invested != MM_TBill.Cost && MM_TBill.Current_Yield <= 0)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Invalid Current Yield. Please enter a valid Yield.",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });
                        return(this.Direct());
                    }

                    if (!string.IsNullOrEmpty(MM_TBill.Scheme_Id))
                    {
                        GlobalValue.Get_Scheme_Today_Date(MM_TBill.Scheme_Id);
                        if (MM_TBill.Settlement_Date != GlobalValue.Scheme_Today_Date)
                        {
                            X.Msg.Show(new MessageBoxConfig
                            {
                                Title   = "Error",
                                Message = "Sorry! Settlement 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
                        });
                    }

                    this.MM_TBill.Add_Submit_Trans_Sec(MM_TBill);

                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Success",
                        Message = "Investment Successfully Processed.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    //ClearControls_Sec();
                    //Store store = X.GetCmp<Store>("SecBondSFStore");
                    //store.Reload();
                    //return this.Direct();
                    var pvr = new Ext.Net.MVC.PartialViewResult
                    {
                        ViewName    = "SecBondPartial",
                        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)
            {
                string ora_code = ex.Message.Substring(0, 9);
                if (ora_code == "ORA-20000")
                {
                    ora_code = "Record already exist. Process aborted..";
                }
                else if (ora_code == "ORA-20100")
                {
                    ora_code = "Not all records are supplied. Process aborted..";
                }
                else
                {
                    ora_code = ex.ToString();
                }
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = ora_code,
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //log.Write(level: Serilog.Events.LogEventLevel.Information, messageTemplate: ex.Message + " " + DateTime.Now);
                return(this.Direct());
            }
        }
        public ActionResult PayTaxRecord(Remit_WithdrawalRepo WithdrawalRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(WithdrawalRepo.Withdrawal_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! No Benefit has been selected for Payment.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(WithdrawalRepo.GL_Account_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select Bank Account.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }


                WithdrawalRepo.GetESFList(WithdrawalRepo.ESF_Id);

                //get GL balance from GL_Account Table
                WithdrawalRepo.Get_GL_Balance(WithdrawalRepo);

                if (WithdrawalRepo.Tax > WithdrawalRepo.GL_Balance * -1)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Sorry! Insufficient Account Balance.Process aborted.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }



                if (string.IsNullOrEmpty(WithdrawalRepo.Payment_Mode))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Payment Mode is required",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                //if (WithdrawalRepo.Payment_Mode != "CASH" && string.IsNullOrEmpty(WithdrawalRepo.Instrument_No))
                //{
                //    X.Msg.Show(new MessageBoxConfig
                //    {
                //        Title = "Error",
                //        Message = "Instrument Numebr is required.",
                //        Buttons = MessageBox.Button.OK,
                //        Icon = MessageBox.Icon.INFO,
                //        Width = 350
                //    });

                //    return this.Direct();
                //}

                if (!WithdrawalRepo.Pay_Date_Benefit.HasValue)
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Payment Date is required",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }

                // validate scheme date
                if (!string.IsNullOrEmpty(WithdrawalRepo.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(WithdrawalRepo.Scheme_Id);
                    if (WithdrawalRepo.Pay_Date_Benefit != GlobalValue.Scheme_Today_Date)
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Sorry! Payment date must be equal to scheme working date ",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }
                }
                else
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Employee account cannot be verified.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                }

                ///pay pending tax

                WithdrawalRepo.PayTax_Unit_Withdrawal(WithdrawalRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Benefit Tax Successfully Paid.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_PayTax();
                //Store store = X.GetCmp<Store>("PayTaxRequestWithStore");
                //store.Reload();

                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "WithdrawalPayTaxPartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#30
0
        public ActionResult AddSellRecordSec(BondRepo MM_TBill)
        {
            try
            {
                if (string.IsNullOrEmpty(MM_TBill.Invest_No))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select investment. Process aborted",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }



                if (!string.IsNullOrEmpty(MM_TBill.Scheme_Id))
                {
                    GlobalValue.Get_Scheme_Today_Date(MM_TBill.Scheme_Id);
                    if (MM_TBill.Settlement_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
                    });
                }

                this.MM_TBill.Add_Submit_Trans_Sec_Sell(MM_TBill);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Transaction Successfully Processed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //ClearControls_Sec();
                //Store store = X.GetCmp<Store>("SecBondSFStore");
                //store.Reload();
                //return this.Direct();
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "SellSecBondPartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                string ora_code = ex.Message.Substring(0, 9);
                if (ora_code == "ORA-20000")
                {
                    ora_code = "Error. Process aborted..";
                }
                else if (ora_code == "ORA-20100")
                {
                    ora_code = "Not all records are supplied. Process aborted..";
                }
                else
                {
                    ora_code = ex.ToString();
                }
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = ora_code,
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //log.Write(level: Serilog.Events.LogEventLevel.Information, messageTemplate: ex.Message + " " + DateTime.Now);
                return(this.Direct());
            }
        }