/// <summary> /// 将查询数据集转化为实体集合 /// </summary> /// <param name="dc">查询命令</param> /// <returns>实体集合</returns> private IList <Model.SystemStructure.SysAreaContact> GetQueryList(DbCommand dc) { IList <EyouSoft.Model.SystemStructure.SysAreaContact> list = new List <EyouSoft.Model.SystemStructure.SysAreaContact>(); using (IDataReader dr = DbHelper.ExecuteReader(dc, base.SystemStore)) { EyouSoft.Model.SystemStructure.SysAreaContact model = null; while (dr.Read()) { model = new EyouSoft.Model.SystemStructure.SysAreaContact(); if (!dr.IsDBNull(0)) { model.ID = dr.GetInt32(0); } model.SaleArea = dr[1].ToString(); if (!dr.IsDBNull(2)) { model.SaleType = dr.GetByte(2); } model.ContactName = dr[3].ToString(); model.ContactTel = dr[4].ToString(); model.ContactMobile = dr[5].ToString(); model.QQ = dr[6].ToString(); model.MQ = dr[7].ToString(); list.Add(model); } model = null; } return(list); }
protected void btnAdd_Click(object sender, EventArgs e) { if (EditeFlag) { string strErr = ""; #region 获取联盟表单信息 string siteOpeName = Utils.GetFormValue("txt_SiteOpeName", 250); //验证平台名称不为空 if (siteOpeName == "") { strErr += "平台名称不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string ContentName = Utils.GetFormValue("txt_ContentName", 50); string ContentPhoneNum = Utils.GetFormValue("txt_ContentPhoneNum", 50); string ContentTelNum = Utils.GetFormValue("txt_ContentTelNum", 50); string CMQ = Utils.GetFormValue("txt_CMQ", 30); string CQQ = Utils.GetFormValue("txt_CQQ", 30); string CMSN = Utils.GetFormValue("txt_CMSN", 40); string UnionInfo = Server.HtmlDecode(Request.Form["txt_UnionInfo"]); string IndexInfo = Server.HtmlDecode(Request.Form["txt_IndexInfo"]); #endregion #region 获取区域联系人表单信息 //区域联系人信息 string[] txt_AreaList = Utils.GetFormValues("txt_Area"); string[] sel_ContentTypeList = Utils.GetFormValues("sel_ContentType"); string[] txt_ContentPeopleList = Utils.GetFormValues("txt_ContentPeople"); string[] txt_ContentPhoneList = Utils.GetFormValues("txt_ContentPhone"); string[] txt_ContentTelList = Utils.GetFormValues("txt_ContentTel"); string[] txt_ContentQQList = Utils.GetFormValues("txt_ContentQQ"); string[] txt_ContentMQList = Utils.GetFormValues("txt_ContentMQ"); #region 保存区域联系人信息 IList <EyouSoft.Model.SystemStructure.SysAreaContact> areaList = new List <EyouSoft.Model.SystemStructure.SysAreaContact>(); if (txt_AreaList != null) { EyouSoft.Model.SystemStructure.SysAreaContact areaModel = null; for (int index = 0; index < txt_AreaList.Length; index++) { if (!string.IsNullOrEmpty(txt_AreaList[index].Trim()) || !string.IsNullOrEmpty(txt_ContentPeopleList[index].Trim()) || !string.IsNullOrEmpty(txt_ContentPhoneList[index].Trim()) || !string.IsNullOrEmpty(txt_ContentTelList[index].Trim()) || !string.IsNullOrEmpty(txt_ContentQQList[index].Trim()) || !string.IsNullOrEmpty(txt_ContentMQList[index].Trim())) { areaModel = new EyouSoft.Model.SystemStructure.SysAreaContact(); areaModel.ContactMobile = txt_ContentTelList[index]; areaModel.ContactName = txt_ContentPeopleList[index]; areaModel.ContactTel = txt_ContentPhoneList[index]; areaModel.MQ = txt_ContentMQList[index]; areaModel.QQ = txt_ContentQQList[index]; areaModel.SaleArea = txt_AreaList[index]; areaModel.SaleType = int.Parse(sel_ContentTypeList[index]); areaList.Add(areaModel); //释放资源 areaModel = null; } } } #endregion #endregion #region 保存联盟基本信息 EyouSoft.Model.SystemStructure.SystemInfo sysModel = new EyouSoft.Model.SystemStructure.SystemInfo(); sysModel.ID = EditeID; sysModel.SystemName = siteOpeName; sysModel.ContactName = ContentName; sysModel.ContactTel = ContentTelNum; sysModel.ContactMobile = ContentPhoneNum; sysModel.QQ1 = CQQ; sysModel.Msn = CMSN; sysModel.SystemRemark = UnionInfo; sysModel.AllRight = IndexInfo; sysModel.SysAreaContact = areaList; sysModel.MQ = CMQ; if (!string.IsNullOrEmpty(Utils.GetFormValue("SingleFileUpload1$hidFileName"))) { sysModel.UnionLog = Utils.GetFormValue("SingleFileUpload1$hidFileName"); } else { sysModel.UnionLog = Utils.GetFormValue(hdfAgoImgPath.UniqueID); } int retInt = EyouSoft.BLL.SystemStructure.SystemInfo.CreateInstance().UpdateSystemInfo(sysModel); if (retInt > 0) { MessageBox.ShowAndRedirect(this, "修改成功", "BasicInfoManagement.aspx"); } //释放资源 areaList = null; sysModel = null; #endregion } else { Utils.ResponseNoPermit(YuYingPermission.平台管理_基本信息, true); return; } }
/// <summary> /// 获取系统信息(同时获取所有的区域联系人) /// </summary> /// <returns>返回系统信息实体</returns> public virtual EyouSoft.Model.SystemStructure.SystemInfo GetSystemInfoModel() { Model.SystemStructure.SystemInfo model = new EyouSoft.Model.SystemStructure.SystemInfo(); string strWhere = " SELECT [Id],[SaleArea],[SaleType],[ContactName],[ContactTel],[ContactMobile],[QQ],[MQ] FROM [tbl_SysAreaContact]; "; strWhere += Sql_SystemInfo_Select + " ; "; DbCommand dc = base.SystemStore.GetSqlStringCommand(strWhere); #region 实体赋值 List <Model.SystemStructure.SysAreaContact> AllAreaContact = new List <Model.SystemStructure.SysAreaContact>(); using (IDataReader dr = DbHelper.ExecuteReader(dc, base.SystemStore)) { Model.SystemStructure.SysAreaContact AreaContactModel = null; while (dr.Read()) { AreaContactModel = new EyouSoft.Model.SystemStructure.SysAreaContact(); if (!dr.IsDBNull(0)) { AreaContactModel.ID = dr.GetInt32(0); } AreaContactModel.SaleArea = dr[1].ToString(); if (!dr.IsDBNull(2)) { AreaContactModel.SaleType = dr.GetByte(2); } AreaContactModel.ContactName = dr[3].ToString(); AreaContactModel.ContactTel = dr[4].ToString(); AreaContactModel.ContactMobile = dr[5].ToString(); AreaContactModel.QQ = dr[6].ToString(); AreaContactModel.MQ = dr[7].ToString(); AllAreaContact.Add(AreaContactModel); } AreaContactModel = null; dr.NextResult(); while (dr.Read()) { if (!dr.IsDBNull(0)) { model.ID = dr.GetInt32(0); } model.SystemName = dr[1].ToString(); model.ContactName = dr[2].ToString(); model.ContactTel = dr[3].ToString(); model.ContactMobile = dr[4].ToString(); model.QQ1 = dr[5].ToString(); model.QQ2 = dr[6].ToString(); model.QQ3 = dr[7].ToString(); model.QQ4 = dr[8].ToString(); model.QQ5 = dr[9].ToString(); model.Msn = dr[10].ToString(); model.MQ = dr[11].ToString(); model.SystemRemark = dr[12].ToString(); model.AgencyLog = dr[13].ToString(); model.UnionLog = dr[14].ToString(); model.AllRight = dr[15].ToString(); model.SysAreaContact = AllAreaContact; break; } AllAreaContact.Clear(); AllAreaContact = null; } #endregion return(model); }