Esempio n. 1
0
        //批量设置序号
        protected void btnSave_Click(object sender, EventArgs e)
        {
            IList <EyouSoft.Model.MQStructure.IMSuperCluster> list = new List <EyouSoft.Model.MQStructure.IMSuperCluster>();

            EyouSoft.Model.MQStructure.IMSuperCluster model = null;
            for (int i = 0; i < Utils.GetFormValues("chkId").Length; i++)
            {
                for (int j = 0; j < Utils.GetFormValues("sort").Length; j++)
                {
                    if (Utils.GetInt(Utils.GetFormValues("chkId")[i]) == Utils.GetInt(Utils.GetFormValues("hidid")[j]))
                    {
                        model = new EyouSoft.Model.MQStructure.IMSuperCluster()
                        {
                            Num = Utils.GetInt(Utils.GetFormValues("sort")[j]),
                            Id  = Utils.GetInt(Utils.GetFormValues("chkId")[i])
                        };
                        list.Add(model);
                        break;
                    }
                }
            }
            if (list.Count > 0)
            {
                EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().SetNums(list);
            }
            Bind();
        }
Esempio n. 2
0
        /// <summary>
        /// 获取所有的同业中心
        /// </summary>
        /// <returns>同业中心列表</returns>
        public IList <EyouSoft.Model.MQStructure.IMSuperCluster> GetAllClusters()
        {
            var lst    = new List <EyouSoft.Model.MQStructure.IMSuperCluster>();                        // 同业中心实体
            var strSql = new StringBuilder();                                                           // SQL编辑器

            strSql.Append(" SELECT");
            strSql.Append("     id");
            strSql.Append("     ,title");
            strSql.Append(" FROM");
            strSql.Append("     tbl_SuperCluster");

            DbCommand cmd = this._database.GetSqlStringCommand(strSql.ToString());                      // SQL执行

            using (IDataReader dr = DbHelper.ExecuteReader(cmd, this._database))
            {
                while (dr.Read())
                {
                    // 同业中心实体
                    var model = new EyouSoft.Model.MQStructure.IMSuperCluster()
                    {
                        // 超级群ID
                        Id = dr.GetInt32(dr.GetOrdinal("id")),

                        // 超级群名称
                        Title = dr.IsDBNull(dr.GetOrdinal("title")) ? string.Empty : dr.GetString(dr.GetOrdinal("title"))
                    };

                    // 追加到实体列表
                    lst.Add(model);
                }
            }

            // 返回同业中心实体列表
            return(lst);
        }
