Esempio n. 1
0
        private void BindCity()
        {
            DictManager dictManager = new DictManager();
            DataTable   dt          = new DataTable();

            dt.Columns.Add("ID", Type.GetType("System.String"));
            dt.Columns.Add("Name", Type.GetType("System.String"));
            DataRow defaultRow = dt.NewRow();

            defaultRow["ID"]   = "";
            defaultRow["Name"] = "";
            dt.Rows.Add(defaultRow);
            DataTable platformTable = dictManager.GetDictList("03");

            foreach (DataRow row in platformTable.Rows)
            {
                DataRow newRow = dt.NewRow();
                newRow["ID"]   = row["ID"].ToString();
                newRow["Name"] = row["Name"];
                dt.Rows.Add(newRow);
            }
            CityID.DataSource     = dt;
            CityID.DataTextField  = "Name";
            CityID.DataValueField = "ID";
            CityID.DataBind();
        }
Esempio 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
            {
                try
                {
                    uid = res["UID"].ToString().Trim();
                }
                catch
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "数据格式不正确"));
                }

                DictManager dictManager = new DictManager();
                DataTable   dt          = dictManager.GetDictList("05");
                if (dt == null || dt.Rows.Count <= 0)
                {
                    return(SiteHelper.GetJsonFromHashTable(null, "faild", "亲,没有数据了"));
                }
                else
                {
                    return(JsonHelper.DataTableToJson("success", "获取数据成功", dt, "GetVehicleRepairItems"));
                }
            }
        }
Esempio n. 3
0
        private void BindCatelog()
        {
            DictManager dictManager = new DictManager();
            DataTable   dt          = new DataTable();

            dt.Columns.Add("ID", Type.GetType("System.String"));
            dt.Columns.Add("Name", Type.GetType("System.String"));
            DataRow defaultRow = dt.NewRow();

            defaultRow["ID"]   = "";
            defaultRow["Name"] = "全部分类";
            dt.Rows.Add(defaultRow);
            DataTable dt2 = dictManager.GetDictList("04");

            foreach (DataRow row in dt2.Rows)
            {
                DataRow newRow = dt.NewRow();
                newRow["ID"]   = row["ID"].ToString();
                newRow["Name"] = row["Name"];
                dt.Rows.Add(newRow);
            }
            selCatelog.DataSource     = dt;
            selCatelog.DataTextField  = "Name";
            selCatelog.DataValueField = "ID";
            selCatelog.DataBind();
        }
Esempio n. 4
0
        public string Execute(Hashtable res)
        {
            if (res["UID"] == null || res["UID"].ToString().Trim().Length <= 0)
            {
                return(SiteHelper.GetJsonFromHashTable(null, "faild", "参数不完整"));
            }
            else
            {
                uid = res["UID"].ToString().Trim();

                ListApiResp resp = new ListApiResp();
                resp.Code    = "-1";
                resp.Message = "";

                DictManager dictManager = new DictManager();
                DataTable   dt          = dictManager.GetDictList("05");
                if (dt != null && dt.Rows.Count > 0)
                {
                    List <GetVehicleFaultTypeItem> list = new List <GetVehicleFaultTypeItem>();
                    foreach (DataRow dr in dt.Rows)
                    {
                        GetVehicleFaultTypeItem item = new GetVehicleFaultTypeItem();
                        item.id   = dr["id"].ToString();
                        item.name = dr["name"].ToString();
                        list.Add(item);
                    }
                    resp.List  = list;
                    resp.Total = list.Count;
                    resp.Code  = "0";
                }

                return(JsonConvert.SerializeObject(resp));
            }
        }
