Beispiel #1
0
        public void SaveMainRow()
        {
            var  valiationCollection = new List <ValidationResult>();
            bool isvalid             = Validator.TryValidateObject(TransactionHeader,
                                                                   new ValidationContext(TransactionHeader, null, null), valiationCollection, true);

            if (isvalid)
            {
                var data = new TblGlobalRetailBusinessBudget();
                data.InjectFrom(TransactionHeader);
                bool save = TransactionHeader.Iserial == 0;
                data.TransactionType = TransactionType;
                if (save)
                {
                    if (AllowAdd)
                    {
                        Loading = true;
                        Client.UpdateOrInsertTblGlobalRetailBusinessBudgetAsync(data, LoggedUserInfo.Iserial);
                    }

                    else
                    {
                        MessageBox.Show("You are Not Allowed to Add");
                    }
                }
                else
                {
                    if (AllowUpdate)
                    {
                        Loading = true;
                        Client.UpdateOrInsertTblGlobalRetailBusinessBudgetAsync(data, LoggedUserInfo.Iserial);
                    }
                    else
                    {
                        MessageBox.Show("You are Not Allowed to Update");
                    }
                }
            }
        }