public void DictionaryToParameter_hasNullString_True()
        {
            dict["name"] = "daniel";
            dict["age"]  = null;

            string expected = "name=daniel&age=";
            string result   = ParameterHelper.DictionaryToParameter(dict);

            Assert.AreEqual(result, expected);
        }
示例#2
0
        protected override string SetParameter(QryWinningListModel model)
        {
            SortedDictionary <string, string> paramter = new SortedDictionary <string, string>();

            paramter["version"] = "0.2";
            paramter["action"]  = ActionParameter.QryWinningListApi;
            paramter["invTerm"] = model.invTerm;
            paramter["UUID"]    = model.UUID;
            paramter["appID"]   = ConfigSetting.GovAppId;
            return(ParameterHelper.DictionaryToParameter(paramter));
        }
示例#3
0
        protected override string SetParameter(DonateQueryModel model)
        {
            SortedDictionary <string, string> paramter = new SortedDictionary <string, string>();

            paramter["version"] = "0.2";
            paramter["qKey"]    = model.qKey;
            paramter["action"]  = ActionParameter.DonateQueryApi;
            paramter["uuid"]    = model.UUID;
            paramter["appID"]   = ConfigSetting.GovAppId;
            return(ParameterHelper.DictionaryToParameter(paramter));
        }
