예제 #1
0
 public LogoList()
 {
     pager = new Pager(1, 20);
     enabled = -1;
     logoType = LogoType.Record;
     userId = 0;
     industry = "";
     repeatTemplate = "";
 }
예제 #2
0
 /// <summary>
 /// ��ȡRecord����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="enabled">ָ��������</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListRecord(Pager pager, bool enabled)
 {
     return List(LogoType.Record, pager, 0, "", enabled ? 1 : 0, "");
 }
예제 #3
0
 public static ArrayList GetCards(int uid,bool enable, Pager pager)
 {
     return GetCards(uid, enable?1:0, -1, pager);
 }
예제 #4
0
        private static ArrayList GetLogos(int uid, int enable, Pager pager)
        {
            ArrayList list = new ArrayList();
            /*
             LogoList
            @type char(1),
            @uid int=0,
            @industry char(6)='000000',
            @pageindex int=1,
            @pagesize int=20,
            @sort int=0
             */
            SqlParameter[] prams ={
                Database.MakeReturnValueParam("@returnValue"),
                Database.MakeInParam("@uid",SqlDbType.Int,uid),
                Database.MakeInParam("@enable",SqlDbType.Int,enable),
                Database.MakeInParam("@pageindex",SqlDbType.Int,pager.PageIndex),
                Database.MakeInParam("@pagesize",SqlDbType.Int,pager.PageSize),
                Database.MakeInParam("@sort",SqlDbType.Int,pager.SortNum)
            };

            SqlDataReader reader = null;

            try
            {
                reader = Database.ExecuteReader(CommandType.StoredProcedure, "LogoList", prams);

                if (reader.Read())
                {
                    pager.RecordCount = reader.GetInt32(0);

                    if (reader.NextResult())
                    {
                        while (reader.Read())
                        {
                            /*[Id],Guid, UserId, Title, Remark, Enable, [Datetime]*/
                            Logo logo = new Logo();
                            logo.Id = reader.GetInt32(0);
                            logo.Guid = reader.GetString(1);
                            logo.UserId = reader.GetInt32(2);
                            logo.Title = reader.GetString(3);
                            logo.Remark = reader.GetString(4);
                            logo.Enable = (reader.GetString(5)=="1");
                            logo.Datetime = reader.GetDateTime(6);
                            list.Add(logo);
                        }
                    }
                }
                reader.Close();
            }
            catch
            {
                //
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

            return list;
        }
예제 #5
0
        /// <summary>
        /// ��ȡ�û���¼
        /// </summary>
        /// <param name="email">�ʼ���ַ�ؼ���</param>
        /// <param name="name">�����ؼ���</param>
        /// <param name="Pager">��ҳ����</param>
        /// <returns></returns>
        public static ArrayList List(string mail, string name, Pager pager)
        {
            /* MemberList
             * @email varchar(50)='',
             * @name varchar(20)='',
             * @pageindex int=1,
             * @pagesize int=20,
             * @sort int=0
             */

            ArrayList list = new ArrayList();
            SqlParameter[] prams ={
                Database.MakeInParam("@email",SqlDbType.VarChar,50,mail),
                Database.MakeInParam("@name",SqlDbType.VarChar,20,name),
                Database.MakeInParam("@pageIndex",SqlDbType.Int,pager.PageIndex),
                Database.MakeInParam("@pageSize",SqlDbType.Int,pager.PageSize),
                Database.MakeInParam("@sort",SqlDbType.Int,pager.SortNum)
            };

            SqlDataReader reader = null;
            try
            {
                reader = Database.ExecuteReader(CommandType.StoredProcedure, "MemberList", prams);

                if (reader.Read())
                {
                    pager.RecordCount = reader.GetInt32(0);

                    if (reader.NextResult())
                    {
                        while (reader.Read())
                        {
                            /*[Id], Email, [Name], RegDate, LastLogin, LoginTimes, LastIp*/
                            Member m = new Member();
                            m.Id = reader.GetInt32(0);
                            m.Email = reader.GetString(1);
                            m.Name = reader.GetString(2);
                            m.RegDate = reader.GetDateTime(3);
                            m.LastLogin = reader.GetDateTime(4);
                            m.LoginTimes = reader.GetInt32(5);
                            m.LastIp = reader.GetString(6);

                            list.Add(m);
                        }
                    }
                }

                reader.Close();
            }
            catch(Exception e)
            {
                throw new Exception("Member.List: +"+e.ToString());
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

            return list;
        }
예제 #6
0
 /// <summary>
 /// ��ȡ�û���¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <returns></returns>
 public static ArrayList List(Pager pager)
 {
     return List("", "", pager);
 }
예제 #7
0
 /// <summary>
 /// ��ȡ��ҵ�û���¼
 /// </summary>
 /// <param name="tur">Ӫҵ�Χ</param>
 /// <param name="emp">Ա������Χ</param>
 /// <param name="pager">��ҳ</param>
 /// <returns></returns>
 public static ArrayList List(IntRange tur, IntRange emp, Pager pager)
 {
     return List("", "", tur, emp,-1, pager);
 }
예제 #8
0
 /// <summary>
 /// ��ȡ��ҵ�û���¼
 /// </summary>
 /// <param name="isCheck">�Ƿ񾭹�ȷ�ϵ���ҵ</param>
 /// <param name="indus">��ҵ���</param>
 /// <param name="pager">��ҳ</param>
 /// <returns></returns>
 public static ArrayList List(bool isCheck, string indus, Pager pager)
 {
     return List(indus, "", IntRange.None, IntRange.None, isCheck ? 1 : 0, pager);
 }
예제 #9
0
 /// <summary>
 /// ��ȡUpload����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="uid">�û�ID</param>
 /// <param name="industry">��ҵ����</param>
 /// <param name="enabled">ָ��������</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListUpload(Pager pager, int uid, string industry, bool enabled)
 {
     return List(LogoType.Upload, pager, uid, industry, enabled ? 1 : 0, "");
 }
예제 #10
0
 /// <summary>
 /// ��ȡSample����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListSample(Pager pager)
 {
     return List(LogoType.Sample, pager, 0, "", -1, "");
 }
예제 #11
0
 /// <summary>
 /// ��ȡSample����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="enabled">ָ��������</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListSample(Pager pager, bool enabled)
 {
     return List(LogoType.Sample, pager, 0, "", enabled ? 1 : 0, "");
 }
예제 #12
0
 /// <summary>
 /// ��ȡSample����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="industry">��ҵ����</param>
 /// <param name="exclude">Ҫ�ų���Logo Id,Guid,�����û�Id</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListSample(Pager pager, string industry, string exclude)
 {
     return List(LogoType.Sample, pager, 0, industry, -1, exclude);
 }
예제 #13
0
 /// <summary>
 /// ��ȡSample����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="uid">�û�ID</param>
 /// <param name="industry">��ҵ����</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListSample(Pager pager, int uid, string industry)
 {
     return List(LogoType.Sample, pager, uid, industry, -1, "");
 }
예제 #14
0
 /// <summary>
 /// ��ȡSample����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="uid">�û�ID</param>
 /// <param name="industry">��ҵ����</param>
 /// <param name="enabled">ָ��������</param>
 /// <param name="exclude">Ҫ�ų���Logo Id,Guid,�����û�Id</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListSample(Pager pager, int uid, string industry, bool enabled,string exclude)
 {
     return List(LogoType.Sample, pager, uid, industry, enabled ? 1 : 0, exclude);
 }
예제 #15
0
 /// <summary>
 /// ��ȡRecord����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListRecord(Pager pager)
 {
     return List(LogoType.Record, pager, 0, "", -1, "");
 }
예제 #16
0
 /// <summary>
 /// ��ȡ��ҵ�û���¼
 /// </summary>
 /// <param name="pager">��ҳ</param>
 /// <returns></returns>
 public static new ArrayList List(Pager pager)
 {
     return List("", "", IntRange.None, IntRange.None,-1, pager);
 }
예제 #17
0
 /// <summary>
 /// ��ȡ��ҵ�û���¼
 /// </summary>
 /// <param name="isCheck">�Ƿ񾭹�ȷ�ϵ���ҵ</param>
 /// <param name="pager">��ҳ</param>
 /// <returns></returns>
 public static ArrayList List(bool isCheck,Pager pager)
 {
     return List("", "", IntRange.None, IntRange.None, isCheck?1:0, pager);
 }
예제 #18
0
 /// <summary>
 /// ��ȡUpload����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="uid">�û�ID</param>
 /// <param name="industry">��ҵ����</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListUpload(Pager pager, int uid, string industry)
 {
     return List(LogoType.Upload, pager, uid, industry, -1, "");
 }
예제 #19
0
 /// <summary>
 /// ��ȡ��ҵ�û���¼
 /// </summary>
 /// <param name="indus">��ҵ���</param>
 /// <param name="name">���ƹؼ���</param>
 /// <param name="pager">��ҳ</param>
 /// <returns></returns>
 public static new ArrayList List(string indus, string name, Pager pager)
 {
     return List(indus, name, IntRange.None, IntRange.None,-1, pager);
 }
예제 #20
0
 /// <summary>
 /// ��ȡUpload����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="uid">�û�ID</param>
 /// <param name="enabled">ָ��������</param>
 /// <param name="exclude">Ҫ�ų���Logo Id,Guid,�����û�Id</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListUpload(Pager pager, int uid, bool enabled, string exclude)
 {
     return List(LogoType.Upload, pager, uid, "", enabled ? 1 : 0, exclude);
 }
예제 #21
0
        /// <summary>
        /// ��ȡ��ҵ�û���¼
        /// </summary>
        /// <param name="indus">��ҵ���</param>
        /// <param name="name">���ƹؼ���</param>
        /// <param name="tur">Ӫҵ�Χ</param>
        /// <param name="emp">Ա������Χ</param>
        /// <param name="pager">��ҳ</param>
        /// <returns></returns>
        private static ArrayList List(string indus, string name,IntRange tur,IntRange emp,int check, Pager pager)
        {
            /* CompanyList
             * @name varchar(100)='',
             * @indus varchar(6)='',
             * @check int=-1,
             * @pageindex int=1,
             * @pagesize int=20,
             * @sort int=0
             */

            ArrayList list = new ArrayList();
            SqlParameter[] prams ={
                Database.MakeInParam("@name",SqlDbType.VarChar,100,name),
                Database.MakeInParam("@indus",SqlDbType.Char,6,indus),
                Database.MakeInParam("@check",SqlDbType.Int,check),
                Database.MakeInParam("@pageIndex",SqlDbType.Int,pager.PageIndex),
                Database.MakeInParam("@pageSize",SqlDbType.Int,pager.PageSize),
                Database.MakeInParam("@sort",SqlDbType.Int,pager.SortNum)
            };

            SqlDataReader reader = null;
            try
            {
                reader = Database.ExecuteReader(CommandType.StoredProcedure, "CompanyList", prams);

                if (reader.Read())
                {
                    pager.RecordCount = reader.GetInt32(0);

                    if (reader.NextResult())
                    {
                        while (reader.Read())
                        {
                            /*[Id],[Name],Industry,Nature,Region,Contact,ContactPos,Phone,Fax,TurnoverLower,TurnoverUpper,
                             * EmployeeLower,EmployeeUpper,CreatedYear,Website,BusiType,IsChecked*/
                            Company obj = new Company();
                            obj.Id = reader.GetInt32(0);
                            obj.ComName = reader.IsDBNull(1) ? "" : reader.GetString(1);
                            obj.Industry = reader.IsDBNull(2) ? "" : reader.GetString(2);
                            obj.Nature = reader.IsDBNull(3) ? "" : reader.GetString(3);
                            obj.Region = reader.IsDBNull(4) ? "" : reader.GetString(4);
                            obj.Contact = reader.IsDBNull(5) ? "" : reader.GetString(5);
                            obj.ContactPos = reader.IsDBNull(6) ? "" : reader.GetString(6);
                            obj.Phone = reader.IsDBNull(7) ? "" : reader.GetString(7);
                            obj.Fax = reader.IsDBNull(8) ? "" : reader.GetString(8);
                            obj.Turnover = (reader.IsDBNull(9) || reader.IsDBNull(10)) ? IntRange.None : new IntRange(reader.GetInt32(9), reader.GetInt32(10));
                            obj.Employee = (reader.IsDBNull(11)||reader.IsDBNull(12))  ? IntRange.None : new IntRange(reader.GetInt32(11), reader.GetInt32(12));
                            obj.Year = reader.IsDBNull(13) ? 1900 : reader.GetInt32(13);
                            obj.Website = reader.IsDBNull(14) ? "" : reader.GetString(14);
                            obj.BusiType = (BusinessType)Convert.ToInt16(reader.GetString(15));
                            obj.IsChecked=reader.GetString(16)=="1"?true:false;
                            list.Add(obj);
                        }
                    }
                }
                reader.Close();
            }
            catch(Exception e)
            {
                throw e;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

            return list;
        }
예제 #22
0
 /// <summary>
 /// ��ȡUpload����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="industry">��ҵ����</param>
 /// <param name="enabled">ָ��������</param>
 /// <param name="exclude">Ҫ�ų���Logo Id,Guid,�����û�Id</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListUpload(Pager pager, string industry, bool enabled, string exclude)
 {
     return List(LogoType.Upload, pager, 0, industry, enabled ? 1 : 0, exclude);
 }
예제 #23
0
 /// <summary>
 /// ��ȡ�û���¼
 /// </summary>
 /// <param name="email">�ʼ���ַ�ؼ���</param>
 /// <param name="pager">��ҳ����</param>
 /// <returns></returns>
 public static ArrayList List(string mail, Pager pager)
 {
     return List(mail, "", pager);
 }
예제 #24
0
 /// <summary>
 /// ��ȡUpload����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <param name="industry">��ҵ����</param>
 /// <param name="exclude">Ҫ�ų���Logo Id,Guid,�����û�Id</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListUpload(Pager pager, string industry, string exclude)
 {
     return List(LogoType.Upload, pager, 0, industry, -1, exclude);
 }
예제 #25
0
        private static ArrayList GetCards(int uid, int enable, int hasBack, Pager pager)
        {
            ArrayList list = new ArrayList();
            /*
             BusinessCardList
            @uid int=0,
            @enabled int=-1,
            @hasback int=-1,
            @pageindex int=1,
            @pagesize int=20,
            @sort int=0
             */
            SqlParameter[] prams ={
                Database.MakeReturnValueParam("@returnValue"),
                Database.MakeInParam("@uid",SqlDbType.Int,uid),
                Database.MakeInParam("@enable",SqlDbType.Int,enable),
                Database.MakeInParam("@hasback",SqlDbType.Int,hasBack),
                Database.MakeInParam("@pageindex",SqlDbType.Int,pager.PageIndex),
                Database.MakeInParam("@pagesize",SqlDbType.Int,pager.PageSize),
                Database.MakeInParam("@sort",SqlDbType.Int,pager.SortNum)
            };

            SqlDataReader reader = null;

            try
            {
                reader = Database.ExecuteReader(CommandType.StoredProcedure, "BusinessCardList", prams);

                if (reader.Read())
                {
                    pager.RecordCount = reader.GetInt32(0);

                    if (reader.NextResult())
                    {
                        while (reader.Read())
                        {
                            /*[Id],Guid, UserId, [Name], HasBack, Enable, [Datetime]*/
                            BusinessCard card = new BusinessCard();
                            card.Id = reader.GetInt32(0);
                            card.Guid = reader.GetString(1);
                            card.UserId = reader.GetInt32(2);
                            card.Name = reader.GetString(3);
                            card.HasBack = (reader.GetString(4) == "1");
                            card.Enable = (reader.GetString(5) == "1");
                            card.Datetime = reader.GetDateTime(6);
                            list.Add(card);
                        }
                    }
                }
                reader.Close();
            }
            catch
            {
                //
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

            return list;
        }
예제 #26
0
 /// <summary>
 /// ��ȡUpload����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListUpload(Pager pager, bool enabled)
 {
     return List(LogoType.Upload, pager, 0, "", enabled ? 1 : 0, "");
 }
예제 #27
0
 public static ArrayList GetCards(int uid, Pager pager)
 {
     return GetCards(uid, -1, -1, pager);
 }
예제 #28
0
 /// <summary>
 /// ��ȡUpload����Logo��¼
 /// </summary>
 /// <param name="pager">��ҳ����</param>
 /// <returns>ArrayList</returns>
 public static ArrayList ListUpload(Pager pager)
 {
     return List(LogoType.Upload, pager, 0, "", -1, "");
 }
예제 #29
0
 public static ArrayList GetCards(int uid, bool enable,bool hasBack, Pager pager)
 {
     return GetCards(uid, enable ? 1 : 0, hasBack ? 1 : 0, pager);
 }
예제 #30
0
        /// <summary>
        /// ��ȡLogo��¼
        /// </summary>
        /// <param name="type">Logo����</param>
        /// <param name="pager">��ҳ����</param>
        /// <param name="uid">�û�ID</param>
        /// <param name="industry">��ҵ����</param>
        /// <param name="sta">ָ��������</param>
        /// <returns>ArrayList</returns>
        private static ArrayList List(LogoType type, Pager pager, int uid, string industry, int enabled,string exclude)
        {
            ArrayList list = new ArrayList();
            /*
             LogoList
            @type char(1),
            @uid int=0,
            @industry char(6)='000000',
            @pageindex int=1,
            @pagesize int=20,
            @sort int=0
             */
            SqlParameter[] prams ={
                Database.MakeReturnValueParam("@returnValue"),
                Database.MakeInParam("@type",SqlDbType.Char,1,((int)type).ToString()),
                Database.MakeInParam("@uid",SqlDbType.Int,uid),
                Database.MakeInParam("@industry",SqlDbType.Char,6,industry),
                Database.MakeInParam("@enabled",SqlDbType.Char,6,enabled),
                Database.MakeInParam("@exclude",SqlDbType.VarChar,32,String.IsNullOrEmpty(exclude)?"":exclude.Trim()),
                Database.MakeInParam("@pageindex",SqlDbType.Int,pager.PageIndex),
                Database.MakeInParam("@pagesize",SqlDbType.Int,pager.PageSize),
                Database.MakeInParam("@sort",SqlDbType.Int,pager.SortNum)
            };

            SqlDataReader reader = null;

            try
            {
                reader = Database.ExecuteReader(CommandType.StoredProcedure, "LogoList", prams);

                if (reader.Read())
                {
                    pager.RecordCount = reader.GetInt32(0);

                    if (reader.NextResult())
                    {
                        while (reader.Read())
                        {
                            /*[Id],Type,Guid, UserId,Industry, Title, Score, ImageType, CreateDatetime, Enabled,ComName*/
                            LogoBase logo = new LogoBase();
                            logo.Id = reader.GetInt32(0);
                            logo.LType = (LogoType)Convert.ToInt16(reader.GetString(1));
                            logo.Guid = reader.GetString(2);
                            logo.UserId = reader.GetInt32(3);
                            logo.Industry = reader.GetString(4);
                            logo.Title = reader.GetString(5);
                            logo.Score = reader.GetInt32(6);
                            logo.ImageType = (LogoImageType)Convert.ToInt16(reader.GetString(7));
                            logo.CreateDatetime = reader.GetDateTime(8);
                            logo.Enabled = reader.GetString(9) == "1" ? true : false;
                            logo.ComName = reader.GetString(10);
                            list.Add(logo);
                        }
                    }
                }
                reader.Close();
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

            return list;
        }