public ActionResult SaveRecord(pfm_Scheme_FundRepo pfm_scheme_fundrepo)
        {
            var log = new LoggerConfiguration().WriteTo.Seq("http://localhost:5341").CreateLogger();

            try
            {
                pfm_scheme_fundrepo.Maker_Id    = GlobalValue.User_ID;
                pfm_scheme_fundrepo.Make_Date   = GlobalValue.Scheme_Today_Date;
                pfm_scheme_fundrepo.Update_Id   = GlobalValue.User_ID;
                pfm_scheme_fundrepo.Update_Date = GlobalValue.Scheme_Today_Date;
                if (ModelState.IsValid)
                {
                    this.schemefundrepo.SaveRecord(pfm_scheme_fundrepo);

                    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>("SchemeFundStore");
                    store.Reload();
                    var reset = X.GetCmp <FormPanel>("SchemeFundPan");
                    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 = "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());
            }
            finally
            {
            }
        }
Example #2
0
        public ActionResult UploadUP(Invest_ProductRepo PRepo, pfm_Scheme_FundRepo SFRepo)
        {
            try
            {
                if (!PRepo.E_Unit_Date.HasValue)
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Date is required.Process aborted.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });

                    return(this.Direct());
                }



                //Check if file Exist   file_upload1
                if (this.GetCmp <FileUploadField>("file_upload_UP_EC").HasFile)
                {
                    HttpPostedFile file_posted = this.GetCmp <FileUploadField>("file_upload_UP_EC").PostedFile;

                    string extension = Path.GetExtension(file_posted.FileName);

                    if (extension != ".xlsx" && extension != ".xls")
                    {
                        X.Mask.Hide();
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "selected file must be an excel file.Process aborted.",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        return(this.Direct());
                    }

                    ImageWork.Upload_Any_File_Not_Image(file_posted);


                    if (ECUpload(ImageWork.Current_Path_For_Other_Files, PRepo))
                    {
                        X.Mask.Hide();
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Success",
                            Message = "Unit Prices successfully uploaded.",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });

                        this.ClearControls();
                        //var pvr = new Ext.Net.MVC.PartialViewResult
                        //{
                        //    ViewName = "LoadUnitPricePartial",
                        //    ContainerId = "MainArea",
                        //    RenderMode = RenderMode.AddTo,
                        //};
                        //this.GetCmp<TabPanel>("MainArea").SetLastTabAsActive();
                        //return pvr;
                    }
                }
                else
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select a file to upload.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });


                    return(this.Direct());
                }

                return(this.Direct());
            }
            catch (Exception ex)
            {
                X.Mask.Hide();
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = "Sorry! File upload failed. Contact System Administrator",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.ERROR,
                    Width   = 350
                });
                return(this.Direct());
            }
        }
        public ActionResult ApproveRecord(pfm_Scheme_FundRepo pfm_Schemefundrepo)
        {
            pfm_Schemefundrepo.Auth_Id   = GlobalValue.User_ID;
            pfm_Schemefundrepo.Auth_Date = DateTime.Now;

            var log = new LoggerConfiguration().WriteTo.Seq("http://localhost:5341").CreateLogger();

            try
            {
                if (string.IsNullOrEmpty(pfm_Schemefundrepo.Fund_Id))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select a record to approve.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

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

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

                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
            {
            }
        }
Example #4
0
        public ActionResult SaveRecord(pfm_Scheme_FundRepo pfm_scheme_fundrepo)
        {
            var log = new LoggerConfiguration().WriteTo.Seq("http://localhost:5341").CreateLogger();

            try
            {
                pfm_scheme_fundrepo.Maker_Id    = GlobalValue.User_ID;
                pfm_scheme_fundrepo.Make_Date   = System.DateTime.Now;
                pfm_scheme_fundrepo.Update_Id   = GlobalValue.User_ID;
                pfm_scheme_fundrepo.Update_Date = System.DateTime.Now;

                {
                    if (String.IsNullOrEmpty(pfm_scheme_fundrepo.Account_Name))
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Account Name is required",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });
                        return(this.Direct());
                    }

                    if (String.IsNullOrEmpty(pfm_scheme_fundrepo.Scheme_Id))
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "Scheme is required",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });
                        return(this.Direct());
                    }

                    if (String.IsNullOrEmpty(pfm_scheme_fundrepo.GL_Account_No))
                    {
                        X.Msg.Show(new MessageBoxConfig
                        {
                            Title   = "Error",
                            Message = "GL Account is required",
                            Buttons = MessageBox.Button.OK,
                            Icon    = MessageBox.Icon.INFO,
                            Width   = 350
                        });
                        return(this.Direct());
                    }

                    this.schemefundrepo.SaveRecordGL(pfm_scheme_fundrepo);

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

                    var pvr = new Ext.Net.MVC.PartialViewResult
                    {
                        ViewName    = "GLConsolidated",
                        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 = "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());
            }
            finally
            {
            }
        }