Exemplo n.º 1
0
        public string Execute(Hashtable params_ht)
        {
            Hashtable res = params_ht;

            if (res["UID"] == null || res["AccountName"] == null || res["Account"] == null || res["BankName"] == null || res["OpenBank"] == null ||
                res["UID"].ToString().Trim().Length <= 0 || res["AccountName"].ToString().Trim().Length <= 0 ||
                res["Account"].ToString().Trim().Length <= 0 || res["BankName"].ToString().Trim().Length <= 0 ||
                res["OpenBank"].ToString().Trim().Length <= 0)
            {
                return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整"));
            }
            else
            {
                uid         = res["UID"].ToString().Trim();
                accountname = res["AccountName"].ToString().Trim();
                account     = res["Account"].ToString().Trim();
                bankname    = res["BankName"].ToString().Trim();
                openbank    = res["OpenBank"].ToString().Trim();

                Hashtable bankcard = new Hashtable();
                bankcard["ID"]          = CommonHelper.GetGuid;
                bankcard["UserID"]      = uid;
                bankcard["AccountName"] = accountname;
                bankcard["Account"]     = account;
                bankcard["BankName"]    = bankname;
                bankcard["OpenBank"]    = openbank;
                bankcard["CreateTime"]  = SiteHelper.GetWebServerCurrentTime().ToString();
                UserBankCardManager ubcm = new UserBankCardManager();
                bool isSuccess           = ubcm.AddOrEditUserBankCardInfo(bankcard, null);
                if (isSuccess)
                {
                    Hashtable userbankcard = ubcm.GetUserBankCard(uid);
                    if (userbankcard == null)
                    {
                        return(SiteHelper.GetJsonFromHashTable(null, "faild", "会员银行卡信息保存失败"));
                    }
                    else
                    {
                        return(SiteHelper.GetJsonFromHashTable(userbankcard, "success", "会员银行卡信息保存成功", "UserBankCardInfo"));
                    }
                }
                else
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "会员银行卡信息保存失败"));
                }
            }
        }
Exemplo n.º 2
0
        public string Execute(Hashtable params_ht)
        {
            Hashtable res = params_ht;

            if (res["UID"] == null || res["UID"].ToString().Trim().Length <= 0)
            {
                return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整"));
            }
            else
            {
                uid = res["UID"].ToString().Trim();
                UserBankCardManager ubcm     = new UserBankCardManager();
                Hashtable           bankcard = ubcm.GetUserBankCard(uid);
                if (bankcard == null)
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "没有数据"));
                }
                else
                {
                    return(SiteHelper.GetJsonFromHashTable(bankcard, "success", "获取数据成功", "UserBankCardInfo"));
                }
            }
        }