示例#4
0
        protected override string SetParameter(DonateVerifyModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"] = "0.1",
                ["action"]  = GetMapperAction,
                ["pCode"]   = model.PCode,
                ["TxID"]    = model.TxID,
                ["appId"]   = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
        protected override string SetParameter(QryWinningListModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"] = "0.2",
                ["action"]  = GetMapperAction,
                ["invTerm"] = model.invTerm,
                ["UUID"]    = model.UUID,
                ["appID"]   = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
示例#6
0
        protected override string SetParameter(DonateQueryModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"] = "0.2",
                ["qKey"]    = model.qKey,
                ["action"]  = GetMapperAction,
                ["uuid"]    = model.UUID,
                ["appID"]   = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
示例#7
0
        protected override string SetParameter(InvoiceTitleModel model)
        {
            SortedDictionary <string, string> paramter = new SortedDictionary <string, string>();

            paramter["version"]    = "0.3";
            paramter["type"]       = model.Type.ToString();
            paramter["invNum"]     = model.InvNum;
            paramter["action"]     = ActionParameter.InvoiceTitleApi;
            paramter["generation"] = "V2";
            paramter["invDate"]    = model.InvDate.ToString("yyyy/MM/dd");
            paramter["UUID"]       = model.UUID;
            paramter["appID"]      = ConfigSetting.GovAppId;

            return(ParameterHelper.DictionaryToParameter(paramter));
        }
示例#8
0
        protected override string SetParameter(GetBarcodeModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]          = "1.0",
                ["action"]           = GetMapperAction,
                ["appID"]            = ConfigSetting.GovAppId,
                ["phoneNo"]          = model.PhoneNo,
                ["timeStamp"]        = model.TimeStamp,
                ["uuid"]             = model.UUID,
                ["verificationCode"] = model.VerificationCode
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
示例#9
0
        protected override string SetParameter(InvoiceTitleModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]    = "0.3",
                ["type"]       = model.Type.ToString(),
                ["InvNum"]     = model.InvNum,
                ["action"]     = GetMapperAction,
                ["generation"] = "V2",
                ["invDate"]    = model.InvDate.ToString("yyyy/MM/dd"),
                ["UUID"]       = model.UUID,
                ["appID"]      = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
示例#10
0
        protected override string SetParameter(qryCarrierAggModel model)
        {
            SortedDictionary <string, string> paramter = new SortedDictionary <string, string>();

            paramter["version"]     = "1.0";
            paramter["serial"]      = DateTime.Now.ToString("MMddssmmss");
            paramter["action"]      = ActionParameter.QryCarrierAggApi;
            paramter["cardType"]    = "3J0002";
            paramter["cardNo"]      = model.cardNo;
            paramter["cardEncrypt"] = model.cardEncrypt;
            paramter["timeStamp"]   = model.TimeStamp;
            paramter["uuid"]        = model.UUID;;
            paramter["appID"]       = ConfigSetting.GovAppId;

            return(ParameterHelper.DictionaryToParameter(paramter));
        }
        protected override string SetParameter(QryCarrierAggModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]     = model.Version,
                ["serial"]      = model.Serial,
                ["action"]      = GetMapperAction,
                ["cardType"]    = model.CardType.GetCardName(),
                ["cardNo"]      = model.CardNo,
                ["cardEncrypt"] = model.CardEncrypt,
                ["timeStamp"]   = model.TimeStamp,
                ["uuid"]        = model.UUID,
                ["appID"]       = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
示例#12
0
        protected override string SetParameter(CarrierTilteModel model)
        {
            SortedDictionary <string, string> paramter = new SortedDictionary <string, string>();

            paramter["version"]        = "0.3";
            paramter["action"]         = ActionParameter.CarrierTilteApi;
            paramter["cardType"]       = "3J0002";
            paramter["cardNo"]         = model.cardNo;
            paramter["expTimeStamp"]   = model.TimeStampMAX;
            paramter["timeStamp"]      = model.TimeStamp;
            paramter["startDate"]      = model.startDate;
            paramter["endDate"]        = model.endDate;
            paramter["onlyWinningInv"] = model.onlyWinningInv;
            paramter["uuid"]           = model.UUID;
            paramter["cardEncrypt"]    = model.cardEncrypt;
            paramter["appID"]          = ConfigSetting.GovAppId;
            return(ParameterHelper.DictionaryToParameter(paramter));
        }
示例#13
0
        protected override string SetParameter(CarrierDetailModel model)
        {
            SortedDictionary <string, string> paramter = new SortedDictionary <string, string>();

            paramter["version"]      = "0.3";
            paramter["action"]       = ActionParameter.CarrierDetailApi;
            paramter["cardType"]     = "3J0002";
            paramter["cardNo"]       = model.cardNo;
            paramter["expTimeStamp"] = model.TimeStampMAX;
            paramter["timeStamp"]    = model.TimeStamp;
            paramter["invNum"]       = model.invNum;
            paramter["invDate"]      = model.invDate;
            paramter["uuid"]         = model.UUID;
            paramter["cardEncrypt"]  = model.cardEncrypt;
            paramter["appID"]        = ConfigSetting.GovAppId;

            return(ParameterHelper.DictionaryToParameter(paramter));
        }
示例#14
0
        protected override string SetParameter(InvoiceDetailModel model)
        {
            SortedDictionary <string, string> paramter = new SortedDictionary <string, string>();

            paramter["version"]      = "0.3";
            paramter["type"]         = model.Type.ToString();
            paramter["invNum"]       = model.InvNum;
            paramter["action"]       = ActionParameter.InvoiceDetailApi;
            paramter["generation"]   = "V2";
            paramter["invTerm"]      = model.InvTerm;
            paramter["invDate"]      = model.InvDate.ToString("yyyy/MM/dd");
            paramter["encrypt"]      = model.Encrypt;
            paramter["sellerID"]     = model.SellerID;
            paramter["randomNumber"] = model.RandomNumber;
            paramter["UUID"]         = model.UUID;
            paramter["appID"]        = ConfigSetting.GovAppId;

            return(ParameterHelper.DictionaryToParameter(paramter));
        }
示例#15
0
        protected override string SetParameter(qryInvDetailModel model)
        {
            SortedDictionary <string, string> paramter = new SortedDictionary <string, string>();

            paramter["version"]      = "0.3";
            paramter["action"]       = ActionParameter.QryInvDetailApi;
            paramter["invTerm"]      = model.invTerm;
            paramter["UUID"]         = model.UUID;
            paramter["type"]         = model.type;
            paramter["invNum"]       = model.invNum;
            paramter["generation"]   = model.generation;
            paramter["invTerm"]      = model.invTerm;
            paramter["invDate"]      = model.invDate;
            paramter["encrypt"]      = model.encrypt;
            paramter["sellerID"]     = model.sellerID;
            paramter["randomNumber"] = model.randomNumber;
            paramter["appID"]        = ConfigSetting.GovAppId;
            return(ParameterHelper.DictionaryToParameter(paramter));
        }
        protected override string SetParameter(DonatedGroupModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]    = "0.1",
                ["appID"]      = ConfigSetting.GovAppId,
                ["ban"]        = model.Ban,
                ["account"]    = model.Account,
                ["password"]   = model.Password,
                ["invoiceYmS"] = model.InvoiceYmS.ToString("yyyyMM"),
                ["invoiceYmE"] = model.InvoiceYmE.ToString("yyyyMM"),
                ["hsnNm"]      = model.HsnNm,
                ["busiChiNm"]  = model.BusiChiNm,
                ["cardTypeNm"] = model.CardTypeNm,
                ["cardCodeNm"] = model.CardCodeNm
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
        protected override string SetParameter(CarrierDetailModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]      = "0.3",
                ["action"]       = GetMapperAction,
                ["cardType"]     = model.CardType.GetCardName(),
                ["cardNo"]       = model.CardNo,
                ["expTimeStamp"] = model.TimeStampMAX,
                ["timeStamp"]    = model.TimeStamp,
                ["invNum"]       = model.InvNum,
                ["invDate"]      = model.InvDate,
                ["uuid"]         = model.UUID,
                ["cardEncrypt"]  = model.CardEncrypt,
                ["appID"]        = ConfigSetting.GovAppId
            };


            return(ParameterHelper.DictionaryToParameter(parameter));
        }
示例#18
0
        protected override string SetParameter(CarrierTitleModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]        = model.Version,
                ["action"]         = GetMapperAction,
                ["cardType"]       = model.CardType.GetAttributeValue <ContentAttribute, string>(x => x.Name),
                ["cardNo"]         = model.CardNo,
                ["expTimeStamp"]   = model.TimeStampMAX,
                ["timeStamp"]      = model.TimeStamp,
                ["startDate"]      = model.StartDate.ToString("yyyy/MM/dd"),
                ["endDate"]        = model.EndDate.ToString("yyyy/MM/dd"),
                ["onlyWinningInv"] = model.OnlyWinningInv.ToString(),
                ["uuid"]           = model.UUID,
                ["cardEncrypt"]    = model.CardEncrypt,
                ["appID"]          = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
示例#19
0
        protected override string SetParameter(InvoiceDetailModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]      = model.Version,
                ["type"]         = model.Type.ToString(),
                ["invNum"]       = model.InvNum,
                ["action"]       = GetMapperAction,
                ["generation"]   = "V2",
                ["invTerm"]      = model.InvTerm,
                ["invDate"]      = model.InvDate.ToString("yyyy/MM/dd"),
                ["encrypt"]      = model.Encrypt,
                ["sellerID"]     = model.SellerID,
                ["randomNumber"] = model.RandomNumber,
                ["UUID"]         = model.UUID,
                ["appID"]        = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
        protected override string SetParameter(CarrierDonateModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]      = model.Version,
                ["serial"]       = model.Serial,
                ["action"]       = GetMapperAction,
                ["cardType"]     = model.CardType.GetCardName(),
                ["cardNo"]       = model.CardNo,
                ["expTimeStamp"] = model.TimeStampMAX,
                ["timeStamp"]    = model.TimeStamp,
                ["invNum"]       = model.InvNum,
                ["invDate"]      = model.InvDate.ToString("yyyy/MM/dd"),
                ["uuid"]         = model.UUID,
                ["cardEncrypt"]  = model.CardEncrypt,
                ["npoBan"]       = model.NpoBan,
                ["appID"]        = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }
        protected override string SetParameter(qryInvDetailModel model)
        {
            SortedDictionary <string, string> parameter = new SortedDictionary <string, string>
            {
                ["version"]      = "0.3",
                ["action"]       = GetMapperAction,
                ["invTerm"]      = model.InvTerm,
                ["UUID"]         = model.UUID,
                ["type"]         = model.type,
                ["InvNum"]       = model.invNum,
                ["generation"]   = model.generation,
                ["invTerm"]      = model.InvTerm,
                ["invDate"]      = model.invDate,
                ["encrypt"]      = model.encrypt,
                ["sellerID"]     = model.sellerID,
                ["randomNumber"] = model.randomNumber,
                ["appID"]        = ConfigSetting.GovAppId
            };

            return(ParameterHelper.DictionaryToParameter(parameter));
        }