Пример #1
0
        public ActionResult DelRecord(Remit_Unit_TransferRepo Unit_ChangeRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(Unit_ChangeRepo.ESF_Id))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select employee account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(Unit_ChangeRepo.Purchase_Log_Id))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select contribution/purchase",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                this.Unit_ChangeRepo.DelRecord(Unit_ChangeRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Contribution successfully deleted",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "Unit_ChangePartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                return(this.Direct());
            }
        }
Пример #2
0
 public ActionResult ReadPendingUT(Remit_Unit_TransferRepo Unit_ChangeRepo)
 {
     try
     {
         return(this.Store(Unit_ChangeRepo.GetPendingUTList(Unit_ChangeRepo)));
     }
     catch (System.Exception)
     {
         throw;
     }
 }
Пример #3
0
 public ActionResult ReadPurchases(Remit_Unit_TransferRepo Unit_ChangeRepo)
 {
     try
     {
         return(this.Store(Unit_ChangeRepo.GetPurchasesList2(Unit_ChangeRepo)));
     }
     catch (System.Exception)
     {
         throw;
     }
 }
 public ActionResult SaveRecord(Remit_Unit_TransferRepo Unit_TransferRepo)
 {
     try
     {
         if (ModelState.IsValid)
         {
             this.Unit_TransferRepo.SaveRecord(Unit_TransferRepo);
             X.Mask.Hide();
             X.Msg.Show(new MessageBoxConfig
             {
                 Title   = "Success",
                 Message = "Units Transfer successfully sent for approval.",
                 Buttons = MessageBox.Button.OK,
                 Icon    = MessageBox.Icon.INFO,
                 Width   = 350
             });
             var pvr = new Ext.Net.MVC.PartialViewResult
             {
                 ViewName    = "Unit_TransferPartial",
                 ContainerId = "MainArea",
                 RenderMode  = RenderMode.AddTo,
             };
             this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
             return(pvr);
         }
         else
         {
             X.Mask.Hide();
             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)
     {
         X.Mask.Hide();
         return(this.Direct());
     }
 }
        public ActionResult ApproveRecord(Remit_Unit_TransferRepo Unit_TransferRepo)
        {
            try
            {
                if (Unit_TransferRepo.TID < 1)
                {
                    X.Mask.Hide();
                    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());
                }

                // get the pending unit transfer record
                Unit_TransferRepo.GetPendingUTList(Unit_TransferRepo);

                //approve pending unit transfer
                Unit_TransferRepo.Approve_Unit_Transfer(Unit_TransferRepo);
                X.Mask.Hide();
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Unit Transfer Successfully Approved.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName = "Unit_TransferApprovePartial",
                    // Model = PurchaseRepo.GetPurchasePendingList(),
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                X.Mask.Hide();
                return(this.Direct());
            }
        }
        public ActionResult SaveRecordMerge(Remit_Unit_TransferRepo Unit_TransferRepo)
        {
            try
            {
                if (string.IsNullOrEmpty(Unit_TransferRepo.Scheme_Fund_Id))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select Scheme Account.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(Unit_TransferRepo.From_ESF_Id))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select source employee account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(Unit_TransferRepo.To_ESF_Id))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select destination employee account",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(Unit_TransferRepo.Reason_Transfer))
                {
                    X.Mask.Hide();
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please enter reason.",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.ERROR,
                        Width   = 350
                    });
                    return(this.Direct());
                }


                this.Unit_TransferRepo.Approve_Unit_Merge(Unit_TransferRepo);
                X.Mask.Hide();
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Employee Accounts successfully merged",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "Unit_MergePartial",
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };
                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();
                return(pvr);
            }
            catch (Exception ex)
            {
                X.Mask.Hide();
                return(this.Direct());
            }
        }