public JsonResult GetAreaList(string pid, int type) { //1:获取省 2:获取市 3:获取县 var areaList = AreaBll.GetList(pid, type); return(Json(areaList)); }
/// <summary> /// area grid cell double click for update /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dgvArea_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex != -1) { string strArea = dgvArea.CurrentRow.Cells["dgvtxtarea"].Value.ToString(); if (strArea != "NA") { AreaInfo infoArea = new AreaInfo(); AreaBll BllArea = new AreaBll(); infoArea = BllArea.AreaFill(Convert.ToDecimal(dgvArea.CurrentRow.Cells[1].Value.ToString())); txtAreaName.Text = infoArea.AreaName; txtNarration.Text = infoArea.Narration; btnSave.Text = "Update"; btnDelete.Enabled = true; txtAreaName.Focus(); decAreaId = Convert.ToDecimal(dgvArea.CurrentRow.Cells[1].Value.ToString()); } else { Messages.WarningMessage("NA Area cannot update or delete"); Clear(); } } } catch (Exception ex) { MessageBox.Show("AR16" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 获取酒店基础信息 /// </summary> /// <returns></returns> public DataResult GetHotelList() { var result = new DataResult(); var url = AtourAuth_URL + "hotel/getHotelList"; var citylist = AreaBll.GetCityList(); if (citylist != null && citylist.Any()) { foreach (var item in citylist) { Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("appid", AtourAuth_APPID); dic.Add("cityId", item.AA_CityId.ToString()); var sign = AtourSignUtil.GetSignUtil(dic); var hotellst = ApiHelper.HttpGet(url + "?appId=" + AtourAuth_APPID + "&cityId=" + item.AA_CityId.ToString() + "&sign=" + sign); if (!string.IsNullOrWhiteSpace(hotellst)) { var data = JsonConvert.DeserializeObject <AtourHotelResponse>(hotellst); if (data != null && data.msg == "success" && data.result.Any()) { foreach (var hotel in data.result) { } } } } } return(result); }
public void BindPArea() { AreaBll areaBll = new AreaBll(); DataTable dt = areaBll.GetAllList().Tables[0]; for (int i = 0; i < dt.Rows.Count; i++) { this.ddlAreaId.Items.Add(new ListItem(dt.Rows[i]["area_name"].ToString(), dt.Rows[i]["area_id"].ToString())); } }
/// <summary> /// Function to fill Area combobox /// </summary> public void AreaForComboFill() { try { AreaBll BllArea = new AreaBll(); List <DataTable> dtbl = BllArea.AreaViewFOrCombofill(); cmbArea.DataSource = dtbl[0]; cmbArea.DisplayMember = "areaName"; cmbArea.ValueMember = "areaId"; cmbArea.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show("SORP6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill area datagridview /// </summary> public void AreaGridfill() { AreaBll BllArea = new AreaBll(); try { List <DataTable> listObj = new List <DataTable>(); listObj = BllArea.AreaOnlyViewAll(); dgvArea.DataSource = listObj[0]; } catch (Exception ex) { MessageBox.Show("AR1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// 获取城市列表 /// </summary> /// <returns></returns> public DataResult GetCityList() { var result = new DataResult(); var url = AtourAuth_URL + "city/getCityList"; Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("appid", AtourAuth_APPID); var sign = AtourSignUtil.GetSignUtil(dic); var citylist = ApiHelper.HttpGet(url + "?appId=" + AtourAuth_APPID + "&sign=" + sign); if (!string.IsNullOrWhiteSpace(citylist)) { var data = JsonConvert.DeserializeObject <AtourCityResponse>(citylist); if (data != null && data.msg == "success" && data.result.Any()) { var modellist = new List <H_DistributorAreaInfoModel>(); foreach (var item in data.result) { var cityid = AreaBll.IsInTable(item.cityId); if (cityid == 0) { var model = new H_DistributorAreaInfoModel { AA_ProvinceId = 0, AA_ProvinceName = item.provinceName, AA_CityId = item.cityId, AA_CityName = item.cityName, AA_Type = 1 }; modellist.Add(model); } } var issuccess = AreaBll.Insert(modellist); result.Code = issuccess ? DataResultType.Sucess : DataResultType.Fail; } } return(result); }
/// <summary> /// delete function /// </summary> public void Delete() { try { if (Messages.DeleteConfirmation()) { AreaBll BllArea = new AreaBll(); if (BllArea.AreaDeleteReference(decAreaId) <= 0) { Messages.ReferenceExistsMessage(); } else { Messages.DeletedMessage(); Clear(); } } } catch (Exception ex) { MessageBox.Show("AR4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public AreaService(Bll bll) { this.db = bll; dbSet = db.Areas; }
public AreaService() { db = new Bll(false, false, false, false); dbSet = db.Areas; }
public AreaService() { db = Bll.NewBllNoRelation(); dbSet = db.Areas; }
/// <summary> /// 通过文件导入基站信息 /// </summary> /// <param name="filePath"></param> /// <param name="devBlls"></param> /// <param name="topoTree"></param> /// <returns></returns> public static bool ImportLocationDeviceFromFile(string filePath, ArchorBll archorBll, AreaBll topoTree) { if (!File.Exists(filePath) || archorBll == null || topoTree == null) { return(false); } LocationDeviceList initInfo = XmlSerializeHelper.LoadFromFile <LocationDeviceList>(filePath); foreach (var devArea in initInfo.DepList) { Area topo = topoTree.FindByName(devArea.Name); if (topo == null) { continue; } AddLocationDev(devArea.DevList, archorBll, topo); } return(true); }
/// <summary> /// Checking the invalid entries fro save or update /// </summary> public void SaveOrEdit() { try { if (txtAreaName.Text.Trim() == string.Empty) { Messages.InformationMessage("Enter area name"); txtAreaName.Focus(); } else { AreaInfo infoArea = new AreaInfo(); AreaBll BllArea = new AreaBll(); infoArea.AreaName = txtAreaName.Text.Trim(); infoArea.Narration = txtNarration.Text.Trim(); infoArea.Extra1 = string.Empty; infoArea.Extra2 = string.Empty; infoArea.AreaId = decAreaId; if (btnSave.Text == "Save") { if (Messages.SaveConfirmation()) { if (BllArea.AreaNameCheckExistence(txtAreaName.Text.Trim(), 0) == false) { decAreaId = BllArea.AreaAddWithIdentity(infoArea); AreaGridfill(); Messages.SavedMessage(); Clear(); decIdForOtherForms = decAreaId; if (frmRouteObj != null) { this.Close(); } if (frmCustomerobj != null) { this.Close(); } if (frmSupplierobj != null) { this.Close(); } } else { Messages.InformationMessage("Area name already exist"); txtAreaName.Focus(); } } } else { if (Messages.UpdateConfirmation()) { if (BllArea.AreaNameCheckExistence(txtAreaName.Text.Trim(), decAreaId) == false) { infoArea.AreaId = decAreaId; if (BllArea.AreaUpdate(infoArea)) { AreaGridfill(); Messages.UpdatedMessage(); Clear(); } } else { Messages.InformationMessage("Area name already exist"); txtAreaName.Focus(); } } } } } catch (Exception ex) { MessageBox.Show("AR3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public string GetArea() { var json = new AreaBll().GetAllArea(); return(JsonConvert.SerializeObject(json)); }