Example #1
0
        public void Delete()
        {
            var data = new TblPromoHeader();

            data.InjectFrom(TransactionHeader);

            if (AllowDelete)
            {
                Loading = true;
                Client.DeleteTblPromoHeaderAsync(data, LoggedUserInfo.DatabasEname);
            }
            else
            {
                MessageBox.Show("You are Not Allowed to Delete");
            }
        }
Example #2
0
        public void UpdateAndInsert()
        {
            var  valiationCollection = new List <ValidationResult>();
            bool isvalid             = Validator.TryValidateObject(TransactionHeader, new ValidationContext(TransactionHeader, null, null), valiationCollection, true);

            if (isvalid)
            {
                var data = new TblPromoHeader();
                data.InjectFrom(TransactionHeader);
                bool save = TransactionHeader.GlSerial == 0;
                if (save)
                {
                    if (AllowAdd)
                    {
                        Loading = true;
                        Client.UpdateOrInsertTblPromoHeaderAsync(data, LoggedUserInfo.DatabasEname);
                    }

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

                    else
                    {
                        MessageBox.Show("You are Not Allowed to Update");
                    }
                }
            }
        }