Esempio n. 3
0
        /// <summary>
        /// 更新同业中心
        /// </summary>
        /// <param name="model">同业中心实体</param>
        /// <returns>True:成功 False:失败</returns>
        public bool Upd(EyouSoft.Model.MQStructure.IMSuperCluster model)
        {
            DbCommand dc = null;                                                                                             // 命令基类

            dc = this._database.GetStoredProcCommand("proc_SuperCluster_UpdCluster");                                        // 执行存储过程

            this._database.AddInParameter(dc, "@ID", DbType.Int32, model.Id);                                                // 超级群ID
            this._database.AddInParameter(dc, "@Title", DbType.String, model.Title);                                         // 名称
            this._database.AddInParameter(dc, "@Master", DbType.Int32, model.Master);                                        // 总管理员
            this._database.AddInParameter(dc, "@SelectType", DbType.Int32, model.SelectType);                                // 成员构成导入类型【1:选择省市 2:选择会员ID】
            this._database.AddInParameter(dc, "@SelectValue", DbType.String, model.SelectValue.TrimEnd(',').TrimStart(',')); // 用【,】隔开导入省份或者会员ID数据
            this._database.AddInParameter(dc, "@Num", DbType.Int32, model.Num);                                              // 序号
            this._database.AddInParameter(dc, "@PassWord", DbType.String, model.PassWord);                                   // 密码
            this._database.AddInParameter(dc, "@Opertor", DbType.String, model.Opertor);                                     // 操作人
            this._database.AddInParameter(dc, "@OperateTime", DbType.DateTime, model.OperateTime);                           // 操作时间

            try
            {
                return(DbHelper.ExecuteSql(dc, this._database) > 0 ? true : false);
            }
            catch (Exception de)
            {
                throw de;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 根据同业中心ID获取同业中心实体
        /// </summary>
        /// <param name="id">同业中心ID</param>
        /// <returns>同业中心实体</returns>
        public EyouSoft.Model.MQStructure.IMSuperCluster GetSuperClusterByID(int id)
        {
            var model  = new EyouSoft.Model.MQStructure.IMSuperCluster();                               // 同业中心实体
            var strSql = new StringBuilder();                                                           // SQL编辑器

            strSql.Append(" SELECT");
            strSql.Append("     title");                                                                // 名称
            strSql.Append("     ,master");                                                              // 总管理员
            strSql.Append("     ,Num");                                                                 // 序号
            strSql.Append("	    ,SelectType");                                                          // 成员构成导入类型
            strSql.Append("	    ,SelectValue");                                                         // 用【,】隔开导入省份或者会员ID数据
            strSql.Append("	    ,PassWord");                                                            // 密码
            strSql.Append("	    ,Opertor");                                                             // 操作人
            strSql.Append("	    ,OperateTime");                                                         // 操作时间
            strSql.Append(" FROM");
            strSql.Append("     tbl_SuperCluster");
            strSql.Append(" WHERE");
            strSql.Append("     ID = @ID");

            DbCommand cmd = this._database.GetSqlStringCommand(strSql.ToString());                      // SQL执行

            this._database.AddInParameter(cmd, "@ID", DbType.Int32, id);                                // 同业中心ID

            using (IDataReader dr = DbHelper.ExecuteReader(cmd, this._database))
            {
                while (dr.Read())
                {
                    // 名称
                    model.Title = dr.IsDBNull(dr.GetOrdinal("title")) ? string.Empty : dr.GetString(dr.GetOrdinal("title"));

                    // 总管理员
                    model.Master = dr.IsDBNull(dr.GetOrdinal("master")) ? 0 : dr.GetInt32(dr.GetOrdinal("master"));

                    // 序号
                    model.Num = dr.IsDBNull(dr.GetOrdinal("Num")) ? 0 : dr.GetInt32(dr.GetOrdinal("Num"));

                    // 成员构成导入类型
                    model.SelectType = dr.IsDBNull(dr.GetOrdinal("SelectType")) ? EyouSoft.Model.MQStructure.SelectType.择省市 : (EyouSoft.Model.MQStructure.SelectType)dr.GetInt32(dr.GetOrdinal("SelectType"));

                    // 用【,】隔开导入省份或者会员ID数据
                    model.SelectValue = dr.IsDBNull(dr.GetOrdinal("SelectValue")) ? string.Empty : dr.GetString(dr.GetOrdinal("SelectValue"));

                    // 密码
                    model.PassWord = dr.IsDBNull(dr.GetOrdinal("PassWord")) ? string.Empty : dr.GetString(dr.GetOrdinal("PassWord"));

                    // 发布人
                    model.Opertor = dr.IsDBNull(dr.GetOrdinal("Opertor")) ? string.Empty : dr.GetString(dr.GetOrdinal("Opertor"));

                    // 发布时间
                    model.OperateTime = dr.IsDBNull(dr.GetOrdinal("OperateTime")) ? DateTime.Now : dr.GetDateTime(dr.GetOrdinal("OperateTime"));
                }
            }

            // 返回同业中心实体
            return(model);
        }
Esempio n. 5
0
 /// <summary>
 /// 更新同业中心
 /// </summary>
 /// <param name="model">同业中心实体</param>
 /// <returns>True:成功 False:失败</returns>
 public bool Upd(EyouSoft.Model.MQStructure.IMSuperCluster model)
 {
     if (model != null)
     {
         return(this.dal.Upd(model));
     }
     else
     {
         return(false);
     }
 }
Esempio n. 6
0
        //初始化
        private void Bind()
        {
            int id = Utils.GetInt(Utils.GetQueryStringValue("id"));

            if (id != 0)
            {
                EyouSoft.Model.MQStructure.IMSuperCluster model = EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().GetSuperClusterByID(id);
                if (model != null)
                {
                    //同业中心名称
                    txtTongyeCenterName.Value = model.Title;
                    //会员导入方式
                    if (model.SelectType == EyouSoft.Model.MQStructure.SelectType.择省市)
                    {
                        selProvince.Checked = true;
                        //导入的省市
                        hidProCityIDs.Value = model.SelectValue;
                    }
                    else if (model.SelectType == EyouSoft.Model.MQStructure.SelectType.择会员ID)
                    {
                        radByIds.Checked = true;
                        //导入的会员ID
                        hidMemberIDs.Value = model.SelectValue;
                    }
                    //排序号
                    txtSort.Value = model.Num.ToString();
                    //总管理员ID
                    txtIDs.Value = model.Master.ToString();
                    //总管理员密码
                    txtPassword.Value = model.PassWord;
                    //操作人
                    txtOper.Value = MasterUserInfo.ContactName;
                    //操作时间
                    txtDate.Value = model.OperateTime.ToString();
                }
            }
            else
            {
                txtOper.Value = MasterUserInfo.ContactName;
                txtDate.Value = DateTime.Now.ToString();
            }
            //获得所有已选的省市
            IList <EyouSoft.Model.SystemStructure.ProvinceBase> list = null;

            list = EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().GetSelectedProvincesByID(id);
            if (list != null)
            {
                foreach (var item in list)
                {
                    hidProCityIDsEd.Value += item.ProvinceId + ",";
                }
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 绑定
        /// </summary>
        private void Bind()
        {
            //时间
            int Stime = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("Stime"));
            //同中中心编号
            int SuperID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("SuperID"));
            //根据同业中心编号得到其省份
            string Province = "0";

            EyouSoft.Model.MQStructure.IMSuperCluster model = EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().GetSuperClusterByID(SuperID);
            if (model != null)
            {
                if (model.SelectType == EyouSoft.Model.MQStructure.SelectType.择省市)
                {
                    Province = model.SelectValue;
                }
            }
            string SearchText = EyouSoft.Common.Utils.GetFormValue("textfield") == "请输入关键字" ? "" : EyouSoft.Common.Utils.GetFormValue("textfield");

            exList = EyouSoft.BLL.CommunityStructure.ExchangeList.CreateInstance().GetList(Province, Stime, SearchText);
        }
Esempio n. 8
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (CheckData())
            {
                //同业中心编号
                int id = Utils.GetInt(Utils.GetQueryStringValue("id"));
                EyouSoft.Model.MQStructure.IMSuperCluster model = new EyouSoft.Model.MQStructure.IMSuperCluster();
                //同业中心名称
                model.Title = txtTongyeCenterName.Value;
                //会员导入方式
                if (selProvince.Checked)
                {
                    //导入的省市
                    model.SelectType  = EyouSoft.Model.MQStructure.SelectType.择省市;
                    model.SelectValue = hidProCityIDs.Value.Trim(',');
                }
                if (radByIds.Checked)
                {
                    //导入的会员ID
                    model.SelectType   = EyouSoft.Model.MQStructure.SelectType.择会员ID;
                    hidMemberIDs.Value = System.Text.RegularExpressions.Regex.Replace(hidMemberIDs.Value, ",+", ",");
                    model.SelectValue  = hidMemberIDs.Value.Trim(',');
                }
                //排序号
                model.Num = Utils.GetInt(txtSort.Value);
                //总管理员ID
                model.Master = Utils.GetInt(txtIDs.Value);
                //总管理员密码
                model.PassWord = txtPassword.Value;
                //操作人
                model.Opertor = txtOper.Value;
                //操作时间
                model.OperateTime = Utils.GetDateTime(txtDate.Value);

                //修改
                if (id != 0)
                {
                    if (EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().IsExist(model.Title, id))
                    {
                        EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('该同业中心已存在!')");
                        return;
                    }
                    model.Id = id;
                    if (EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().Upd(model))
                    {
                        Utils.ShowAndRedirect("修改成功", "TongyeCenterManager.aspx");
                    }
                    else
                    {
                        Utils.ShowAndRedirect("修改失败", "TongyeCenterManager.aspx");
                    }
                }
                //添加
                else
                {
                    if (EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().IsExist(model.Title, 0))
                    {
                        EyouSoft.Common.Function.MessageBox.ResponseScript(this, "alert('该同业中心已存在!')");
                        return;
                    }
                    if (EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().Add(model))
                    {
                        Utils.ShowAndRedirect("添加成功", "TongyeCenterManager.aspx");
                    }
                    else
                    {
                        Utils.ShowAndRedirect("添加失败", "TongyeCenterManager.aspx");
                    }
                }
            }
        }
Esempio n. 9
0
        private void Post()
        {
            //同业中心编号
            int SuperID = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("SuperID"));

            //同心中心所选省份
            EyouSoft.Model.MQStructure.IMSuperCluster IMSuperCluster = EyouSoft.BLL.MQStructure.IMSuperCluster.CreateInstance().GetSuperClusterByID(SuperID);
            System.Collections.Generic.IList <int>    ProvinceIds    = null;
            if (IMSuperCluster != null)
            {
                if (IMSuperCluster.SelectType == EyouSoft.Model.MQStructure.SelectType.择省市)
                {
                    string[] strProvinceIds = IMSuperCluster.SelectValue.Split(',');

                    if (strProvinceIds != null && strProvinceIds.Length > 0)
                    {
                        ProvinceIds = new System.Collections.Generic.List <int>();
                        for (int i = 0; i < strProvinceIds.Length; i++)
                        {
                            if (!string.IsNullOrEmpty(strProvinceIds[i]) && EyouSoft.Common.Function.StringValidate.IsInteger(strProvinceIds[i]))
                            {
                                ProvinceIds.Add(int.Parse(strProvinceIds[i]));
                            }
                        }
                    }
                }
            }
            EyouSoft.Model.CommunityStructure.ExchangeList model = new EyouSoft.Model.CommunityStructure.ExchangeList();
            if (content.Value.Length == 0)
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "document.getElementById(\"showMsg\").innerHTML=\"请输入求购内容\";");
                return;
            }
            if (content.Value.Length > 500)
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "document.getElementById(\"showMsg\").innerHTML=\"求购内容最多500字\";");
                return;
            }
            if (content.Value.Length > 15)
            {
                model.ExchangeTitle = content.Value.Substring(0, 15);
            }
            else
            {
                model.ExchangeTitle = content.Value;
            }
            model.CityId           = SiteUserInfo.CityId;
            model.CompanyId        = SiteUserInfo.CompanyID;
            model.CompanyName      = SiteUserInfo.CompanyName;
            model.ContactName      = SiteUserInfo.ContactInfo.ContactName;
            model.ContactTel       = SiteUserInfo.ContactInfo.Tel;
            model.ExchangeCategory = EyouSoft.Model.CommunityStructure.ExchangeCategory.求;
            model.ExchangeTag      = EyouSoft.Model.CommunityStructure.ExchangeTag.无;
            model.ExchangeText     = content.Value;
            model.IsCheck          = IsCompanyCheck;
            model.IssueTime        = DateTime.Now;
            model.IsTop            = false;
            model.OperatorId       = SiteUserInfo.ID;
            model.OperatorMQ       = SiteUserInfo.ContactInfo.MQ;
            model.OperatorName     = SiteUserInfo.ContactInfo.ContactName;
            model.ProvinceId       = SiteUserInfo.ProvinceId;
            model.AttatchPath      = "";
            model.TopicClassID     = EyouSoft.Model.CommunityStructure.ExchangeType.业MQ;
            bool Result = EyouSoft.BLL.CommunityStructure.ExchangeList.CreateInstance().AddExchangeList(model, ProvinceIds == null ? null : ProvinceIds.ToArray());

            if (Result)
            {
                content.Value = "";
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "document.getElementById(\"showMsg\").innerHTML=\"发布成功\";");
            }
            else
            {
                EyouSoft.Common.Function.MessageBox.ResponseScript(this, "document.getElementById(\"showMsg\").innerHTML=\"发布失败\";");
            }
        }
