Esempio n. 1
0
        /// <summary>
        /// 使用分页技术查询所有客户信息
        /// </summary>
        /// <param name="page">参数列集合</param>
        /// <returns>返回查询结果集</returns>
        public static List<ViewCustomers> ViewCustomerFindAll(CommonPage page)
        {
            List<ViewCustomers> list = new List<ViewCustomers>();

            string sql = "PagingProc";
            List<SqlParameter> paras = new List<SqlParameter>()
            {
                new SqlParameter("@TbName",page.TbName),
                new SqlParameter("@KeyFile",page.KeyFile),
                new SqlParameter("@ShowFile",page.ShowFile),
                new SqlParameter("@Where",page.Where),
                new SqlParameter("@OrderBy",page.OrderBy),
                new SqlParameter("@PIndex",page.PIndex),
                new SqlParameter("@PSize",page.PSize)
            };
            try
            {
                using (SqlDataReader sdr = DBHelp.ExecuteReaderProc(sql, paras))
                {
                    while (sdr.Read())
                    {
                        ViewCustomers obj = new ViewCustomers();
                        obj.CusID = sdr["CusID"].ToString();
                        obj.UserID = Convert.ToInt32(sdr["UserID"].ToString());
                        obj.CusName = sdr["CusName"].ToString();
                        obj.UserName = sdr["UserName"].ToString();
                        obj.CusDate = sdr["CusDate"].ToString();
                        obj.CusAddress = sdr["CusAddress"].ToString();
                        obj.CusZip = sdr["CusZip"].ToString();
                        obj.CusFax = sdr["CusFax"].ToString();
                        obj.CusWebsite = sdr["CusWebsite"].ToString();
                        obj.CusLicenceNo = sdr["CusLicenceNo"].ToString();
                        obj.CusChieftain = sdr["CusChieftain"].ToString();
                        obj.CusBankroll = Convert.ToInt32(sdr["CusBankroll"].ToString());
                        obj.CusTurnover = Convert.ToInt32(sdr["CusTurnover"].ToString());
                        obj.CusLocalTaxNo = sdr["CusLocalTaxNo"].ToString();
                        obj.CusBank = sdr["CusBank"].ToString();
                        obj.CusBankNo = sdr["CusBankNo"].ToString();
                        obj.CusLocalTaxNo = sdr["CusLocalTaxNo"].ToString();
                        obj.CusNationalTaxNo = sdr["CusNationalTaxNo"].ToString();
                        obj.CusState = Convert.ToInt32(sdr["CusState"].ToString());
                        list.Add(obj);
                    }
                    return list;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 使用分页技术查询所有客户数据
        /// </summary>
        /// <param name="page">参数列集合</param>
        /// <returns>返回查询结果集</returns>
        public static Dictionary<string, object> ViewCustomerFindAll(string tBName, string keyFile, string showFile, string where, string orderBy, int pIndex, int pSize)
        {
            int count = PagingDAL.GetCount(tBName, where);
            int pageCount = count % pSize == 0 ? count / pSize : count / pSize + 1;
            pIndex = pIndex <= 0 ? 1 : pIndex;
            pIndex = pIndex > pageCount ? pageCount : pIndex;
            CommonPage page = new CommonPage(tBName, keyFile, showFile, where, orderBy, pIndex, pSize);

            Dictionary<string, object> dt = new Dictionary<string, object>();
            dt.Add("list", ViewCustomersDAL.ViewCustomerFindAll(page));
            dt.Add("count", count);
            dt.Add("pageCount", pageCount);
            dt.Add("pIndex", pIndex);
            return dt;
        }
Esempio n. 3
0
 /// <summary>
 /// 此方法返回所有的开发计划
 /// </summary>
 /// <returns>List<Plans></returns>
 public static List<ViewPlans> PlansFindAll(CommonPage page)
 {
     string sql = "PagingProc";
     List<SqlParameter> paras = new List<SqlParameter>()
     {
         new SqlParameter("@TbName",page.TbName),
         new SqlParameter("@KeyFile",page.KeyFile),
         new SqlParameter("@ShowFile",page.ShowFile),
         new SqlParameter("@Where",page.Where),
         new SqlParameter("@OrderBy",page.OrderBy),
         new SqlParameter("@PIndex",page.PIndex),
         new SqlParameter("@PSize",page.PSize)
     };
     List<ViewPlans> list = new List<ViewPlans>();
     try
     {
         using (SqlDataReader sdr = DBHelp.ExecuteReaderProc(sql, paras))
         {
             while (sdr.Read())
             {
                 ViewPlans obj = new ViewPlans
                 (
                     sdr["PlanID"].ToString(),
                     Convert.ToInt32(sdr["ChanID"].ToString()),
                     sdr["PlanDate"].ToString(),
                     sdr["PlanContent"].ToString(),
                     sdr["PlanResultDate"]!=null?sdr["PlanResultDate"].ToString():"",
                     sdr["PlanResult"].ToString(),
                     sdr["chanError"].ToString(),
                     Convert.ToInt32(sdr["ChanState"].ToString())
                 );
                 list.Add(obj);
             }
             return list;
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 4
0
        /// <summary>
        /// 使用分页技术查询所有客户流失信息
        /// </summary>
        /// <param name="page">参数列集合</param>
        /// <returns>返回查询结果集</returns>
        public static List<ViewCustomLosts> VCLFindAll(CommonPage page)
        {
            List<ViewCustomLosts> list = new List<ViewCustomLosts>();

            string sql = "PagingProc";
            List<SqlParameter> paras = new List<SqlParameter>()
            {
                new SqlParameter("@TbName",page.TbName),
                new SqlParameter("@KeyFile",page.KeyFile),
                new SqlParameter("@ShowFile",page.ShowFile),
                new SqlParameter("@Where",page.Where),
                new SqlParameter("@OrderBy",page.OrderBy),
                new SqlParameter("@PIndex",page.PIndex),
                new SqlParameter("@PSize",page.PSize)
            };
            try
            {
                using (SqlDataReader sdr = DBHelp.ExecuteReaderProc(sql, paras))
                {
                    while (sdr.Read())
                    {
                        ViewCustomLosts obj = new ViewCustomLosts();
                        obj.CLID = Convert.ToInt32(sdr["CLID"].ToString());
                        obj.CusID = sdr["CusID"].ToString();
                        obj.CLOrderDate = sdr["CLOrderDate"].ToString();
                        obj.CLDate = sdr["CLDate"].ToString();
                        obj.CLEnterDate = sdr["CLEnterDate"].ToString();
                        obj.CLReason = sdr["CLReason"].ToString();
                        obj.CLState = Convert.ToInt32(sdr["CLState"].ToString());
                        obj.CusName = sdr["CusName"].ToString();
                        list.Add(obj);
                    }
                    return list;
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 5
0
 /// <summary>
 /// 调用存储过程查询出服务分配模块需要显示的相关信息
 /// </summary>
 /// <param name="page"></param>
 /// <returns></returns>
 public static List<ViewCustomServices> GetAll(CommonPage page)
 {
     return ViewCustomServicesDAL.GetAll(page);
 }
Esempio n. 6
0
        /// <summary>
        /// 调用存储过程查询出服务分配模块需要显示的相关信息
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public static List<ViewCustomServices> GetAll(CommonPage page)
        {
            List<ViewCustomServices> list = new List<ViewCustomServices>();

            string sql = "PagingProc";
            List<SqlParameter> paras = new List<SqlParameter>()
            {
                new SqlParameter("@TbName",page.TbName),
                new SqlParameter("@KeyFile",page.KeyFile),
                new SqlParameter("@ShowFile",page.ShowFile),
                new SqlParameter("@Where",page.Where),
                new SqlParameter("@OrderBy",page.OrderBy),
                new SqlParameter("@PIndex",page.PIndex),
                new SqlParameter("@PSize",page.PSize)
            };
            try
            {
                using (SqlDataReader sr = DBHelp.ExecuteReaderProc(sql, paras))
                {
                    while (sr.Read()) {
                        ViewCustomServices u = new ViewCustomServices();
                        u.CSID = Convert.ToInt32(sr["CSID"].ToString());
                        u.CSCreateDate = sr["CSCreateDate"].ToString();
                        u.CSTitle = sr["CSTitle"].ToString();
                        u.CusName = sr["CusName"].ToString();
                        u.STName = sr["STName"].ToString();
                        u.UserName = sr["UserName"].ToString();
                        u.STID = Convert.ToInt32(sr["STID"].ToString());
                        u.CusID = sr["CusID"].ToString();
                        u.CSState = Convert.ToInt32(sr["CSState"].ToString());
                        u.CSDesc = sr["CSDesc"].ToString();
                        u.CSCreateID = Convert.ToInt32(sr["CSCreateID"]);
                        if (sr["CSDueID"] != null)
                        {
                            u.CSDueID = Convert.ToInt32(sr["CSDueID"]);
                        }
                        if (sr["CSDueDate"] != null)
                        {
                            u.CSDueDate = sr["CSDueDate"].ToString();
                        }
                        if (sr["CSDeal"] != null)
                        {
                            u.CSDeal = sr["CSDeal"].ToString();
                        }
                        if (sr["CSDealDate"] != null)
                        {
                            u.CSDealDate = sr["CSDealDate"].ToString();
                        }
                        if (sr["CSResult"] != null)
                        {
                            u.CSResult = sr["CSResult"].ToString();
                        }
                        if (sr["CSSatisfy"] != null)
                        {
                            u.CSSatisfy = StringDisposeDAL.StrToInt(sr["CSSatisfy"].ToString());
                        }
                        list.Add(u);
                    }
                }
                return list;
            }
            catch (Exception)
            {
                throw;
            }
        }