private void bind(int tid) { //初始化条件 pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1); EyouSoft.BLL.SupplierStructure.SupplierShopping ssBLL = new EyouSoft.BLL.SupplierStructure.SupplierShopping(); //IList<EyouSoft.Model.SupplierStructure.SupplierShopping> list = ssBLL.GetModel(tid); }
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(); }
protected void Page_Load(object sender, EventArgs e) { csBll = new EyouSoft.BLL.SupplierStructure.SupplierShopping(); ssModel = new EyouSoft.Model.SupplierStructure.SupplierShopping(); if (!CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_购物_栏目, false); return; } ucProvince1.CompanyId = CurrentUserCompanyID; ucProvince1.IsFav = true; ucCity1.CompanyId = CurrentUserCompanyID; ucCity1.IsFav = true; if (Page.IsPostBack) { Save(); } else { type = Utils.GetQueryStringValue("type"); switch (type) { case "modify": if (CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_修改)) { bind(); } else { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_购物_修改, false); } break; case "show": show = true; bind(); break; default: if (!CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_新增)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_购物_新增, false); } break; } bindProandCity(); } }
protected bool grantto = false; //导出 #endregion protected void Page_Load(object sender, EventArgs e) { if (!CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_栏目)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_购物_栏目, false); } string act = string.Empty;//操作 //权限赋值 grantadd = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_新增); grantmodify = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_修改); grantdel = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_删除); grantload = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_导入); grantto = CheckGrant(global::Common.Enum.TravelPermission.供应商管理_购物_导出); ucProvince1.CompanyId = CurrentUserCompanyID; ucProvince1.IsFav = true; ucCity1.CompanyId = CurrentUserCompanyID; ucCity1.IsFav = true; csBLL = new EyouSoft.BLL.SupplierStructure.SupplierShopping(); act = EyouSoft.Common.Utils.GetQueryStringValue("act");//获取操作类型 if (!IsPostBack) { switch (act) { case "toexcel": if (grantto) { CreateExcel("area" + DateTime.Now.ToShortDateString()); //导出 } break; case "areadel": if (grantdel) { AreaDel(); //删除 } break; default: DataInit(); break; } } }