Пример #1
0
        /// <summary>
        /// �Է������ת��
        /// </summary>
        /// <param name="ename">ģ������</param>
        /// <param name="pt_parentID">����ID</param>
        /// <param name="flag">flag:0 ��ת�Ƶ����� flag:1 ����Ϊ����</param>
        private void Move(String ename, long lngMoveTypeId, String flag)
        {
            int err = 0;

            if (ename.Equals("job") || ename.Equals("exhibition"))
            {
                if (ename.Equals("job"))
                {
                    postinfo = post.GetItem(Convert.ToInt32(lngMoveTypeId));
                    XYECOM.Model.PostInfo info = new XYECOM.Model.PostInfo();
                    info.P_ID = postinfo.P_ID;
                    info.P_Name = postinfo.P_Name;
                    if (toTypeId.Equals(lngMoveTypeId))
                    {
                        info.P_ParentID = postinfo.P_ParentID;
                    }
                    else
                    {
                        info.P_ParentID = Convert.ToInt32(toTypeId);
                    }
                    if (flag.Equals("1"))
                    {
                        info.P_ParentID = 0;
                    }
                    err = post.Update(info);
                }
                if (ename.Equals("exhibition"))
                {
                    showinfo = showtype.GetItem(lngMoveTypeId);
                    XYECOM.Model.ShowTypeInfo info = new XYECOM.Model.ShowTypeInfo();
                    info.SHT_Name = showinfo.SHT_Name;

                    if (toTypeId.Equals(lngMoveTypeId))
                    {
                        info.SHT_ParentID = showinfo.SHT_ParentID;
                    }
                    else
                    {
                        info.SHT_ParentID = toTypeId;
                    }
                    if (flag.Equals("1"))
                    {
                        info.SHT_ParentID = 0;
                    }
                    info.SHT_ID = showinfo.SHT_ID;
                    err = showtype.Update(info);
                }
            }
            else
            {
                if (ename.Equals("offer") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("offer"))
                {
                    proTypeInfo = proTypeBLL.GetItem(lngMoveTypeId);

                    if (flag.Equals("1"))
                    {
                        proTypeInfo.PT_ParentID = 0;
                    }
                    else
                    {
                        if (toTypeId != lngMoveTypeId)
                        {
                            Model.ProductTypeInfo _tempInfo = proTypeBLL.GetItem(toTypeId);

                            if (_tempInfo != null) proTypeInfo.TradeId = _tempInfo.TradeId;

                            proTypeInfo.PT_ParentID = toTypeId;
                        }
                    }

                    err = proTypeBLL.Update(proTypeInfo);

                }

                if (ename.Equals("investment") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("investment"))
                {
                    iti = it.GetItem(lngMoveTypeId);
                    XYECOM.Model.InviteBusinessTypeInfo info = new XYECOM.Model.InviteBusinessTypeInfo();
                    info.IT_Name = iti.IT_Name;

                    if (toTypeId.Equals(lngMoveTypeId))
                    {
                        info.IT_ParentID = iti.IT_ParentID;
                    }
                    else
                    {
                        info.IT_ParentID = toTypeId;
                    }
                    if (flag.Equals("1"))
                    {
                        info.IT_ParentID = 0;
                    }
                    info.ModuleName = iti.ModuleName;
                    info.IT_ID = iti.IT_ID;
                    err = it.Update(info);
                }
                if (ename.Equals("service") || XYECOM.Configuration.Module.Instance.GetItem(ename).PEName.Equals("service"))
                {
                    sti = st.GetItem(lngMoveTypeId);
                    XYECOM.Model.ServiceTypeInfo info = new XYECOM.Model.ServiceTypeInfo();
                    info.ST_Name = sti.ST_Name;

                    if (toTypeId.Equals(lngMoveTypeId))
                    {
                        info.ST_ParentID = sti.ST_ParentID;
                    }
                    else
                    {
                        info.ST_ParentID = toTypeId;
                    }
                    if (flag.Equals("1"))
                    {
                        info.ST_ParentID = 0;
                    }
                    info.ModuleName = sti.ModuleName;
                    info.ST_ID = sti.ST_ID;
                    err = st.Update(info);
                }
            }

            if (err > 0)
            {
                Response.Redirect("Typelist.aspx?ename=" + ename + "&orderid=" + lngMoveTypeId);
            }
            else
            {
                this.lblMessage.Text = "ת��ʧ�ܣ�";
            }
        }
