コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!String.IsNullOrEmpty(Request.QueryString["type"])) SalesType = (SalesProductType)Enum.Parse(typeof(SalesProductType), Request.QueryString["type"]);
         BindData(1);
         DivLeft.InnerHtml = GetLeftHtmlCode();
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!String.IsNullOrEmpty(Request.QueryString["type"]))
         {
             SalesType = (SalesProductType)Enum.Parse(typeof(SalesProductType), Request.QueryString["type"]);
         }
         BindData(1);
         DivLeft.InnerHtml = GetLeftHtmlCode();
     }
 }
コード例 #3
0
 public void SetSalesProduct(int ProductID, SalesProductType SalesType)
 {
     if (!Exists(ProductID, (int)SalesType, 0))
     {
         Add(new SalesProductModel()
         {
             ProductId = ProductID,
             SaleType  = (int)SalesType,
             SiteId    = 0, //from this site
             TimeStamp = DateTime.Now
         });
     }
 }
コード例 #4
0
        public DataTable GetProductList(int PageSize, int PageIndex, SalesProductType SalesType, out int RecordCount)
        {
            int PageLowerBound = 0, PageUpperBount = 0;

            PageLowerBound = (PageIndex - 1) * PageSize;
            PageUpperBount = PageLowerBound + PageSize;

            string sqlCount = "select count(0) from pdproduct p inner join pdsalesproduct sp on sp.productid = p.productid where saletype={0}";
            string sqlData  = @" select * from 
                                (
	                                select row_number() over(order by p.productid desc) as nid,p.*,sp.saletype from pdproduct p 
	                                inner join pdsalesproduct sp on sp.productid = p.productid
	                                where saletype={0}
                                ) as h
                                where nid>{1} and nid<={2}";

            RecordCount = Convert.ToInt32(dbr.ExecuteScalar(CommandType.Text, String.Format(sqlCount, (int)SalesType)));
            return(dbr.ExecuteDataSet(CommandType.Text, String.Format(sqlData, (int)SalesType, PageLowerBound, PageUpperBount)).Tables[0]);
        }
コード例 #5
0
        public DataTable GetProductList(int PageSize, int PageIndex, SalesProductType SalesType, out int RecordCount)
        {
            int PageLowerBound = 0, PageUpperBount = 0;
            PageLowerBound = (PageIndex - 1) * PageSize;
            PageUpperBount = PageLowerBound + PageSize;

            string sqlCount = "select count(0) from pdproduct p inner join pdsalesproduct sp on sp.productid = p.productid where saletype={0}";
            string sqlData = @" select * from
                                (
                                    select row_number() over(order by p.productid desc) as nid,p.*,sp.saletype from pdproduct p
                                    inner join pdsalesproduct sp on sp.productid = p.productid
                                    where saletype={0}
                                ) as h
                                where nid>{1} and nid<={2}";

            RecordCount = Convert.ToInt32(dbr.ExecuteScalar(CommandType.Text, String.Format(sqlCount, (int)SalesType)));
            return dbr.ExecuteDataSet(CommandType.Text, String.Format(sqlData, (int)SalesType, PageLowerBound, PageUpperBount)).Tables[0];
        }
コード例 #6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ProductID"></param>
 /// <returns></returns>
 public bool Exists(int ProductID,SalesProductType SalesType)
 {
     return dal.Exists(ProductID, (int)SalesType, 0);
 }
コード例 #7
0
 public void DesetSalesProduct(int ProductID, SalesProductType SalesType)
 {
     Delete(ProductID, (int)SalesType, 0);
 }
コード例 #8
0
 public void SetSalesProduct(int ProductID, SalesProductType SalesType)
 {
     if (!Exists(ProductID, (int)SalesType, 0))
     {
         Add(new SalesProductModel()
         {
             ProductId = ProductID,
             SaleType = (int)SalesType,
             SiteId = 0, //from this site
             TimeStamp = DateTime.Now
         });
     }
 }
コード例 #9
0
 public DataTable GetProductList(int PageSize, int PageIndex, SalesProductType SalesType, out int RecordCount)
 {
     return dal.GetProductList(PageSize, PageIndex, SalesType, out RecordCount);
 }
コード例 #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ProductID"></param>
 /// <returns></returns>
 public bool Exists(int ProductID, SalesProductType SalesType)
 {
     return(dal.Exists(ProductID, (int)SalesType, 0));
 }
コード例 #11
0
 public DataTable GetProductList(int PageSize, int PageIndex, SalesProductType SalesType, out int RecordCount)
 {
     return(dal.GetProductList(PageSize, PageIndex, SalesType, out RecordCount));
 }
コード例 #12
0
 public void DesetSalesProduct(int ProductID, SalesProductType SalesType)
 {
     Delete(ProductID, (int)SalesType, 0);
 }