public MerchandizerTest Merchant(string merchantCode, string merchantName, string merchantPassword)
        {
            MerchandizerTest merchant = new MerchandizerTest();

            if (merchant.Identification(merchantCode, merchantName, merchantPassword))
            {
                merchant.LoadInformation();
            }
            return(merchant);
        }
 public bool Synchronous(MerchandizerTest merchant, string fileName)
 {
     if (merchant.IsVerified)
     {
         int     result     = 0;
         DataSet AccountSet = new DataSet();
         InputFile(fileName, AccountSet, OPType.Synchronous);
         if (AccountSet != null && AccountSet.Tables[0].Rows.Count > 0)
         {
             foreach (DataRow row in AccountSet.Tables[0].Rows)
             {
                 if (Common.ExecuteQuery(Common.CDServiceConnStr, CommandType.Text,
                                         "UPDATE [dbo].[Account] "
                                         + "SET [BillDate]=@BillDate, "
                                         + "[TotalBalance]=@TotalBalance, "
                                         + "[TransferDate]=@TransferDate "
                                         + "WHERE [MerchantID]=@MerchantID AND "
                                         + "[GroupID]=@GroupID AND "
                                         + "[ConsumerID]=@ConsumerID AND "
                                         + "[AccountNumber]=@AccountNumber",
                                         new SqlParameter("@BillDate", row["BillDate"].ToString()),
                                         new SqlParameter("@TotalBalance", row["TotalBalance"].ToString()),
                                         new SqlParameter("@TransferDate", row["TransferDate"].ToString()),
                                         new SqlParameter("@MerchantID", row["MerchantID"].ToString()),
                                         new SqlParameter("@GroupID", row["GroupID"].ToString()),
                                         new SqlParameter("@ConsumerID", row["ConsumerID"].ToString()),
                                         new SqlParameter("@AccountNumber", row["AccountNumber"].ToString())).Equals(1))
                 {
                     result++;
                 }
             }
             if (result > 0)
             {
                 return(true);
             }
             else
             {
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
        public string BuildPaymentList(MerchandizerTest merchant)
        {
            string fileName = String.Empty;

            if (merchant.IsVerified)
            {
                DataSet PaymentSet = new DataSet();
                PaymentSet = Common.ExecuteDataset(Common.CDServiceConnStr, CommandType.Text,
                                                   "SELECT * FROM [dbo].[Payment] WHERE [MerchantID]=@MerchantID",
                                                   new SqlParameter("@MerchantID", merchant.MerchantID));
                if (PaymentSet != null && PaymentSet.Tables[0].Rows.Count > 0)
                {
                    fileName = Guid.NewGuid().ToString() + ".xml";
                    OutputFile(fileName, PaymentSet, OPType.PaymentList);
                }
            }
            return(fileName);
        }
 public bool OverloadedAccountList(MerchandizerTest merchant, DataSet accountSet, string fileName)
 {
     if (merchant.IsVerified)
     {
         if (accountSet != null && accountSet.Tables[0].Rows.Count > 0 && !fileName.Equals(String.Empty))
         {
             OutputFile(fileName, accountSet, OPType.AccountList);
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
 public bool HaveNewAccounts(MerchandizerTest merchant)
 {
     if (merchant.IsVerified)
     {
         if (long.Parse(Common.ExecuteDataset(Common.CDServiceConnStr, CommandType.Text,
                                              "SELECT COUNT(*) FROM [dbo].[Account] WHERE [MerchantID]=@MerchantID",
                                              new SqlParameter("@MerchantID", merchant.MerchantID)).Tables[0].Rows[0][0].ToString()) > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
 public DataSet GetPaymentList(MerchandizerTest merchant, string fileName)
 {
     if (merchant.IsVerified && !fileName.Equals(String.Empty))
     {
         DataSet PaymentSet = new DataSet();
         InputFile(fileName, PaymentSet, OPType.PaymentList);
         if (PaymentSet != null && PaymentSet.Tables[0].Rows.Count > 0)
         {
             return(PaymentSet);
         }
         else
         {
             return(null);
         }
     }
     else
     {
         return(null);
     }
 }