Пример #2
0
        /// <summary>
        /// ���ط��༯��
        /// </summary>
        /// <returns></returns>
        public List<Model.ProductTypeInfo> GetItems()
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@strWhere",""),
                new SqlParameter("@strTableName","b_ProductType"),
                new SqlParameter("@strOrder","")
            };

            List<Model.ProductTypeInfo> infos = new List<XYECOM.Model.ProductTypeInfo>();

            using (SqlDataReader dr = XYECOM.Core.Data.SqlHelper.ExecuteReader(CommandType.StoredProcedure, "XYP_SelectByWhere", param))
            {
                while (dr.Read())
                {
                    XYECOM.Model.ProductTypeInfo info = new XYECOM.Model.ProductTypeInfo();

                    info.PT_ID = Convert.ToInt64(dr["PT_ID"].ToString());
                    info.PT_Name = dr["PT_Name"].ToString();
                    info.PT_ParentID = Convert.ToInt64(dr["PT_ParentID"].ToString());
                    info.ModuleName = dr["ModuleName"].ToString();
                    info.FullId = dr["FullId"].ToString();
                    info.InfoCount = Core.MyConvert.GetInt32(dr["InfoCount"].ToString());
                    info.TradeId = Core.MyConvert.GetInt32(dr["TradeId"].ToString());
                    info.FlagName = dr["FlagName"].ToString();
                    info.IsCustomTemplate = dr["IsCustomTemplate"].ToString().Equals("True") ? true : false;

                    infos.Add(info);
                }
            }
            return infos;
        }
Пример #3
0
        /// <summary>
        /// ͨ������ID��ȡ�÷�����Ϣ ��������� 2011-03-30��
        /// </summary>
        /// <param name="id">����Id</param>
        /// <returns>������Ϣ</returns>
        public Model.ProductTypeInfo GetProTypeById(int id)
        {
            string sql = "select * from b_producttype where pt_id = " + id + "";
            XYECOM.Model.ProductTypeInfo info = null;

            using (SqlDataReader dr = XYECOM.Core.Data.SqlHelper.ExecuteReader(CommandType.Text, sql, null))
            {
                if (dr.Read())
                {
                    info = new XYECOM.Model.ProductTypeInfo();

                    info.PT_ID = Convert.ToInt64(dr["PT_ID"].ToString());
                    info.PT_Name = dr["PT_Name"].ToString();
                    info.PT_ParentID = Convert.ToInt64(dr["PT_ParentID"].ToString());
                    info.ModuleName = dr["ModuleName"].ToString();
                    info.FullId = dr["FullId"].ToString();
                    info.InfoCount = Core.MyConvert.GetInt32(dr["InfoCount"].ToString());
                    info.TradeId = Core.MyConvert.GetInt32(dr["TradeId"].ToString());
                    info.FlagName = dr["FlagName"].ToString();
                    info.IsCustomTemplate = dr["IsCustomTemplate"].ToString().Equals("True") ? true : false;
                }
            }
            return info;
        }
Пример #4
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="keyword"></param>
        /// <returns></returns>
        public XYECOM.Model.ProductTypeInfo GetItemByTypeName(string keyword)
        {
            SqlParameter[] param = new SqlParameter[]
            {
                new SqlParameter("@strWhere","Where pt_name='" + keyword + "'"),
                new SqlParameter("@strTableName","b_ProductType"),
                new SqlParameter("@strOrder","")
            };

            XYECOM.Model.ProductTypeInfo info = null; ;

            using (SqlDataReader dr = XYECOM.Core.Data.SqlHelper.ExecuteReader(CommandType.StoredProcedure, "XYP_SelectByWhere", param))
            {
                if (dr.Read())
                {
                    info = new XYECOM.Model.ProductTypeInfo();

                    info.PT_ID = Convert.ToInt64(dr["PT_ID"].ToString());
                    info.PT_Name = dr["PT_Name"].ToString();
                    info.PT_ParentID = Convert.ToInt64(dr["PT_ParentID"].ToString());
                    info.ModuleName = dr["ModuleName"].ToString();
                    info.FullId = dr["FullId"].ToString();
                    info.InfoCount = Core.MyConvert.GetInt32(dr["InfoCount"].ToString());
                    info.TradeId = Core.MyConvert.GetInt32(dr["TradeId"].ToString());
                    info.FlagName = dr["FlagName"].ToString();
                    info.IsCustomTemplate = dr["IsCustomTemplate"].ToString().Equals("True") ? true : false;
                }
            }
            return info;
        }