示例#1
0
        public long GetAmountByAuthority(string authority)
        {
            ZarinpallAuthority zarinpallAuthority =
                db.ZarinpallAuthorities.FirstOrDefault(current => current.Authority == authority);

            if (zarinpallAuthority != null)
            {
                return(Convert.ToInt64(zarinpallAuthority.Amount));
            }

            return(0);
        }
示例#2
0
        public Order GetOrderByAuthority(string authority)
        {
            ZarinpallAuthority zarinpallAuthority =
                db.ZarinpallAuthorities.FirstOrDefault(current => current.Authority == authority);

            if (zarinpallAuthority != null)
            {
                return(zarinpallAuthority.Order);
            }

            else
            {
                return(null);
            }
        }
示例#3
0
        public void InsertToAuthority(Guid orderId, string authority, decimal amount)
        {
            ZarinpallAuthority zarinpallAuthority = new ZarinpallAuthority()
            {
                OrderId      = orderId,
                Authority    = authority,
                Amount       = amount,
                CreationDate = DateTime.Now,
                IsDeleted    = false,
                IsActive     = true
            };

            db.ZarinpallAuthorities.Add(zarinpallAuthority);
            db.SaveChanges();
        }