Esempio n. 5
0
        public ApiResp Execute(System.Collections.Hashtable params_ht)
        {
            ApiResp resp = new ApiResp();

            resp.code = "-1";

            string client_id = params_ht["client_id"].ToString();
            long   timestamp = long.Parse(params_ht["timestamp"].ToString());
            string sign      = params_ht["sign"].ToString();

            List <GetCompanyInfo_Item> data = new List <GetCompanyInfo_Item>();

            GetCompanyInfo_Item item = new GetCompanyInfo_Item();

            SysSettingManager settingManager = new SysSettingManager();
            DictManager       dictManager    = new DictManager();

            item.insurance_amount = 0.00;
            item.insurance_url    = "";
            item.return_in_fee    = "";
            string outServiceAreaFee = settingManager.GetValueByKey("OutServiceAreaFee");

            if (outServiceAreaFee.StartsWith("+"))
            {
                item.return_out_fee = string.Format("超出运营区域将加收{0}元调度费", outServiceAreaFee.Substring(1, outServiceAreaFee.Length - 1));
            }
            else
            {
                item.return_out_fee = string.Format("超出运营区域将加收{0}倍作为调度费", outServiceAreaFee.Substring(1, outServiceAreaFee.Length - 1));
            }
            item.call_tel = settingManager.GetValueByKey("ServiceTel");
            DataTable city_dt   = dictManager.GetDictList("03");
            string    open_city = "";

            if (city_dt != null && city_dt.Rows.Count > 0)
            {
                foreach (DataRow dr in city_dt.Rows)
                {
                    if (open_city.Length > 0 && !open_city.EndsWith("|"))
                    {
                        open_city += "|";
                    }
                    open_city += dr["Name"].ToString();
                }
            }
            item.open_city = open_city;
            item.timestamp = (long)(DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds;
            data.Add(item);

            resp.code = "0";
            resp.msg  = "成功";
            resp.data = data;

            return(resp);
        }
Esempio n. 6
0
        private void BindCity()
        {
            DictManager dict = new DictManager();
            DataTable   dt   = dict.GetDictList("03");

            selCity.DataSource     = dt;
            selCity.DataTextField  = "Name";
            selCity.DataValueField = "ID";
            selCity.DataBind();
            selCity.Items.Insert(0, new ListItem("----全部----", "-1"));
        }
Esempio n. 7
0
        public ApiResp Execute(System.Collections.Hashtable params_ht)
        {
            ApiResp resp = new ApiResp();

            resp.code = "-1";

            string client_id = params_ht["client_id"].ToString();
            long   timestamp = long.Parse(params_ht["timestamp"].ToString());
            string sign      = params_ht["sign"].ToString();

            List <GetCars_Item> data = new List <GetCars_Item>();

            SysSettingManager  settingManager = new SysSettingManager();
            DictManager        dictManager    = new DictManager();
            ServiceAreaManager areaManager    = new ServiceAreaManager();
            string             depositMoney   = settingManager.GetValueByKey("GoldDepositAmount");

            DataTable city_dt = dictManager.GetDictList("03");

            if (city_dt != null && city_dt.Rows.Count > 0)
            {
                foreach (DataRow city_dr in city_dt.Rows)
                {
                    GetCars_Item item    = new GetCars_Item();
                    Hashtable    area_ht = areaManager.GetServiceAreaByCityCode(city_dr["remark"].ToString());
                    if (area_ht != null && area_ht.Keys.Count > 0)
                    {
                        item.coordinatePoints  = SiteHelper.GetHashTableValueByKey(area_ht, "Coordinates").Replace(";", "|");
                        item.coordinate_center = SiteHelper.GetHashTableValueByKey(area_ht, "Longitude") + "," + SiteHelper.GetHashTableValueByKey(area_ht, "Latitude");
                    }
                    item.city_name = city_dr["name"].ToString();

                    DataTable car_dt = areaManager.GetVehiclesByCity(item.city_name, 1, 9999);
                    if (car_dt != null && car_dt.Rows.Count > 0)
                    {
                        List <GetCars_Car> car_list = new List <GetCars_Car>();
                        foreach (DataRow dr in car_dt.Rows)
                        {
                            GetCars_Car car = new GetCars_Car();
                            car.id            = dr["ID"].ToString();
                            car.plate_no      = dr["LicenseNumber"].ToString();
                            car.carname       = dr["Brand"].ToString();
                            car.start_price   = double.Parse(dr["MinPrice"].ToString());
                            car.minute_price  = double.Parse(dr["MinutePrice"].ToString());
                            car.mile_price    = double.Parse(dr["KmPrice"].ToString());
                            car.deposit_money = double.Parse(depositMoney);

                            car_list.Add(car);
                        }
                        item.cars = car_list;
                    }
                    if (item.cars != null && item.cars.Count > 0)
                    {
                        data.Add(item);
                    }
                }
            }

            if (data.Count > 0)
            {
                resp.code = "0";
                resp.msg  = "成功";
                resp.data = data;
            }
            else
            {
                resp.code = "-1";
                resp.msg  = "未找到车辆信息";
            }

            return(resp);
        }