Esempio n. 10
0
        /// <summary>
        /// 根据同业中心ID获取同业中心实体列表
        /// </summary>
        /// <param name="pageSize">每页显示条数</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="recordCount">总记录数</param>
        /// <returns>同业中心实体列表</returns>
        public IList <Model.MQStructure.IMSuperCluster> GetList(int pageSize, int pageIndex, ref int recordCount)
        {
            var lst = new List <EyouSoft.Model.MQStructure.IMSuperCluster>();                            // 同业中心实体列表

            using (IDataReader dr = DbHelper.ExecuteReader(this._database, pageSize, pageIndex, ref recordCount
                                                           , "tbl_SuperCluster", "ID", "ID,Num,Title,CASE SelectType WHEN 1 THEN (SELECT D.ProvinceName,(SELECT COUNT(DISTINCT A.user_id) FROM tbl_SuperClusterUser AS A JOIN tbl_CompanyUser AS B ON B.Id = A.user_id AND B.ProvinceId = C.items AND B.IsEnable = 1) AS CountNum FROM (SELECT items FROM dbo.fn_Split(SelectValue ,',')) AS C INNER JOIN tbl_SysProvince AS D ON D.ID = C.items FOR XML PATH('Value'),ROOT('Values')) WHEN 2 THEN (SELECT '其他成员' AS ProvinceName,(SELECT COUNT(*) FROM (SELECT items FROM dbo.fn_Split(SelectValue ,',')) AS AA) AS CountNum FOR XML PATH('Value'),ROOT('Values')) END AS CountValue,master,PassWord,Opertor,OperateTime"
                                                           , String.Empty
                                                           , "Num ASC,OperateTime DESC"))
            {
                while (dr.Read())
                {
                    // 成员构成初期化
                    var strCountValue = string.Empty;

                    if (!dr.IsDBNull(dr.GetOrdinal("CountValue")))
                    {
                        // 实例化xml
                        var xml = new XmlDocument();

                        // 读取xml文件
                        xml.LoadXml(dr.GetString(dr.GetOrdinal("CountValue")));

                        foreach (XmlNode nodeP in xml.ChildNodes[0].ChildNodes)
                        {
                            var strTmp = string.Empty;
                            foreach (XmlNode nodeT in nodeP.ChildNodes)
                            {
                                switch (nodeT.Name)
                                {
                                case "ProvinceName":
                                    strTmp = nodeT.InnerText + "(<b style='color: red;'>{0}</b>人),";
                                    break;

                                case "CountNum":
                                    strTmp = string.Format(strTmp, nodeT.InnerText);
                                    break;
                                }
                            }

                            strCountValue = strCountValue + strTmp;
                        }
                    }

                    // 公告信息实体
                    var model = new EyouSoft.Model.MQStructure.IMSuperCluster
                    {
                        // 同业中心ID
                        Id = dr.GetInt32(dr.GetOrdinal("ID")),

                        // 名称
                        Title = dr.IsDBNull(dr.GetOrdinal("Title")) ? string.Empty : dr.GetString(dr.GetOrdinal("Title")),

                        // 序号
                        Num = dr.IsDBNull(dr.GetOrdinal("Num")) ? 0 : dr.GetInt32(dr.GetOrdinal("Num")),

                        // 成员构成
                        CountValue = strCountValue.TrimEnd(','),

                        // 总管理员
                        Master = dr.IsDBNull(dr.GetOrdinal("Master")) ? 0 : dr.GetInt32(dr.GetOrdinal("Master")),

                        // 密码
                        PassWord = dr.IsDBNull(dr.GetOrdinal("PassWord")) ? string.Empty : dr.GetString(dr.GetOrdinal("PassWord")),

                        // 发布人
                        Opertor = dr.IsDBNull(dr.GetOrdinal("Opertor")) ? string.Empty : dr.GetString(dr.GetOrdinal("Opertor")),

                        // 发布时间
                        OperateTime = dr.IsDBNull(dr.GetOrdinal("OperateTime")) ? DateTime.Now : dr.GetDateTime(dr.GetOrdinal("OperateTime"))
                    };

                    // 追加到同业中心实体列表
                    lst.Add(model);
                }
            }

            // 返回同业中心实体列表
            return(lst);
        }