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();
     }
 }
 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();
     }
 }
Exemple #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
         });
     }
 }
        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]);
        }
        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];
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="ProductID"></param>
 /// <returns></returns>
 public bool Exists(int ProductID,SalesProductType SalesType)
 {
     return dal.Exists(ProductID, (int)SalesType, 0);
 }
 public void DesetSalesProduct(int ProductID, SalesProductType SalesType)
 {
     Delete(ProductID, (int)SalesType, 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
         });
     }
 }
 public DataTable GetProductList(int PageSize, int PageIndex, SalesProductType SalesType, out int RecordCount)
 {
     return dal.GetProductList(PageSize, PageIndex, SalesType, out RecordCount);
 }
Exemple #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ProductID"></param>
 /// <returns></returns>
 public bool Exists(int ProductID, SalesProductType SalesType)
 {
     return(dal.Exists(ProductID, (int)SalesType, 0));
 }
Exemple #11
0
 public DataTable GetProductList(int PageSize, int PageIndex, SalesProductType SalesType, out int RecordCount)
 {
     return(dal.GetProductList(PageSize, PageIndex, SalesType, out RecordCount));
 }
Exemple #12
0
 public void DesetSalesProduct(int ProductID, SalesProductType SalesType)
 {
     Delete(ProductID, (int)SalesType, 0);
 }