Exemplo n.º 1
0
        public void DeleteAccounts()
        {
            //Test request
            string expected = File.ReadAllText(Path.Combine(_requestsTestDataPath, "DeleteAccounts.xml"));
            var    request  = new DeleteAccounts
            {
                SessionId   = "sid",
                DomainStr   = "testing.com",
                AccountList = new TPropertyStringList
                {
                    Val = new List <string> {
                        "delete1", "delete2"
                    }
                }
            };
            var requestXml = request.ToXml().InnerXmlFormatted();

            Assert.AreEqual(expected, requestXml);

            //Test response
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(File.ReadAllText(Path.Combine(_responsesTestDataPath, "DeleteAccounts.xml")));
            var response = request.FromHttpRequestResult(new HttpRequestResult {
                Response = doc.InnerXml
            });

            Assert.AreEqual("result", response.Type);
            Assert.True(response.Success);
        }
Exemplo n.º 2
0
 public DeleteAccountsResponse Delete(DeleteAccounts request)
 {
     Db.DeleteAll <AccountData>();
     using (var mqClient = _messageService.CreateMessageQueueClient())
     {
         mqClient.Publish(new AccountsDeletedEvent());
     }
     return(new DeleteAccountsResponse());
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (getAccounts_ != null)
            {
                hash ^= GetAccounts.GetHashCode();
            }
            if (saveAccounts_ != null)
            {
                hash ^= SaveAccounts.GetHashCode();
            }
            if (deleteAccounts_ != null)
            {
                hash ^= DeleteAccounts.GetHashCode();
            }
            if (getEmployees_ != null)
            {
                hash ^= GetEmployees.GetHashCode();
            }
            if (saveEmployees_ != null)
            {
                hash ^= SaveEmployees.GetHashCode();
            }
            if (deleteEmployees_ != null)
            {
                hash ^= DeleteEmployees.GetHashCode();
            }
            if (getJobs_ != null)
            {
                hash ^= GetJobs.GetHashCode();
            }
            if (saveJobs_ != null)
            {
                hash ^= SaveJobs.GetHashCode();
            }
            if (deleteJobs_ != null)
            {
                hash ^= DeleteJobs.GetHashCode();
            }
            return(hash);
        }
Exemplo n.º 4
0
        public DeleteAccountsResponse Delete(DeleteAccounts request)
        {
            var id = Db.DeleteAll <AccountData>();

            return(new DeleteAccountsResponse());
        }
 public void MergeFrom(MainController other)
 {
     if (other == null)
     {
         return;
     }
     if (other.getAccounts_ != null)
     {
         if (getAccounts_ == null)
         {
             getAccounts_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         GetAccounts.MergeFrom(other.GetAccounts);
     }
     if (other.saveAccounts_ != null)
     {
         if (saveAccounts_ == null)
         {
             saveAccounts_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         SaveAccounts.MergeFrom(other.SaveAccounts);
     }
     if (other.deleteAccounts_ != null)
     {
         if (deleteAccounts_ == null)
         {
             deleteAccounts_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         DeleteAccounts.MergeFrom(other.DeleteAccounts);
     }
     if (other.getEmployees_ != null)
     {
         if (getEmployees_ == null)
         {
             getEmployees_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         GetEmployees.MergeFrom(other.GetEmployees);
     }
     if (other.saveEmployees_ != null)
     {
         if (saveEmployees_ == null)
         {
             saveEmployees_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         SaveEmployees.MergeFrom(other.SaveEmployees);
     }
     if (other.deleteEmployees_ != null)
     {
         if (deleteEmployees_ == null)
         {
             deleteEmployees_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         DeleteEmployees.MergeFrom(other.DeleteEmployees);
     }
     if (other.getJobs_ != null)
     {
         if (getJobs_ == null)
         {
             getJobs_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         GetJobs.MergeFrom(other.GetJobs);
     }
     if (other.saveJobs_ != null)
     {
         if (saveJobs_ == null)
         {
             saveJobs_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         SaveJobs.MergeFrom(other.SaveJobs);
     }
     if (other.deleteJobs_ != null)
     {
         if (deleteJobs_ == null)
         {
             deleteJobs_ = new global::Com.Revolutionlandscaping.Businessmanager.CommonAction();
         }
         DeleteJobs.MergeFrom(other.DeleteJobs);
     }
 }