protected void Page_Load(object sender, EventArgs e)
 {
     if (this.userid > 0)
     {
         if (CheckUserPopedoms("X") || CheckUserPopedoms("7-1-1-6-1"))
         {
             bool ShowMoney  = CheckUserPopedoms("7-1-1-6-2");
             bool xshowMoney = CheckUserPopedoms("X");
             if (ShowMoney || xshowMoney)
             {
                 Show = "1";
             }
             sID   = HTTPRequest.GetInt("sid", 0);  //门店编号
             aID   = HTTPRequest.GetInt("aid", -1); //联营类别
             sDate = DateTime.Parse(HTTPRequest.GetString("sDate"));
             sName = HTTPRequest.GetString("sName");
             pList = ProductsLossInfo.getProductDetailsByStorehouseID(sID, aID, sDate, 1);
         }
         else
         {
             AddErrLine("权限不足!");
         }
     }
     else
     {
         AddErrLine("请先登录!");
         SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
         SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("7-2-1-8"))
                {
                    pName    = HTTPRequest.GetString("pname");
                    pBarcode = HTTPRequest.GetString("pbarcode");
                    pID      = HTTPRequest.GetInt("pid", 0);
                    sID      = HTTPRequest.GetInt("sid", 0);
                    bDate    = (HTTPRequest.GetString("bDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("bDate").Trim()) : DateTime.Now;
                    eDate    = (HTTPRequest.GetString("eDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("eDate").Trim()) : DateTime.Now;

                    sList = ProductsLossInfo.getProducts_Sales_Storehouse(pID, bDate, eDate, sID);
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("7-2-1-5-4-1"))
                {
                    bool ShowMoney  = CheckUserPopedoms("7-2-1-5-4-2");
                    bool xshowMoney = CheckUserPopedoms("X");
                    if (ShowMoney || xshowMoney)
                    {
                        Show = "1";
                    }
                    //绑定仓库信息
                    wList = ProductsLossInfo.getWorehouseName();
                    //获取客户端日期
                    sDate = Utils.IsDateString(Utils.ChkSQL(HTTPRequest.GetString("sDate"))) ? DateTime.Parse(Utils.ChkSQL(HTTPRequest.GetString("sDate"))) : DateTime.Now.AddDays(-(DateTime.Now.Day) + 1);
                    eDate = Utils.IsDateString(Utils.ChkSQL(HTTPRequest.GetString("stDate"))) ? DateTime.Parse(Utils.ChkSQL(HTTPRequest.GetString("stDate"))) : DateTime.Now;
                    //获取客户端select值
                    associated = HTTPRequest.GetInt("_Associated", 0);
                    Act        = HTTPRequest.GetString("Act");
                    if (ispost)
                    {
                        if (ShowMoney || xshowMoney)
                        {
                            Show = "1";
                        }
                    }
                    else
                    {
                        if (Act.IndexOf("act") > -1)
                        {
                            rList = ProductsLossInfo.bindProductsLoss(sDate, eDate, associated, 0, 0);
                            DataTable dt = new DataTable();
                            DataSet   ds = new DataSet();
                            dt = rList.Copy();
                            ds.Tables.Add(dt);
                            ds.Tables[0].Columns[0].ColumnName = "仓库名称";
                            ds.Tables[0].Columns[1].ColumnName = "商品名称";
                            ds.Tables[0].Columns[2].ColumnName = "商品品牌";
                            ds.Tables[0].Columns[3].ColumnName = "商品条码";
                            ds.Tables[0].Columns[4].ColumnName = "装件数";
                            ds.Tables[0].Columns[5].ColumnName = "数量";
                            ds.Tables[0].Columns[6].ColumnName = "金额";

                            CreateExcel(ds.Tables[0], "仓库报损数据_" + DateTime.Now.ToString("yyyy-MM-dd") + ".xls");
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
Пример #4
0
 public DataTable getProducts_Sale_Details_year_annulus(int tpye, string pID, DateTime btime, DateTime etime)
 {
     hpList = ProductsLossInfo.Products_Sale_Details_year_annulus(tpye, Convert.ToInt32(pID), btime, etime); //获得环比日均销量
     if (hpList.Rows.Count > 0)
     {
         return(hpList);
     }
     else
     {
         return(null);
     }
 }
Пример #5
0
 public DataTable getProductsDay_Sales_Details(int tpye, string pID, DateTime btime, DateTime etime)
 {
     tpList = ProductsLossInfo.getProducts_Sales_Details_year_basis(tpye, Convert.ToInt32(pID), btime, etime);//获得同比日均销量
     if (tpList.Rows.Count > 0)
     {
         return(tpList);
     }
     else
     {
         return(null);
     }
 }
 public DataTable Products_sales_storehouse_annulus(int productsID, string storeID, DateTime bDate, DateTime eDate, int tType)
 {
     hList = ProductsLossInfo.Products_sales_storehouse_annulus(productsID, Convert.ToInt32(storeID), bDate, eDate, tType);
     if (hList.Rows.Count > 0)
     {
         return(hList);
     }
     else
     {
         return(null);
     }
 }
 //页面加载过程中获取到产品的详情
 public DataTable getProductsInfoOnLoad(DateTime dtb, DateTime dte, int associated, string sID)
 {
     rList = ProductsLossInfo.bindProductsLoss(Convert.ToDateTime(dtb.ToShortDateString()), Convert.ToDateTime(dte.ToShortDateString()), associated, Convert.ToInt32(sID), 1);
     if (rList.Rows.Count > 0)
     {
         return(rList);
     }
     else
     {
         return(null);
     }
 }
 public int p_count(string sID, int qID)
 {
     sType = HTTPRequest.GetInt("aID", -1);                                                                                            //接收联营类型
     bDate = (HTTPRequest.GetString("bDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("bDate").Trim()) : DateTime.Now; //获得日期
     pList = ProductsLossInfo.getProductDetailsByStorehouseID(Convert.ToInt32(sID), sType, bDate, qID);
     if (pList.Rows.Count > 0)
     {
         return(pList.Rows.Count);
     }
     else
     {
         return(0);
     }
 }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("7-2-1-8"))
                {
                    Act = HTTPRequest.GetString("Act");
                    if (ispost)
                    {
                        tType = HTTPRequest.GetInt("tType", 2);
                        bDate = (HTTPRequest.GetString("bDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("bDate").Trim()) : DateTime.Now;
                        eDate = (HTTPRequest.GetString("eDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("eDate").Trim()) : DateTime.Now;
                        pList = ProductsLossInfo.getProductsDay_Sales_Details(tType, bDate, eDate);         //获得当前日均销量
                    }
                    else
                    {
                        if (Act.IndexOf("act") > -1)
                        {
                            bDate = (HTTPRequest.GetString("bDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("bDate").Trim()) : DateTime.Now;
                            eDate = (HTTPRequest.GetString("eDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("eDate").Trim()) : DateTime.Now;
                            pList = ProductsLossInfo.getProductsDay_Sales_Details(0, bDate, eDate);

                            DataTable dt = pList.Copy();
                            dt.Columns.RemoveAt(0);
                            DataSet ds = new DataSet();
                            ds.Tables.Add(dt);
                            ds.Tables[0].Columns[0].ColumnName = "商品名称";
                            ds.Tables[0].Columns[1].ColumnName = "商品条码";
                            ds.Tables[0].Columns[2].ColumnName = "购销日均销量";
                            ds.Tables[0].Columns[3].ColumnName = "客户日均销量";

                            CreateExcel(ds.Tables[0], "商品日均销量_" + DateTime.Now.ToString("yyyy-MM-dd") + ".xls");
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
Пример #10
0
        public string Show = "";                         //判断权限
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("7-2-1-5-4-1"))
                {
                    bool ShowMoney  = CheckUserPopedoms("7-2-1-5-4-2");
                    bool xshowMoney = CheckUserPopedoms("X");
                    if (ShowMoney || xshowMoney)
                    {
                        Show = "1";
                    }
                    //获取url过来的值
                    storehouseName  = HTTPRequest.GetString("sname");
                    storeId         = HTTPRequest.GetString("sid");
                    productsName    = HTTPRequest.GetString("pname");
                    productsId      = HTTPRequest.GetString("pid");
                    productsBarcode = HTTPRequest.GetString("pbard");
                    Act             = HTTPRequest.GetString("act");
                    bDate           = Convert.ToDateTime(HTTPRequest.GetString("sDate"));
                    eDate           = Convert.ToDateTime(HTTPRequest.GetString("stDate"));
                    sDate           = bDate.ToString("yyyy-MM-dd");
                    tDate           = eDate.ToString("yyyy-MM-dd");

                    if (Act == "act")
                    {
                        pList = ProductsLossInfo.getProductsLossDetails(bDate, eDate, Convert.ToInt32(storeId), Convert.ToInt32(productsId));
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Act = HTTPRequest.GetString("Act");
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("7-1-1-6-1"))
                {
                    bDate = (HTTPRequest.GetString("bDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("bDate").Trim()) : DateTime.Now; //获得日期
                    tType = HTTPRequest.GetInt("tType", 0);                                                                                           //获取统计类型
                    rList = storehouseStorage.RegionName();                                                                                           //获得地区名称
                    //合成统计
                    if (tType == 0)
                    {
                        sList = ProductsLossInfo.getStoresName(bDate);
                        sType = HTTPRequest.GetInt("aID", -1);           //接收联营类型
                    }
                    //分步统计
                    if (tType == 1)
                    {
                        bool ShowMoney  = CheckUserPopedoms("7-1-1-6-2");
                        bool xshowMoney = CheckUserPopedoms("X");
                        if (ShowMoney || xshowMoney)
                        {
                            Show = "1";
                        }
                        sType   = HTTPRequest.GetInt("aID", -1);         //接收联营类型
                        sel_rId = HTTPRequest.GetInt("reginID", 0);      //接收选择的地区ID


                        mList = ProductsLossInfo.getStorehouseProductsDetails(sel_rId, sType, bDate);
                    }
                    //导出联营库存数
                    if (Act.IndexOf("Export") > -1)
                    {
                        bDate = (HTTPRequest.GetString("Date").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("Date").Trim()) : DateTime.Now; //获得日期
                        tType = HTTPRequest.GetInt("tjType", 0);
                        sType = HTTPRequest.GetInt("Associated", 0);

                        if (tType == 0)
                        {
                            dList = ProductsLossInfo.getProductsLossExportData(bDate, bDate, sType);
                            DataTable dt = new DataTable();
                            dt = dList.Copy();
                            dt.Columns.RemoveAt(0);
                            dt.Columns.RemoveAt(0);
                            DataSet ds = new DataSet();
                            ds.Tables.Add(dt);
                            ds.Tables[0].Columns[0].ColumnName = "门店名称";
                            ds.Tables[0].Columns[1].ColumnName = "商品名称";
                            ds.Tables[0].Columns[2].ColumnName = "商品条码";
                            ds.Tables[0].Columns[3].ColumnName = "商品品牌";
                            ds.Tables[0].Columns[4].ColumnName = "库存数量";


                            CreateExcel(ds.Tables[0], "Data_" + bDate + ".xls");
                        }
                        if (tType == 1)
                        {
                            sel_rId = HTTPRequest.GetInt("reginID", 0);      //接收选择的地区ID
                            dList   = ProductsLossInfo.getStorehouseProductsDetails(sel_rId, sType, bDate);
                            DataTable dt = new DataTable();
                            dt = dList.Copy();
                            dt.Columns.RemoveAt(2);
                            dt.Columns.RemoveAt(4);
                            DataSet ds = new DataSet();
                            ds.Tables.Add(dt);
                            ds.Tables[0].Columns[0].ColumnName = "门店名称";
                            ds.Tables[0].Columns[1].ColumnName = "门店类型";
                            ds.Tables[0].Columns[2].ColumnName = "库存数量";
                            ds.Tables[0].Columns[3].ColumnName = "销售金额";
                            ds.Tables[0].Columns[4].ColumnName = "截止日期";


                            CreateExcel(ds.Tables[0], "Data_" + bDate + ".xls");
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
 //返回产品受影响的行集
 public int productsCount(DateTime dtb, DateTime dte, int associated, string sID)
 {
     ccList = ProductsLossInfo.bindProductsLoss(Convert.ToDateTime(dtb.ToShortDateString()), Convert.ToDateTime(dte.ToShortDateString()), associated, Convert.ToInt32(sID), 1);
     return(ccList.Rows.Count);
 }