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

            if (res["UID"] == null || res["ShortTitle"] == null || res["Address"] == null || res["Longitude"] == null || res["Latitude"] == null ||
                res["AddressID"] == null || res["UID"].ToString().Trim().Length <= 0 || res["ShortTitle"].ToString().Trim().Length <= 0 ||
                res["Address"].ToString().Trim().Length <= 0 || res["Longitude"].ToString().Trim().Length <= 0 ||
                res["Latitude"].ToString().Trim().Length <= 0 || res["AddressID"].ToString().Trim().Length <= 0)
            {
                return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整"));
            }
            else
            {
                uid        = res["UID"].ToString().Trim();
                shorttitle = res["ShortTitle"].ToString().Trim();
                address    = res["Address"].ToString().Trim();
                jingdu     = res["Longitude"].ToString().Trim();
                weidu      = res["Latitude"].ToString().Trim();
                addressid  = res["AddressID"].ToString().Trim();

                Hashtable hashadd = new Hashtable();
                hashadd["ID"]         = addressid;
                hashadd["UserID"]     = uid;
                hashadd["Address"]    = address;
                hashadd["ShortTitle"] = shorttitle;
                hashadd["Longitude"]  = jingdu;
                hashadd["Latitude"]   = weidu;
                AddressManager am        = new AddressManager();
                bool           isSuccess = am.AddOrEditAddressInfo(hashadd, hashadd["ID"].ToString());
                if (isSuccess)
                {
                    return(SiteHelper.GetJsonFromHashTable(hashadd, "success", "修改地址成功", "AddressInfo"));
                }
                else
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "修改地址失败"));
                }
            }
        }