/// <summary> /// 解析供应商联系人XML /// </summary> /// <param name="SupplierInsuranceXML">供应商联系人XML</param> /// <returns></returns> private IList <EyouSoft.Model.CompanyStructure.SupplierContact> GetContactInfo(string SupplierInsuranceXML) { IList <EyouSoft.Model.CompanyStructure.SupplierContact> ResultList = null; if (!string.IsNullOrEmpty(SupplierInsuranceXML)) { ResultList = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); XElement root = XElement.Parse(SupplierInsuranceXML); var xRow = root.Elements("row"); foreach (var tmp1 in xRow) { EyouSoft.Model.CompanyStructure.SupplierContact model = new EyouSoft.Model.CompanyStructure.SupplierContact() { CompanyId = int.Parse(tmp1.Attribute("CompanyId").Value), ContactFax = tmp1.Attribute("ContactFax").Value, ContactMobile = tmp1.Attribute("ContactMobile").Value, ContactName = tmp1.Attribute("ContactName").Value, ContactTel = tmp1.Attribute("ContactTel").Value, Email = tmp1.Attribute("Email").Value, JobTitle = tmp1.Attribute("JobTitle").Value, QQ = tmp1.Attribute("QQ").Value, SupplierId = int.Parse(tmp1.Attribute("SupplierId").Value), SupplierType = (EyouSoft.Model.EnumType.CompanyStructure.SupplierType)Enum.Parse(typeof(EyouSoft.Model.EnumType.CompanyStructure.SupplierType), tmp1.Attribute("SupplierType").Value) }; ResultList.Add(model); model = null; } } return(ResultList); }
private void loadXls() { string data = Utils.GetFormValue("dataxls"); string[] s = data.Split(';'); EyouSoft.BLL.SupplierStructure.SupplierHotel hotelbll = new EyouSoft.BLL.SupplierStructure.SupplierHotel(); IList <EyouSoft.Model.SupplierStructure.SupplierHotelInfo> hotelinfo = new List <EyouSoft.Model.SupplierStructure.SupplierHotelInfo>(); for (int i = 0; i < s.Length; i++) { string[] smodel = s[i].Split(','); if (smodel.Length == 18 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2])) { EyouSoft.Model.SupplierStructure.SupplierHotelInfo modelhotel = new EyouSoft.Model.SupplierStructure.SupplierHotelInfo(); modelhotel.ProvinceName = HttpUtility.UrlDecode(smodel[0]); modelhotel.CityName = HttpUtility.UrlDecode(smodel[1]); modelhotel.UnitName = HttpUtility.UrlDecode(smodel[2]); modelhotel.Star = Utils.GetEnumValue <EyouSoft.Model.EnumType.SupplierStructure.HotelStar>(HttpUtility.UrlDecode(smodel[3]), EyouSoft.Model.EnumType.SupplierStructure.HotelStar.挂3); modelhotel.UnitAddress = HttpUtility.UrlDecode(smodel[4]); modelhotel.Introduce = HttpUtility.UrlDecode(smodel[5]); modelhotel.TourGuide = HttpUtility.UrlDecode(smodel[6]); modelhotel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); EyouSoft.Model.CompanyStructure.SupplierContact scmodel = new EyouSoft.Model.CompanyStructure.SupplierContact(); scmodel.ContactName = HttpUtility.UrlDecode(smodel[7]); scmodel.JobTitle = HttpUtility.UrlDecode(smodel[8]); scmodel.ContactTel = HttpUtility.UrlDecode(smodel[9]); scmodel.ContactMobile = HttpUtility.UrlDecode(smodel[10]); scmodel.QQ = HttpUtility.UrlDecode(smodel[11]); scmodel.Email = HttpUtility.UrlDecode(smodel[12]); scmodel.CompanyId = SiteUserInfo.CompanyID; modelhotel.SupplierContact.Add(scmodel); modelhotel.OperatorId = SiteUserInfo.ID; modelhotel.IssueTime = System.DateTime.Now; modelhotel.CompanyId = SiteUserInfo.CompanyID; modelhotel.TradeNum = 0; modelhotel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.酒店; modelhotel.SupplierPic = null; modelhotel.RoomTypes = new List <EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo>(); EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo roomtype = new EyouSoft.Model.SupplierStructure.SupplierHotelRoomTypeInfo(); roomtype.Name = HttpUtility.UrlDecode(smodel[13]); roomtype.SellingPrice = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[14])); roomtype.AccountingPrice = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[15])); roomtype.IsBreakfast = HttpUtility.UrlDecode(smodel[16]) == "是" ? true : false; modelhotel.RoomTypes.Add(roomtype); modelhotel.Remark = HttpUtility.UrlDecode(smodel[17]); hotelinfo.Add(modelhotel); } } int res = 0; res = hotelbll.InsertHotels(hotelinfo); Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", res > 0 ? 1 : -1)); Response.End(); }
private void loadXls() { string data = Utils.GetFormValue("dataxls"); string[] s = data.Split(';'); EyouSoft.BLL.SupplierStructure.SupplierRestaurant srbll = new EyouSoft.BLL.SupplierStructure.SupplierRestaurant(); IList <EyouSoft.Model.SupplierStructure.SupplierRestaurantInfo> srinfo = new List <EyouSoft.Model.SupplierStructure.SupplierRestaurantInfo>(); for (int i = 0; i < s.Length; i++) { string[] smodel = s[i].Split(','); if (smodel.Length == 14 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2])) { EyouSoft.Model.SupplierStructure.SupplierRestaurantInfo srModel = new EyouSoft.Model.SupplierStructure.SupplierRestaurantInfo(); srModel.ProvinceName = HttpUtility.UrlDecode(smodel[0]); srModel.CityName = HttpUtility.UrlDecode(smodel[1]); srModel.UnitName = HttpUtility.UrlDecode(smodel[2]); srModel.Cuisine = HttpUtility.UrlDecode(smodel[3]); srModel.UnitAddress = HttpUtility.UrlDecode(smodel[4]); srModel.Introduce = HttpUtility.UrlDecode(smodel[5]); srModel.TourGuide = HttpUtility.UrlDecode(smodel[6]); srModel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); EyouSoft.Model.CompanyStructure.SupplierContact contect = new EyouSoft.Model.CompanyStructure.SupplierContact(); contect.ContactName = HttpUtility.UrlDecode(smodel[7]); contect.JobTitle = HttpUtility.UrlDecode(smodel[8]); contect.ContactTel = HttpUtility.UrlDecode(smodel[9]); contect.ContactMobile = HttpUtility.UrlDecode(smodel[10]); contect.QQ = HttpUtility.UrlDecode(smodel[11]); contect.Email = HttpUtility.UrlDecode(smodel[12]); contect.CompanyId = SiteUserInfo.CompanyID; srModel.SupplierContact.Add(contect); srModel.Remark = HttpUtility.UrlDecode(smodel[13]); srModel.OperatorId = SiteUserInfo.ID; srModel.IssueTime = DateTime.Now; srModel.CompanyId = CurrentUserCompanyID; srModel.AgreementFile = string.Empty; srModel.IsDelete = false; srModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.餐馆; srModel.TradeNum = 0; srModel.Commission = 0; srinfo.Add(srModel); } } int res = 0; res = srbll.InsertRestaurants(srinfo); Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", res > 0 ? 1 : -1)); Response.End(); }
private void loadXls() { string data = Utils.GetFormValue("dataxls"); string[] s = data.Split(';'); EyouSoft.BLL.SupplierStructure.SupplierShopping ssBLL = new EyouSoft.BLL.SupplierStructure.SupplierShopping(); List <EyouSoft.Model.SupplierStructure.SupplierShopping> list = new List <EyouSoft.Model.SupplierStructure.SupplierShopping>(); for (int i = 0; i < s.Length; i++) { string[] smodel = s[i].Split(','); if (smodel.Length == 13 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2])) { EyouSoft.Model.SupplierStructure.SupplierShopping ssModel = new EyouSoft.Model.SupplierStructure.SupplierShopping(); ssModel.ProvinceName = HttpUtility.UrlDecode(smodel[0]); //省份 ssModel.CityName = HttpUtility.UrlDecode(smodel[1]); //城市 ssModel.UnitName = HttpUtility.UrlDecode(smodel[2]); //单位名称 ssModel.SaleProduct = HttpUtility.UrlDecode(smodel[3]); //销售产品 ssModel.GuideWord = HttpUtility.UrlDecode(smodel[4]); //导游词 ssModel.UnitAddress = HttpUtility.UrlDecode(smodel[5]); //地址 ssModel.OperatorId = SiteUserInfo.ID; //操作人 ssModel.IssueTime = DateTime.Now; //添加时间 ssModel.CompanyId = CurrentUserCompanyID; //公司编号 ssModel.AgreementFile = string.Empty; //协议 ssModel.IsDelete = false; //是否删除 ssModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.购物; //单位类型 ssModel.TradeNum = 0; //交易次数 //联系人 ssModel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); EyouSoft.Model.CompanyStructure.SupplierContact scModel = new EyouSoft.Model.CompanyStructure.SupplierContact(); scModel.ContactName = HttpUtility.UrlDecode(smodel[6]); //姓名 scModel.JobTitle = HttpUtility.UrlDecode(smodel[7]); //职务 scModel.ContactTel = HttpUtility.UrlDecode(smodel[8]); //电话 scModel.ContactMobile = HttpUtility.UrlDecode(smodel[9]); //手机 scModel.QQ = HttpUtility.UrlDecode(smodel[10]); //QQ scModel.Email = HttpUtility.UrlDecode(smodel[11]); //email ssModel.SupplierContact.Add(scModel); ssModel.Remark = HttpUtility.UrlDecode(smodel[12]); list.Add(ssModel); } } bool res = ssBLL.ImportExcelData(list); Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", res ? 1 : -1)); Response.End(); }
//导入方法 private void loadXls() { //取得数据源 string data = Utils.GetFormValue("dataxls"); //分割数据 string[] s = data.Split(';'); EyouSoft.BLL.SupplierStructure.SupplierSpot sightBll = new EyouSoft.BLL.SupplierStructure.SupplierSpot(); IList <EyouSoft.Model.SupplierStructure.SupplierSpot> list = new List <EyouSoft.Model.SupplierStructure.SupplierSpot>(); for (int i = 0; i < s.Length; i++) { string[] smodel = s[i].Split(','); if (smodel.Length == 16 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2])) { EyouSoft.Model.SupplierStructure.SupplierSpot sight = new EyouSoft.Model.SupplierStructure.SupplierSpot(); IList <EyouSoft.Model.CompanyStructure.SupplierContact> contacts = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); EyouSoft.Model.CompanyStructure.SupplierContact contact = new EyouSoft.Model.CompanyStructure.SupplierContact(); sight.ProvinceName = HttpUtility.UrlDecode(smodel[0]); sight.CityName = HttpUtility.UrlDecode(smodel[1]); sight.UnitName = HttpUtility.UrlDecode(smodel[2]); sight.Start = (EyouSoft.Model.EnumType.SupplierStructure.ScenicSpotStar)ChangeStar(HttpUtility.UrlDecode(smodel[3])); sight.UnitAddress = HttpUtility.UrlDecode(smodel[4]); sight.TourGuide = HttpUtility.UrlDecode(smodel[5]); contact.ContactName = HttpUtility.UrlDecode(smodel[6]); contact.JobTitle = HttpUtility.UrlDecode(smodel[7]); contact.ContactTel = HttpUtility.UrlDecode(smodel[8]); contact.ContactMobile = HttpUtility.UrlDecode(smodel[9]); contact.QQ = HttpUtility.UrlDecode(smodel[10]); contact.Email = HttpUtility.UrlDecode(smodel[11]); sight.TravelerPrice = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[12])); sight.TeamPrice = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[13])); sight.UnitPolicy = HttpUtility.UrlDecode(smodel[14]); sight.Remark = HttpUtility.UrlDecode(smodel[15]); sight.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.景点; sight.CompanyId = SiteUserInfo.CompanyID; if (contact.ContactMobile != "" && contact.ContactName != "") { contacts.Add(contact); } sight.SupplierContact = contacts; list.Add(sight); } } bool res = false; res = sightBll.Add(list); Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", res ? 1 : -1)); Response.End(); }
private void loadXls() { string data = Utils.GetFormValue("dataxls"); string[] s = data.Split(';'); EyouSoft.BLL.SupplierStructure.SupplierInsurance insurancebll = new EyouSoft.BLL.SupplierStructure.SupplierInsurance(); IList <EyouSoft.Model.SupplierStructure.SupplierInsurance> insurancemodel = new List <EyouSoft.Model.SupplierStructure.SupplierInsurance>(); for (int i = 0; i < s.Length; i++) { string[] smodel = s[i].Split(','); if (smodel.Length == 11 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2])) { EyouSoft.Model.SupplierStructure.SupplierInsurance slmodel = new EyouSoft.Model.SupplierStructure.SupplierInsurance(); slmodel.ProvinceName = HttpUtility.UrlDecode(smodel[0]); slmodel.CityName = HttpUtility.UrlDecode(smodel[1]); slmodel.UnitName = HttpUtility.UrlDecode(smodel[2]); slmodel.UnitAddress = HttpUtility.UrlDecode(smodel[3]); slmodel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); EyouSoft.Model.CompanyStructure.SupplierContact scmodel = new EyouSoft.Model.CompanyStructure.SupplierContact(); scmodel.ContactName = HttpUtility.UrlDecode(smodel[4]); scmodel.JobTitle = HttpUtility.UrlDecode(smodel[5]); scmodel.ContactTel = HttpUtility.UrlDecode(smodel[6]); scmodel.ContactMobile = HttpUtility.UrlDecode(smodel[7]); scmodel.QQ = HttpUtility.UrlDecode(smodel[8]); scmodel.Email = HttpUtility.UrlDecode(smodel[9]); scmodel.CompanyId = SiteUserInfo.CompanyID; slmodel.SupplierContact.Add(scmodel); slmodel.Remark = HttpUtility.UrlDecode(smodel[10]); slmodel.OperatorId = SiteUserInfo.ID; slmodel.IssueTime = DateTime.Now; slmodel.CompanyId = CurrentUserCompanyID; slmodel.AgreementFile = string.Empty; slmodel.IsDelete = false; slmodel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.保险; slmodel.TradeNum = 0; insurancemodel.Add(slmodel); } } int res = 0; res = insurancebll.AddList(insurancemodel); Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", res > 0 ? 1 : -1)); Response.End(); }
/// <summary> /// 转XML格式 /// </summary> /// <param name="ContactXML"></param> /// <returns></returns> private IList <EyouSoft.Model.CompanyStructure.SupplierContact> GetContactList(string ContactXML) { if (string.IsNullOrEmpty(ContactXML)) { return(null); } IList <EyouSoft.Model.CompanyStructure.SupplierContact> ResultList = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); XElement root = XElement.Parse(ContactXML); var xRow = root.Elements("row"); foreach (var tmp in xRow) { EyouSoft.Model.CompanyStructure.SupplierContact model = new EyouSoft.Model.CompanyStructure.SupplierContact() { ContactName = tmp.Attribute("ContactName").Value, ContactTel = tmp.Attribute("ContactTel").Value, ContactFax = tmp.Attribute("ContactFax") == null ? "" : tmp.Attribute("ContactFax").Value }; ResultList.Add(model); model = null; } return(ResultList); }
/// <summary> /// 获取供应商购物实体 /// </summary> /// <param name="id">ID</param> /// <returns></returns> public EyouSoft.Model.SupplierStructure.SupplierShopping GetModel(int id) { EyouSoft.Model.SupplierStructure.SupplierShopping model = null; DbCommand cmd = this._db.GetStoredProcCommand("proc_Supplier_GetShopping"); this._db.AddInParameter(cmd, "Id", DbType.Int32, id); using (IDataReader rdr = EyouSoft.Toolkit.DAL.DbHelper.ExecuteReader(cmd, this._db)) { if (rdr.Read()) { #region 供应商-购物信息 model = new EyouSoft.Model.SupplierStructure.SupplierShopping(); model.Id = rdr.GetInt32(rdr.GetOrdinal("Id")); model.ProvinceId = rdr.GetInt32(rdr.GetOrdinal("ProvinceId")); model.ProvinceName = rdr.IsDBNull(rdr.GetOrdinal("ProvinceName")) ? "" : rdr.GetString(rdr.GetOrdinal("ProvinceName")); model.CityId = rdr.GetInt32(rdr.GetOrdinal("CityId")); model.CityName = rdr.IsDBNull(rdr.GetOrdinal("CityName")) ? "" : rdr.GetString(rdr.GetOrdinal("GuideWord")); model.UnitName = rdr.GetString(rdr.GetOrdinal("UnitName")); model.SupplierType = (EyouSoft.Model.EnumType.CompanyStructure.SupplierType)Enum.Parse(typeof(EyouSoft.Model.EnumType.CompanyStructure.SupplierType), rdr.GetByte(rdr.GetOrdinal("SupplierType")).ToString()); model.UnitAddress = rdr.IsDBNull(rdr.GetOrdinal("UnitAddress")) ? "" : rdr.GetString(rdr.GetOrdinal("UnitAddress")); //model.c = rdr.GetInt32(rdr.GetOrdinal("Commission")); model.AgreementFile = rdr.IsDBNull(rdr.GetOrdinal("AgreementFile")) ? "" : rdr.GetString(rdr.GetOrdinal("AgreementFile")); model.TradeNum = rdr.GetInt32(rdr.GetOrdinal("TradeNum")); model.Remark = rdr.IsDBNull(rdr.GetOrdinal("Remark")) ? "" : rdr.GetString(rdr.GetOrdinal("Remark")); model.CompanyId = rdr.GetInt32(rdr.GetOrdinal("CompanyId")); model.OperatorId = rdr.GetInt32(rdr.GetOrdinal("OperatorId")); model.IssueTime = rdr.GetDateTime(rdr.GetOrdinal("IssueTime")); model.IsDelete = Convert.ToBoolean(rdr.GetOrdinal("IsDelete")); model.SaleProduct = rdr.IsDBNull(rdr.GetOrdinal("SaleProduct")) ? "" : rdr.GetString(rdr.GetOrdinal("SaleProduct")); model.GuideWord = rdr.IsDBNull(rdr.GetOrdinal("GuideWord")) ? "" : rdr.GetString(rdr.GetOrdinal("GuideWord")); #endregion #region 供应商联系人信息 rdr.NextResult(); IList <EyouSoft.Model.CompanyStructure.SupplierContact> ls = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); while (rdr.Read()) { EyouSoft.Model.CompanyStructure.SupplierContact contactModel = new EyouSoft.Model.CompanyStructure.SupplierContact(); contactModel.Id = rdr.GetInt32(rdr.GetOrdinal("Id")); contactModel.CompanyId = rdr.GetInt32(rdr.GetOrdinal("CompanyId")); contactModel.SupplierId = rdr.GetInt32(rdr.GetOrdinal("SupplierId")); contactModel.SupplierType = (EyouSoft.Model.EnumType.CompanyStructure.SupplierType)Enum.Parse(typeof(EyouSoft.Model.EnumType.CompanyStructure.SupplierType), rdr.GetByte(rdr.GetOrdinal("SupplierType")).ToString()); contactModel.ContactName = rdr.IsDBNull(rdr.GetOrdinal("ContactName")) ? "" : rdr.GetString(rdr.GetOrdinal("ContactName")); contactModel.JobTitle = rdr.IsDBNull(rdr.GetOrdinal("JobTitle")) ? "" : rdr.GetString(rdr.GetOrdinal("JobTitle")); contactModel.ContactFax = rdr.IsDBNull(rdr.GetOrdinal("ContactFax")) ? "" : rdr.GetString(rdr.GetOrdinal("ContactFax")); contactModel.ContactTel = rdr.IsDBNull(rdr.GetOrdinal("ContactTel")) ? "" : rdr.GetString(rdr.GetOrdinal("ContactTel")); contactModel.ContactMobile = rdr.IsDBNull(rdr.GetOrdinal("ContactMobile")) ? "" : rdr.GetString(rdr.GetOrdinal("ContactMobile")); contactModel.QQ = rdr.IsDBNull(rdr.GetOrdinal("QQ")) ? "" : rdr.GetString(rdr.GetOrdinal("QQ")); contactModel.Email = rdr.IsDBNull(rdr.GetOrdinal("Email")) ? "" : rdr.GetString(rdr.GetOrdinal("Email")); ls.Add(contactModel); contactModel = null; } #endregion model.SupplierContact = ls; } } return(model); }
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('保存失败!');"); } }
/// <summary> /// 保存或修改信息 /// </summary> private void Save() { tid = Utils.GetInt(Utils.GetFormValue("tid")); //获取表操作值 if (tid > 0) //判断添加或修改 { csModel = ssBLl.GetModel(tid, CurrentUserCompanyID); //更具表单ID于公司ID获取供应商数据 } else { csModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.其他;// } if (string.IsNullOrEmpty(csModel.AgreementFile)) { string[] allowExtensions = new string[] { ".jpeg", ".jpg", ".bmp", ".gif", ".pdf", ".xls", ".xlsx", ".doc", ".docx", ".png", ".txt", ".rar" }; string msg = string.Empty; bool nameForm = EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "workAgree", allowExtensions, null, out msg); if (!nameForm) { lstMsg.Text = msg; return; } } csModel.ProvinceId = this.ucProvince1.ProvinceId; csModel.ProvinceName = Utils.GetFormValue("proname"); //省份 csModel.CityName = Utils.GetFormValue("cityname"); //城市 csModel.CityId = this.ucCity1.CityId; csModel.UnitName = Utils.GetFormValue("unionname"); //公司名称 csModel.UnitAddress = Utils.GetFormValue("txtAddress"); //公司地址 csModel.CompanyId = this.SiteUserInfo.CompanyID; csModel.OperatorId = this.SiteUserInfo.ID; csModel.Remark = Utils.GetFormValue("remark"); if (Request.Files.Count > 0)//协议上传 { string filepath = string.Empty; string oldfilename = string.Empty; bool result = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename); if (result) { csModel.AgreementFile = filepath;//协议名 } } csModel.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[] accmanfax = Utils.GetFormValues("infax"); string[] accmanqq = Utils.GetFormValues("inqq"); string[] accmanemail = Utils.GetFormValues("inemail"); 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 = accmanfax[i]; scModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.其他; csModel.SupplierContact.Add(scModel); } bool res = false; if (tid > 0) { res = ssBLl.UpdateSupplierInfo(csModel); } else { res = ssBLl.AddSupplierInfo(csModel); } 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/Others/Default.aspx';")); } 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('保存失败!');"); } }
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('保存失败!');"); } }
/// <summary> /// 导入 /// </summary> private void loadXls() { string data = Utils.GetFormValue("dataxls"); string[] s = data.Split(';'); EyouSoft.BLL.SupplierStructure.SupplierOther ssBLL = new EyouSoft.BLL.SupplierStructure.SupplierOther(); List <EyouSoft.Model.SupplierStructure.SupplierOther> list = new List <EyouSoft.Model.SupplierStructure.SupplierOther>(); for (int i = 0; i < s.Length; i++) { string[] smodel = s[i].Split(','); //判断输出要求 if (smodel.Length == 11 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2])) { //实例化Model EyouSoft.Model.SupplierStructure.SupplierOther ssModel = new EyouSoft.Model.SupplierStructure.SupplierOther(); //省份名称 ssModel.ProvinceName = HttpUtility.UrlDecode(smodel[0]); //城市名称 ssModel.CityName = HttpUtility.UrlDecode(smodel[1]); //单位名称 ssModel.UnitName = HttpUtility.UrlDecode(smodel[2]); //地址 ssModel.UnitAddress = HttpUtility.UrlDecode(smodel[3]); //操作人 ssModel.OperatorId = SiteUserInfo.ID; //添加时间 ssModel.IssueTime = DateTime.Now; //公司编号 ssModel.CompanyId = CurrentUserCompanyID; //合作协议 ssModel.AgreementFile = string.Empty; //是否删除 ssModel.IsDelete = false; //单位类型 ssModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.航空公司; //交易次数 ssModel.TradeNum = 0; //实例化供应商联系人列表 ssModel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); //实例化供应商Model EyouSoft.Model.CompanyStructure.SupplierContact scModel = new EyouSoft.Model.CompanyStructure.SupplierContact(); //联系人姓名 scModel.ContactName = HttpUtility.UrlDecode(smodel[4]); //联系人职务 scModel.JobTitle = HttpUtility.UrlDecode(smodel[5]); //联系人电话 scModel.ContactTel = HttpUtility.UrlDecode(smodel[6]); //联系人手机 scModel.ContactMobile = HttpUtility.UrlDecode(smodel[7]); //联系人QQ scModel.QQ = HttpUtility.UrlDecode(smodel[8]); //联系人邮箱 scModel.Email = HttpUtility.UrlDecode(smodel[9]);//email //联系人列表赋值 ssModel.SupplierContact.Add(scModel); //备注 ssModel.Remark = HttpUtility.UrlDecode(smodel[10]); //赋值list list.Add(ssModel); } } //导入并判断 bool res = ssBLL.ImportExcelData(list); //输出导入结果 Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", res ? 1 : -1)); Response.End(); }
private void loadXls() { //取得数据源 string data = Utils.GetFormValue("dataxls"); //对数据源分割处理 string[] s = data.Split(';'); EyouSoft.BLL.SupplierStructure.SupplierCarTeam carTeamBll = new EyouSoft.BLL.SupplierStructure.SupplierCarTeam(); IList <EyouSoft.Model.SupplierStructure.SupplierCarTeam> list = new List <EyouSoft.Model.SupplierStructure.SupplierCarTeam>(); //为list集合赋值 for (int i = 0; i < s.Length; i++) { string[] smodel = s[i].Split(','); if (smodel.Length == 17 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2])) { EyouSoft.Model.SupplierStructure.SupplierCarTeam carteamInfo = new EyouSoft.Model.SupplierStructure.SupplierCarTeam(); EyouSoft.Model.CompanyStructure.SupplierContact contact = new EyouSoft.Model.CompanyStructure.SupplierContact(); EyouSoft.Model.SupplierStructure.SupplierCarInfo carInfo = new EyouSoft.Model.SupplierStructure.SupplierCarInfo(); IList <EyouSoft.Model.SupplierStructure.SupplierCarInfo> carInfos = new List <EyouSoft.Model.SupplierStructure.SupplierCarInfo>(); IList <EyouSoft.Model.CompanyStructure.SupplierContact> contacts = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); carteamInfo.ProvinceName = HttpUtility.UrlDecode(smodel[0]); carteamInfo.CityName = HttpUtility.UrlDecode(smodel[1]); carteamInfo.UnitName = HttpUtility.UrlDecode(smodel[2]); carteamInfo.UnitAddress = HttpUtility.UrlDecode(smodel[3]); carInfo.GuideWord = HttpUtility.UrlDecode(smodel[4]); contact.ContactName = HttpUtility.UrlDecode(smodel[5]); contact.JobTitle = HttpUtility.UrlDecode(smodel[6]); contact.ContactTel = HttpUtility.UrlDecode(smodel[7]); contact.ContactMobile = HttpUtility.UrlDecode(smodel[8]); contact.QQ = HttpUtility.UrlDecode(smodel[9]); contact.Email = HttpUtility.UrlDecode(smodel[10]); carInfo.CarType = HttpUtility.UrlDecode(smodel[11]); carInfo.CarNumber = HttpUtility.UrlDecode(smodel[12]); carInfo.Price = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[13])); carInfo.DriverName = HttpUtility.UrlDecode(smodel[14]); carInfo.DriverPhone = HttpUtility.UrlDecode(smodel[15]); carteamInfo.Remark = HttpUtility.UrlDecode(smodel[16]); carteamInfo.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.车队; carteamInfo.TradeNum = 0; carteamInfo.CompanyId = SiteUserInfo.CompanyID; carInfos.Add(carInfo); contacts.Add(contact); carteamInfo.CarsInfo = carInfos; carteamInfo.SupplierContact = contacts; list.Add(carteamInfo); } } int res = 0; //导入从excel获得数据 res = carTeamBll.InsertCarTeams(list); bool result = false; if (res > 0) { result = true; } Response.Clear(); Response.Write(string.Format("{{\"res\":{0}}}", result ? 1 : -1)); Response.End(); }
/// <summary> /// 保存或修改信息 /// </summary> private void Save() { tid = Utils.GetInt(Utils.GetFormValue("tid")); if (tid > 0) { csModel = csBll.GetModel(tid, this.CurrentUserCompanyID); } else { csModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.地接; } //省份编号 csModel.ProvinceId = this.ucProvince1.ProvinceId; //身份名称 csModel.ProvinceName = Utils.GetFormValue("proname"); //城市名称 csModel.CityName = Utils.GetFormValue("cityname"); //城市编号 csModel.CityId = this.ucCity1.CityId; //单位名称 csModel.UnitName = Utils.GetFormValue("unionname"); if (csModel.UnitName.Length == 1) { csModel.UnitName += " "; } //地址 csModel.UnitAddress = Utils.GetFormValue("txtAddress"); //合作协议 if (Request.Files.Count > 0) { string filepath = string.Empty; string oldfilename = string.Empty; bool result = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename); if (result) { csModel.AgreementFile = filepath; } } //许可证号 csModel.LicenseKey = Utils.GetFormValue("txtLicense"); //返佣 csModel.Commission = Utils.GetDecimal(Utils.GetFormValue("txtReturnSet")); //备注 csModel.Remark = Utils.GetFormValue("remark"); //公司编号 csModel.CompanyId = this.SiteUserInfo.CompanyID; //操作人 csModel.OperatorId = this.SiteUserInfo.ID; //供应商联系人 csModel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>(); string[] accmanId = Utils.GetFormValues("hidcontactid");//联系人ID string[] accmanname = Utils.GetFormValues("inname"); string[] accmandate = Utils.GetFormValues("indate"); string[] accmanphone = Utils.GetFormValues("inphone"); string[] accmanmobile = Utils.GetFormValues("inmobile"); string[] accmanfax = Utils.GetFormValues("infax"); string[] accmanqq = Utils.GetFormValues("inqq"); string[] accmanUserName = Utils.GetFormValues("inusername"); //用户名 string[] accmanPwd = Utils.GetFormValues("inpwd"); //密码 string[] accmanUserId = Utils.GetFormValues("inusernameid"); //用户ID 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.ContactFax = accmanfax[i]; scModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.地接; scModel.Id = Utils.GetInt(accmanId[i]); //联系人ID //判断对应联系人的用户名是否为空 if (!string.IsNullOrEmpty(accmanUserName[i])) //不为空 { scModel.UserAccount = new EyouSoft.Model.CompanyStructure.UserAccount() { ID = Utils.GetInt(accmanUserId[i]), UserName = accmanUserName[i], PassWordInfo = new EyouSoft.Model.CompanyStructure.PassWord() { NoEncryptPassword = accmanPwd[i] }, TourCompanyId = tid }; } else//为空 { //将当前联系人的用户信息初始化为空 scModel.UserAccount = null; } csModel.SupplierContact.Add(scModel); } //判断用户信息中 是否存在用户名已被使用 bool isUserNameExist = false; System.Text.StringBuilder strbUserName = new System.Text.StringBuilder(); EyouSoft.BLL.CompanyStructure.CompanyUser userBll = new EyouSoft.BLL.CompanyStructure.CompanyUser(SiteUserInfo); foreach (EyouSoft.Model.CompanyStructure.SupplierContact scModel in csModel.SupplierContact) { //判断当前用户信息 ,是否是 新增的用户信息 if (scModel.UserAccount != null && scModel.UserAccount.ID == 0)//是 { //判断用户名 是否已经存在 if (userBll.IsExists(0, scModel.UserAccount.UserName, CurrentUserCompanyID) == true)//是 { //修改状态 isUserNameExist = true; //添加重复的用户名到strbUsername strbUserName.Append(scModel.UserAccount.UserName).Append(","); } } } //去除strbUserName中最后一个多余的【,】逗号 if (strbUserName.Length > 0) { strbUserName.Remove(strbUserName.Length - 1, 1); } bool res = false; if (tid > 0) { res = csBll.UpdateSupplierInfo(csModel); } else { res = csBll.AddSupplierInfo(csModel); } string msg = ""; //提示信息 if (isUserNameExist == true) //如果存在用户名重复 { msg = "地接信息保存成功,新增的用户名中,(" + strbUserName.ToString() + ")已被使用,请更换其他用户名"; } else { msg = "地接信息保存成功"; } if (res) { MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide();{2}", msg, Utils.GetQueryStringValue("iframeId"), tid > 0 ? "window.parent.location.reload();" : "window.parent.location.href='/SupplierControl/AreaConnect/AreaConnect.aspx';")); } else { MessageBox.ResponseScript(this, ";alert('保存失败!');"); } }
/// <summary> /// 保存或修改信息 /// </summary> private void Save() { tid = Utils.GetInt(Utils.GetFormValue("tid")); if (tid > 0) { csModel = csBll.GetModel(tid, this.CurrentUserCompanyID); } else { csModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.票务; } csModel.ProvinceId = this.ucProvince1.ProvinceId; csModel.ProvinceName = Utils.GetFormValue("proname"); csModel.CityName = Utils.GetFormValue("cityname"); csModel.CityId = this.ucCity1.CityId; csModel.UnitName = Utils.GetFormValue("unionname"); csModel.UnitAddress = Utils.GetFormValue("txtAddress"); if (Request.Files.Count > 0) { string filepath = string.Empty; string oldfilename = string.Empty; bool result = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename); if (result) { csModel.AgreementFile = filepath; } } csModel.UnitPolicy = Utils.GetFormValue("police"); csModel.Remark = Utils.GetFormValue("remark"); csModel.CompanyId = this.SiteUserInfo.CompanyID; csModel.OperatorId = this.SiteUserInfo.ID; csModel.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[] accmanfax = Utils.GetFormValues("infax"); string[] accmanqq = Utils.GetFormValues("inqq"); string[] accmanemail = Utils.GetFormValues("inemail"); 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 = accmanfax[i]; scModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.票务; csModel.SupplierContact.Add(scModel); } bool res = false; if (tid > 0) { res = csBll.UpdateSupplierInfo(csModel); } else { res = csBll.AddSupplierInfo(csModel); } 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/TicketService/TicketService.aspx';")); } else { MessageBox.ResponseScript(this, ";alert('保存失败!');"); } }