/// <summary> /// 得到籍贯 /// </summary> public string GetProvinceAndCity(string Birthplace) { string returnStr = ""; string[] arrBirthplace = Birthplace.Split(','); if (arrBirthplace != null && arrBirthplace.Length > 1) { EyouSoft.BLL.CompanyStructure.City bllCity = new EyouSoft.BLL.CompanyStructure.City(); EyouSoft.BLL.CompanyStructure.Province bllProvince = new EyouSoft.BLL.CompanyStructure.Province(); if (arrBirthplace[0] != "") { EyouSoft.Model.CompanyStructure.Province modelProvince = bllProvince.GetModel(Utils.GetInt(arrBirthplace[0])); if (modelProvince != null) { returnStr += modelProvince.ProvinceName + "省"; } } if (arrBirthplace[1] != "") { EyouSoft.Model.CompanyStructure.City modelCity = bllCity.GetModel(Utils.GetInt(arrBirthplace[1])); if (modelCity != null) { returnStr += modelCity.CityName + "市"; } } } return(returnStr); }
/// <summary> /// init province /// </summary> protected void InitProvince() { txtProvince.Items.Clear(); txtProvince.Items.Add(new ListItem("-请选择-", "0")); var items = new EyouSoft.BLL.CompanyStructure.Province().GetList(Master.CompanyId); if (items != null && items.Count > 0) { foreach (var item in items) { txtProvince.Items.Add(new ListItem(item.ProvinceName, item.Id.ToString())); } } }
protected void Page_Load(object sender, EventArgs e) { var items = new EyouSoft.BLL.CompanyStructure.Province().GetProvinceInfo(CurrentUserCompanyID); string s = "var province={0};"; if (items != null && items.Count > 0) { RegisterScript(string.Format(s, Newtonsoft.Json.JsonConvert.SerializeObject(items))); } else { RegisterScript(string.Format(s, null)); } }
/// <summary> /// 获得常用城市 /// </summary> /// 修改:田想兵 2011.5.24 /// 修改:弹出选择 /// <param name="selectIndex"></param> protected void CityDataInit(int provinceId, int cityId) { if (provinceId != 0) { EyouSoft.BLL.CompanyStructure.Province pBll = new EyouSoft.BLL.CompanyStructure.Province(); EyouSoft.Model.CompanyStructure.Province pModel = pBll.GetModel(provinceId); if (pModel != null) { lt_province.Text = pModel.ProvinceName; if (cityId != 0) { EyouSoft.BLL.CompanyStructure.City cBll = new EyouSoft.BLL.CompanyStructure.City(); EyouSoft.Model.CompanyStructure.City cModel = cBll.GetModel(cityId); //if (cModel != null) //{ // lt_city.Text = cModel.CityName; //} } } } }
protected void Page_Load(object sender, EventArgs e) { StringBuilder strBuilder = new StringBuilder(); EyouSoft.BLL.CompanyStructure.Province pBll = new EyouSoft.BLL.CompanyStructure.Province(); IList <EyouSoft.Model.CompanyStructure.Province> list = pBll.GetList(CompanyId); strBuilder.AppendFormat("<option value=\"0\">请选择</option>"); if (list != null && list.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.Province p in list) { if (p.Id == ProvinceId) { strBuilder.AppendFormat("<option value=\"{0}\" selected=\"selected\">{1}</option>", p.Id, p.ProvinceName); continue; } strBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", p.Id, p.ProvinceName); } } provinceHtml = strBuilder.ToString(); }
//绑定省 protected void BindPro() { //清空省份的下拉框 this.ddlPro.Items.Clear(); //添加默认选择项"-请选择-" this.ddlPro.Items.Add(new ListItem("-请选择-", "0")); //省份BLL EyouSoft.BLL.CompanyStructure.Province proBll = new EyouSoft.BLL.CompanyStructure.Province(); //根据公司ID取得相应结果集list IList <EyouSoft.Model.CompanyStructure.Province> list = proBll.GetList(companyId); //循环将值添加到下拉框 if (list != null && list.Count > 0) { for (int i = 0; i < list.Count; i++) { ListItem item = new ListItem(); item.Text = list[i].ProvinceName; item.Value = Convert.ToString(list[i].Id); this.ddlPro.Items.Add(item); } } }
protected void LinkButton_Click(object sender, EventArgs e) { //餐馆编号 int tid = Utils.GetInt(Utils.GetQueryStringValue("tid")); if (tid > 0) { Restaurantinfo = RestaurantBll.GetRestaurantInfo(tid); Restaurantinfo.Id = tid; } else { Restaurantinfo.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.餐馆; } //省份编号 Restaurantinfo.ProvinceId = this.ucProvince1.ProvinceId; EyouSoft.Model.CompanyStructure.Province Provincemodel = new EyouSoft.BLL.CompanyStructure.Province().GetModel(this.ucProvince1.ProvinceId); if (Provincemodel != null) { Restaurantinfo.ProvinceName = Provincemodel.ProvinceName; } //城市编号 Restaurantinfo.CityId = this.ucCity1.CityId; EyouSoft.Model.CompanyStructure.City citymodel = new EyouSoft.BLL.CompanyStructure.City().GetModel(this.ucCity1.CityId); if (citymodel != null) { Restaurantinfo.CityName = citymodel.CityName; } //单位名称 Restaurantinfo.UnitName = Utils.GetFormValue("Txtunitsnname"); //菜系 Restaurantinfo.Cuisine = Utils.GetFormValue("TxtCuisine"); //单位地址 Restaurantinfo.UnitAddress = Utils.GetFormValue("TxtAddress"); //餐馆简介 Restaurantinfo.Introduce = Utils.GetFormValue("ResProfile"); //导游词 Restaurantinfo.TourGuide = Utils.GetFormValue("TourGuids"); //当前公司编号 Restaurantinfo.CompanyId = this.SiteUserInfo.CompanyID; //当前操作员编号 Restaurantinfo.OperatorId = this.SiteUserInfo.ID; //备注 Restaurantinfo.Remark = Utils.GetFormValue("TxtRemarks"); Restaurantinfo.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); Restaurantinfo.IsDelete = false; string[] accmanname = Utils.GetFormValues("inname"); string[] accmandate = Utils.GetFormValues("indate"); string[] accmanphone = Utils.GetFormValues("inphone"); string[] accmanmobile = Utils.GetFormValues("inmobile"); string[] accmanqq = Utils.GetFormValues("inqq"); string[] accmanemail = Utils.GetFormValues("inemail"); string[] accmanefax = Utils.GetFormValues("inefax"); for (int i = 0; i < accmanname.Length; i++) { EyouSoft.Model.CompanyStructure.SupplierContact scModel = new EyouSoft.Model.CompanyStructure.SupplierContact(); scModel.ContactName = accmanname[i]; scModel.JobTitle = accmandate[i]; scModel.ContactTel = accmanphone[i]; scModel.ContactMobile = accmanmobile[i]; scModel.QQ = accmanqq[i]; scModel.Email = accmanemail[i]; scModel.ContactFax = accmanefax[i]; scModel.CompanyId = SiteUserInfo.CompanyID; scModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.餐馆; Restaurantinfo.SupplierContact.Add(scModel); } int res = 0; if (tid > 0) { //修改餐馆信息 res = RestaurantBll.UpdateRestaurantInfo(Restaurantinfo); } else { //添加保险餐馆信息 res = RestaurantBll.InsertRestaurantInfo(Restaurantinfo); } if (res > 0) { MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide(); {2}", "保存成功!", Utils.GetQueryStringValue("iframeId"), tid > 0 ? "window.parent.location.reload();" : "window.parent.location.href='/SupplierControl/Restaurants/Restaurantslist.aspx';")); } else { MessageBox.ResponseScript(this, ";alert('保存失败!');"); } }
protected void btnSave_Click1(object sender, EventArgs e) { #region 数据验证 string msg = "请选择图片文件"; if (!EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "car_img", new[] { ".jpg", ".png", ".gif", ".bmp", ".jpeg" }, null, out msg)) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, Utils.ShowMsg("请选择图片文件上传!")); return; } #endregion //创建车辆信息类 //创建车队信息类 EyouSoft.Model.SupplierStructure.SupplierCarTeam carTeam = new EyouSoft.Model.SupplierStructure.SupplierCarTeam(); if (Utils.GetInt(Utils.GetQueryStringValue("cid")) != 0) { carTeam = carTeamBll.GetCarTeamInfo(cid); } //获取页面上所有联系人的信息 IList <EyouSoft.Model.CompanyStructure.SupplierContact> contacts = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); string[] linkman_names = Utils.GetFormValues("linkman_name"); string[] linkman_bussiness = Utils.GetFormValues("linkman_bussiness"); string[] linkman_phone = Utils.GetFormValues("linkman_phone"); string[] linkman_tel = Utils.GetFormValues("linkman_tel"); string[] linkman_qq = Utils.GetFormValues("linkman_qq"); string[] linkman_email = Utils.GetFormValues("linkman_email"); string[] linkman_fax = Utils.GetFormValues("linkman_fax"); //判断页面上添加联系人的数量 if (linkman_names.Length >= 1) { for (int i = 0; i < linkman_names.Length; i++) { //创建供应商联系人类 EyouSoft.Model.CompanyStructure.SupplierContact contact = new EyouSoft.Model.CompanyStructure.SupplierContact(); contact.QQ = linkman_qq[i]; contact.Email = linkman_email[i]; contact.ContactName = linkman_names[i]; contact.ContactMobile = linkman_phone[i]; contact.ContactTel = linkman_tel[i]; contact.JobTitle = linkman_bussiness[i]; contact.ContactFax = linkman_fax[i]; contacts.Add(contact); } } //获取页面上所有车辆的信息 IList <EyouSoft.Model.SupplierStructure.SupplierCarInfo> carInfos = new List <EyouSoft.Model.SupplierStructure.SupplierCarInfo>(); string[] car_types = Utils.GetFormValues("car_type"); string[] car_nums = Utils.GetFormValues("car_num"); string[] car_prices = Utils.GetFormValues("car_price"); string[] car_drivers = Utils.GetFormValues("car_driver"); string[] car_driverPhones = Utils.GetFormValues("car_driverPhone"); string[] car_worlds = Utils.GetFormValues("car_world"); string[] hid_img = Utils.GetFormValues("hid_img"); //判断页面上的添加车辆的数量 if (car_types.Length >= 1) { for (int i = 0; i < car_types.Length; i++) { EyouSoft.Model.SupplierStructure.SupplierCarInfo carInfo = new EyouSoft.Model.SupplierStructure.SupplierCarInfo(); string imagePath = ""; string imgName = ""; EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[i], "CarFile", out imagePath, out imgName); carInfo.CarNumber = car_nums[i]; carInfo.CarType = car_types[i]; carInfo.DriverName = car_drivers[i]; carInfo.DriverPhone = car_driverPhones[i]; carInfo.GuideWord = car_worlds[i]; if (imagePath == "" && hid_img[i] != "") { carInfo.Image = hid_img[i]; } else { carInfo.Image = imagePath; } carInfo.Price = Utils.GetDecimal(car_prices[i], 0); carInfo.PrivaderId = SiteUserInfo.CompanyID; carInfos.Add(carInfo); } } carTeam.CarsInfo = carInfos; carTeam.SupplierContact = contacts; carTeam.Remark = Utils.GetFormValue("companyRemark"); carTeam.UnitAddress = Utils.GetFormValue("companyAddress"); carTeam.UnitName = Utils.GetFormValue("companyName"); carTeam.CityId = Utils.GetInt(this.city_id.Value); carTeam.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.车队; carTeam.CompanyId = SiteUserInfo.CompanyID; carTeam.ProvinceId = Utils.GetInt(this.pro_id.Value); //设置车队信息的省份名字 EyouSoft.Model.CompanyStructure.Province Provincemodel = new EyouSoft.BLL.CompanyStructure.Province().GetModel(this.ucProvince1.ProvinceId); if (Provincemodel != null) { carTeam.ProvinceName = Provincemodel.ProvinceName; } //设置车队信息的城市名字 EyouSoft.Model.CompanyStructure.City citymodel = new EyouSoft.BLL.CompanyStructure.City().GetModel(this.ucCity1.CityId); if (citymodel != null) { carTeam.CityName = citymodel.CityName; } int result = 0; if (Utils.GetInt(Utils.GetQueryStringValue("cid")) != 0) { result = carTeamBll.UpdateCarTeam(carTeam); } else { result = carTeamBll.InsertCarTeamInfo(carTeam); } if (result > 0) { MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.location='/SupplierControl/CarsManager/CarsList.aspx';window.parent.Boxy.getIframeDialog('{1}').hide()", "保存成功", Utils.GetQueryStringValue("iframeId"))); } else { MessageBox.ResponseScript(this, ";alert('保存失败!');"); } }
protected void LinkButton1_Click(object sender, EventArgs e) { tid = Utils.GetInt(Utils.GetFormValue("tid")); if (tid > 0) { //获取保险信息 Insurancemodel = Insurancebll.GetModel(tid, SiteUserInfo.CompanyID); } else { Insurancemodel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.保险; } //省份编号 int ProvinceId = this.ucProvince1.ProvinceId; string proname = ""; EyouSoft.Model.CompanyStructure.Province proviceModel = new EyouSoft.BLL.CompanyStructure.Province().GetModel(ProvinceId); if (proviceModel != null) { proname = proviceModel.ProvinceName; } //城市编号 int CityId = this.ucCity1.CityId; string Cityname = ""; EyouSoft.Model.CompanyStructure.City cityModel = new EyouSoft.BLL.CompanyStructure.City().GetModel(CityId); if (cityModel != null) { Cityname = cityModel.CityName; } //单位名称 string Unitsname = Utils.GetFormValue("Txtunitsnname"); //单位地址 string Unitaddress = Utils.GetFormValue("TxtAddress"); //合作协议 if (Request.Files.Count > 0) { string litmsg = ""; if (!EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "workAgree", new[] { ".gif", ".jpeg", ".jpg", ".png", ".xls", ".doc", ".docx", ".rar", ".txt" }, null, out litmsg)) { MessageBox.ResponseScript(this, ";alert('" + litmsg + "');"); return; } string filepath = string.Empty; string oldfilename = string.Empty; if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename)) { if (filepath.Trim() != "" && oldfilename.Trim() != "") { Insurancemodel.AgreementFile = filepath; } } } //备注 string TxtRemarks = Utils.GetFormValue("TxtRemarks"); //当前公司编号 int CompanyId = this.SiteUserInfo.CompanyID; //当前操作员编号 int OperatorId = this.SiteUserInfo.ID; //联系人信息 Insurancemodel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); string[] accmanname = Utils.GetFormValues("inname"); string[] accmandate = Utils.GetFormValues("indate"); string[] accmanphone = Utils.GetFormValues("inphone"); string[] accmanmobile = Utils.GetFormValues("inmobile"); string[] accmanqq = Utils.GetFormValues("inqq"); string[] accmanemail = Utils.GetFormValues("inemail"); string[] accmanefax = Utils.GetFormValues("inefax"); for (int i = 0; i < accmanname.Length; i++) { EyouSoft.Model.CompanyStructure.SupplierContact scmodel = new EyouSoft.Model.CompanyStructure.SupplierContact(); scmodel.ContactName = accmanname[i]; scmodel.JobTitle = accmandate[i]; scmodel.ContactTel = accmanphone[i]; scmodel.ContactMobile = accmanmobile[i]; scmodel.QQ = accmanqq[i]; scmodel.Email = accmanemail[i]; scmodel.ContactFax = accmanefax[i]; scmodel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.保险; Insurancemodel.SupplierContact.Add(scmodel); } Insurancemodel.ProvinceId = ProvinceId; Insurancemodel.ProvinceName = proname; Insurancemodel.CityId = CityId; Insurancemodel.CityName = Cityname; Insurancemodel.UnitName = Unitsname; Insurancemodel.UnitAddress = Unitaddress; Insurancemodel.Remark = TxtRemarks; Insurancemodel.CompanyId = CompanyId; Insurancemodel.OperatorId = OperatorId; Insurancemodel.IssueTime = System.DateTime.Now; bool res = false; if (tid > 0) { //修改保险 res = Insurancebll.Update(Insurancemodel); } else { //添加保险 res = Insurancebll.Add(Insurancemodel); } if (res) { MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide(); {2}", "保存成功!", Utils.GetQueryStringValue("iframeId"), tid > 0 ? "window.parent.location.reload();" : "window.parent.location.href='/SupplierControl/Insurance/Insurancelist.aspx';")); } else { MessageBox.ResponseScript(this, ";alert('保存失败!');"); } }
protected void LinkButton1_Click(object sender, EventArgs e) { //接受参数 tid = Utils.GetInt(Utils.GetQueryStringValue("tid")); if (tid > 0) { Hotelinfo = HotelBll.GetHotelInfo(tid); Hotelinfo.Id = tid; } else { Hotelinfo.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店; } //省份编号 Hotelinfo.ProvinceId = this.ucProvince1.ProvinceId; EyouSoft.Model.CompanyStructure.Province Provincemodel = new EyouSoft.BLL.CompanyStructure.Province().GetModel(this.ucProvince1.ProvinceId); if (Provincemodel != null) { Hotelinfo.ProvinceName = Provincemodel.ProvinceName; } //城市编号 Hotelinfo.CityId = this.ucCity1.CityId; EyouSoft.Model.CompanyStructure.City citymodel = new EyouSoft.BLL.CompanyStructure.City().GetModel(this.ucCity1.CityId); if (citymodel != null) { Hotelinfo.CityName = citymodel.CityName; } //单位名称 string unionname = Utils.GetFormValue("unionname"); //酒店星级 int HotelStart = Utils.GetInt(Utils.GetFormValue(this.HotelStart.UniqueID)); //酒店地址 string TxtHotelAddress = Utils.GetFormValue("TxtHotelAddress"); //酒店简介 string HotelIntroduction = Utils.GetFormValue("HotelIntroduction"); #region 酒店图片 if (Request.Files.Count > 0) { string msg = ""; if (!EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "file_landspace", new[] { ".gif", ".jpg", ".jpeg", ".png" }, null, out msg)) { MessageBox.ResponseScript(this, ";alert('" + msg + "');"); BindHotelStart(); return; } Hotelinfo.SupplierPic = new List <EyouSoft.Model.SupplierStructure.SupplierPic>(); EyouSoft.Model.SupplierStructure.SupplierPic SupplierPic = new EyouSoft.Model.SupplierStructure.SupplierPic(); string filepath = string.Empty; string oldfilename = string.Empty; //if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["HotelImage"], "SupplierControlFile", out filepath, out oldfilename)) //{ // if (filepath.Trim() != "" && oldfilename.Trim() != "") // { // SupplierPic.PicPath = filepath; // SupplierPic.PicName = oldfilename; // Hotelinfo.SupplierPic.Add(SupplierPic); // } //} //遍历files取出file. for (int i = 0; i < Request.Files.Count; i++) { bool result_landspace = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[i], "SightImg", out filepath, out oldfilename); if (result_landspace) { Hotelinfo.SupplierPic = DisonseImg_Sight_Add(filepath, oldfilename, Hotelinfo.SupplierPic); } } } //判断是新增还是修改,修改调用下马的方法 if (tid > 0) { //取出页面上未修改的图片 Hotelinfo.SupplierPic = GetImg_Photo(this.hidImgPhoto.Value, Hotelinfo.SupplierPic); } #endregion //导游词 string TourGuids = Utils.GetFormValue("TourGuids"); //当前公司编号 Hotelinfo.CompanyId = this.SiteUserInfo.CompanyID; //当前操作人编号 Hotelinfo.OperatorId = this.SiteUserInfo.ID; #region 联系人信息 Hotelinfo.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); string[] UserName = Utils.GetFormValues("inname"); string[] Userdate = Utils.GetFormValues("indate"); string[] Userphone = Utils.GetFormValues("inphone"); string[] Usermobile = Utils.GetFormValues("inmobile"); string[] Userqq = Utils.GetFormValues("inqq"); string[] Usermail = Utils.GetFormValues("inemail"); string[] Userfax = Utils.GetFormValues("inefax"); for (int i = 0; i < UserName.Length; i++) { EyouSoft.Model.CompanyStructure.SupplierContact scmodel = new EyouSoft.Model.CompanyStructure.SupplierContact(); scmodel.CompanyId = SiteUserInfo.CompanyID; scmodel.ContactName = UserName[i]; scmodel.JobTitle = Userdate[i]; scmodel.ContactTel = Userphone[i]; scmodel.ContactMobile = Usermobile[i]; scmodel.QQ = Userqq[i]; scmodel.Email = Usermail[i]; scmodel.ContactFax = Userfax[i]; scmodel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店; Hotelinfo.SupplierContact.Add(scmodel); } #endregion #region 价格信息 Hotelinfo.RoomTypes = new List <EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo>(); string[] Chamber = Utils.GetFormValues("Chamber"); string[] SalaesPrices = Utils.GetFormValues("SalaesPrices"); string[] SettlementPrice = Utils.GetFormValues("SettlementPrice"); string[] radiobtnValue = Utils.GetFormValues("hd_rbtn"); for (int j = 0; j < Chamber.Length; j++) { EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo roomtype = new EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo(); roomtype.AccountingPrice = Utils.GetDecimal(SettlementPrice[j]); if (radiobtnValue[j] == "1") { roomtype.IsBreakfast = true; } else { roomtype.IsBreakfast = false; } roomtype.Name = Chamber[j]; roomtype.SellingPrice = Utils.GetDecimal(SalaesPrices[j]); Hotelinfo.RoomTypes.Add(roomtype); } #endregion //备注 string HotelRemarks = Utils.GetFormValue("HotelRemarks"); Hotelinfo.UnitName = unionname; Hotelinfo.UnitAddress = TxtHotelAddress; Hotelinfo.Star = (EyouSoft.Model.EnumType.SupplierStructure.HotelStar)Enum.Parse(typeof(EyouSoft.Model.EnumType.SupplierStructure.HotelStar), HotelStart.ToString()); Hotelinfo.Introduce = HotelIntroduction; Hotelinfo.TourGuide = TourGuids; Hotelinfo.Remark = HotelRemarks; Hotelinfo.IssueTime = System.DateTime.Now; int res = 0; if (tid > 0) { //修改酒店信息 res = HotelBll.UpdateHotelInfo(Hotelinfo); } else { //添加酒店信息 res = HotelBll.InsertHotelInfo(Hotelinfo); } if (res > 0) { MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide(); {2}", "保存成功!", Utils.GetQueryStringValue("iframeId"), tid > 0 ? "window.parent.location.reload();" : "window.parent.location.href='/SupplierControl/Hotels/HotelList.aspx';")); } else { MessageBox.ResponseScript(this, ";alert('保存失败!');"); } }
/// <summary> /// 页面加载 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { pageIndex = Utils.GetInt(Utils.GetQueryStringValue("Page"), 1); if (!IsPostBack) { #region ajax获取省份城市 if (Utils.GetQueryStringValue("act") == "getprovince") { Response.Clear(); EyouSoft.BLL.CompanyStructure.Province pBll = new EyouSoft.BLL.CompanyStructure.Province(); IList <EyouSoft.Model.CompanyStructure.Province> listProvince = pBll.GetHasFavCityProvince(SiteUserInfo.CompanyID); Response.Write(JsonConvert.SerializeObject(listProvince)); Response.End(); } if (Utils.GetQueryStringValue("act") == "getcity") { Response.Clear(); EyouSoft.BLL.CompanyStructure.City pBll = new EyouSoft.BLL.CompanyStructure.City(); IList <EyouSoft.Model.CompanyStructure.City> listCity = pBll.GetList(SiteUserInfo.CompanyID, Utils.GetInt(Utils.GetQueryStringValue("provinceId")), true); Response.Write(JsonConvert.SerializeObject(listCity)); Response.End(); } #endregion #region ajax修改状态 by txb 2011.8.4 if (Request.QueryString["act"] == "changeStatus") { EyouSoft.BLL.TourStructure.Tour bll = new Tour(SiteUserInfo); int result = bll.SetTourRouteStatus((TourStructure.TourRouteStatus)Utils.GetInt(Utils.GetFormValue("status")), Utils.GetFormValue("tourid").Split(',')); if (result > 0) { Response.Write("yes"); } else { Response.Write("no"); } Response.End(); } #endregion #region 绑定信息、列表 if (Request.QueryString["act"] == "updatenum") { EyouSoft.BLL.TourStructure.Tour bll = new Tour(); if (bll.SetTourVirtualPeopleNumber(Request["tourid"], Utils.GetInt(Request["num"])) > 0) { Response.Clear(); Response.Write("yes"); } else { Response.Clear(); Response.Write("no"); } Response.End(); return; } if (CheckGrant(TravelPermission.散拼计划_散拼计划_栏目)) { //Utils.ResponseNoPermit(TravelPermission.散拼计划_散拼计划_栏目, false); } else { Utils.ResponseNoPermit(TravelPermission.散拼计划_散拼计划_栏目, false); } selectXianlu1.userId = SiteUserInfo.ID; selectXianlu1.curCompany = CurrentUserCompanyID; selectXianlu1.Url = Request.Url.ToString(); BindList(); #endregion //城市ID状态 cityState = Utils.GetQueryStringValue("CityID"); int cityId = 0; int proId = 0; if (Utils.GetQueryStringValue("provinceId") == "") { //默认为浙江省 proId = 67; //取得浙江省下第一个城市 EyouSoft.BLL.CompanyStructure.City pBll = new EyouSoft.BLL.CompanyStructure.City(); IList <EyouSoft.Model.CompanyStructure.City> listCity = pBll.GetList(SiteUserInfo.CompanyID, proId, true); if (listCity != null && listCity.Count > 0) { cityId = listCity[0].Id; } } else { cityId = Utils.GetInt(Utils.GetQueryStringValue("CityID")); proId = Utils.GetInt(Utils.GetQueryStringValue("provinceId")); } //城市ID CityDataInit(proId, cityId); string act = Utils.GetQueryStringValue("act"); if (act.Length > 0) { switch (act) { case "HandStatus": string hs = Utils.GetQueryStringValue("hs"); if (hs.Length > 0) { switch (hs) { case "mk": HandStatusUp(TourStructure.HandStatus.手动客满); break; case "ts": HandStatusUp(TourStructure.HandStatus.手动停收); break; default: HandStatusUp(TourStructure.HandStatus.无); break; } } break; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!CheckGrant(global::Common.Enum.TravelPermission.系统设置_基础设置_城市管理栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.系统设置_基础设置_城市管理栏目, false); return; } int proId = Utils.GetInt(Utils.GetFormValue(selProvince.UniqueID)); //获取省份Id cityName = Utils.GetFormValue("txtCityName"); //获取城市名 cId = Utils.GetInt(Utils.GetQueryStringValue("cId")); //城市Id string method = Utils.GetFormValue("hidMethod"); //获取当前操作(保存/继续) string showMess = "数据保存成功!"; //提示消息 EyouSoft.Model.CompanyStructure.City cityModel = null; EyouSoft.BLL.CompanyStructure.City cityBll = new EyouSoft.BLL.CompanyStructure.City();//初始化bll //城市Id不为空则添加,否则视为保存 if (method == "") { string isExist = Utils.GetFormValue("isExist");//验证城市是否已经存在 if (isExist == "isExist") { string cityNameE = Utils.GetFormValue("cityName");//获取城市名 int id = Utils.GetInt(Utils.GetFormValue("cityId")); bool isExistResult = cityBll.IsExists(cityNameE, CurrentUserCompanyID, id); Utils.ResponseMeg(isExistResult, ""); return; } #region 初次加载数据 //绑定省份下拉框 IList <EyouSoft.Model.CompanyStructure.Province> proList = new EyouSoft.BLL.CompanyStructure.Province().GetList(CurrentUserCompanyID); if (proList != null && proList.Count > 0) { selProvince.DataTextField = "ProvinceName"; selProvince.DataValueField = "Id"; selProvince.DataSource = proList; selProvince.DataBind(); } selProvince.Items.Insert(0, new ListItem("请选择", "")); if (cId != 0)//初始化城市信息 { cityModel = cityBll.GetModel(cId); if (cityModel != null) { cityName = cityModel.CityName; selProvince.Value = cityModel.ProvinceId.ToString(); } return; } #endregion } else { #region 保存数据 if (cityName == "") { MessageBox.Show(this, "城市名称不为空!"); return; } bool result = false; cityModel = new EyouSoft.Model.CompanyStructure.City(); cityModel.CityName = cityName; cityModel.OperatorId = SiteUserInfo.ID; cityModel.CompanyId = CurrentUserCompanyID; cityModel.ProvinceId = proId; cityModel.IssueTime = DateTime.Now; if (cId != 0) { //修改城市 if (cityModel != null) { cityModel.Id = cId; result = cityBll.Update(cityModel); } } else { //添加城市 result = cityBll.Add(cityModel); } if (!result) { showMess = "数据保存失败!"; } //继续添加则刷新页面,否则关闭当前窗口 if (method == "continue") { MessageBox.ShowAndRedirect(this, showMess, "CityEdit.aspx"); } else { MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.location='/systemset/basicinfo/CityManage.aspx';window.parent.Boxy.getIframeDialog('{1}').hide();", showMess, Utils.GetQueryStringValue("iframeId"))); } #endregion } }
protected void GetLinkMnasAndSubmit() { sight = new EyouSoft.Model.SupplierStructure.SupplierSpot(); if (Request.Files.Count > 0) { string filepath = string.Empty; string oldfilename = string.Empty; IList <EyouSoft.Model.SupplierStructure.SupplierPic> suPics = new List <EyouSoft.Model.SupplierStructure.SupplierPic>(); EyouSoft.Model.SupplierStructure.SupplierPic suPic = new EyouSoft.Model.SupplierStructure.SupplierPic(); //景点图片 if (Request.Files != null && Request.Files.Count > 0) { for (int i = 0; i < Request.Files.Count; i++) { //排除掉合作协议的file控件 if (Request.Files.GetKey(i).ToString() != "file_green") { bool result_landspace = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[i], "SightImg", out filepath, out oldfilename); if (result_landspace) { suPics = DisonseImg_Sight_Add(filepath, oldfilename, suPics); } } } //如果是修改操作,调用下面的方法 if (type == "modify") { suPics = GetImg_Photo(hidImgPhoto.Value, suPics); } if (suPics != null && suPics.Count > 0) { sight.SupplierPic = suPics; } } //合作协议 bool result_AgreementFile = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["file_green"], "SightAgreementFile", out filepath, out oldfilename); if (result_AgreementFile) { if (filepath != "") { sight.AgreementFile = filepath; } else { if (this.greend_hidden.Value != "null") { sight.AgreementFile = this.green_file.Value; } else { sight.AgreementFile = ""; } } } } //获取页面上所有联系人的信息 IList <EyouSoft.Model.CompanyStructure.SupplierContact> contacts = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); string[] linkman_names = Utils.GetFormValues("linkman_name"); string[] linkman_bussiness = Utils.GetFormValues("linkman_bussiness"); string[] linkman_phone = Utils.GetFormValues("linkman_phone"); string[] linkman_tel = Utils.GetFormValues("linkman_tel"); string[] linkman_qq = Utils.GetFormValues("linkman_qq"); string[] linkman_email = Utils.GetFormValues("linkman_email"); string[] linkman_fax = Utils.GetFormValues("linkman_fax"); if (linkman_names.Length >= 1) { for (int i = 0; i < linkman_names.Length; i++) { //创建供应商联系人类 EyouSoft.Model.CompanyStructure.SupplierContact contact = new EyouSoft.Model.CompanyStructure.SupplierContact(); contact.QQ = linkman_qq[i]; contact.Email = linkman_email[i]; contact.ContactName = linkman_names[i]; contact.ContactMobile = linkman_phone[i]; contact.ContactTel = linkman_tel[i]; contact.JobTitle = linkman_bussiness[i]; contact.ContactFax = linkman_fax[i]; contacts.Add(contact); } } sight.CompanyId = SiteUserInfo.CompanyID; //设置景点的省份名字 sight.CityId = Utils.GetInt(this.city_id.Value); sight.ProvinceId = Utils.GetInt(this.pro_id.Value); EyouSoft.Model.CompanyStructure.Province Provincemodel = new EyouSoft.BLL.CompanyStructure.Province().GetModel(this.ucProvince1.ProvinceId); if (Provincemodel != null) { sight.ProvinceName = Provincemodel.ProvinceName; } //设置景点的城市名字 EyouSoft.Model.CompanyStructure.City citymodel = new EyouSoft.BLL.CompanyStructure.City().GetModel(this.ucCity1.CityId); if (citymodel != null) { sight.CityName = citymodel.CityName; } //为要更新的景点赋值 sight.Id = sid; sight.Remark = Utils.GetFormValue("txt_remark"); sight.SupplierContact = contacts; sight.Start = (EyouSoft.Model.EnumType.SupplierStructure.ScenicSpotStar)Utils.GetInt(Utils.GetFormValue(this.sel_star.UniqueID)); sight.TeamPrice = Utils.GetDecimal(Utils.GetFormValue("rl_price")); sight.TourGuide = Utils.GetFormValue("guideworld"); sight.TravelerPrice = Utils.GetDecimal(Utils.GetFormValue("single_price")); sight.UnitAddress = Utils.GetFormValue("companyAddress"); sight.UnitName = Utils.GetFormValue("companyName"); sight.UnitPolicy = Utils.GetFormValue("txt_zc"); sight.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.景点; bool result = false; //操作类型判断 if (type == "add") { //添加 result = sightBll.Add(sight); } else if (type == "modify") { //更新 result = sightBll.Update(sight); } //返回true操作成功,返回false操作失败 if (result == true) { MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.location='/SupplierControl/SightManager/SightList.aspx';window.parent.Boxy.getIframeDialog('{1}').hide()", "保存成功", Utils.GetQueryStringValue("iframeId"))); } else { MessageBox.ResponseScript(this, ";alert('保存失败!');"); } }