public long GetAmountByAuthority(string authority) { ZarinpallAuthority zarinpallAuthority = db.ZarinpallAuthorities.FirstOrDefault(current => current.Authority == authority); if (zarinpallAuthority != null) { return(Convert.ToInt64(zarinpallAuthority.Amount)); } return(0); }
public Order GetOrderByAuthority(string authority) { ZarinpallAuthority zarinpallAuthority = db.ZarinpallAuthorities.FirstOrDefault(current => current.Authority == authority); if (zarinpallAuthority != null) { return(zarinpallAuthority.Order); } else { return(null); } }
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(); }