示例#1
0
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            pagesize    = 20;
            PageBarHTML = "";
            string tSQL = "";

            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("2-2-4"))
                {
                    if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                    {
                        pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                    }
                    else
                    {
                        pageindex = 1;
                    }
                    if (ispost)
                    {
                        Act   = HTTPRequest.GetFormString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                    }
                    else
                    {
                        Act   = HTTPRequest.GetQueryString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
                    }
                    sState = HTTPRequest.GetInt("sState", -1);
                    if (Act.Trim() == "Search" && S_key.Trim() != "")
                    {
                        tSQL = " tbStoresInfo.sName like'%" + S_key + "%' or tbStoresInfo.sCode like '%" + S_key + "%' ";

                        if (sState > -1)
                        {
                            tSQL += " and sState=" + sState + "";
                        }
                    }

                    dList = tbStoresInfo.GetStoresInfoList(pagesize, pageindex, tSQL, out pagetotal, 1, "*,(select yName from tbYHsysInfo where YHsysID=tbStoresInfo.[YHsysID]) as YHsysName,(select pName from tbPaymentSystemInfo where PaymentSystemID=tbStoresInfo.[PaymentSystemID]) as PaymentSystemName");

                    PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act + "&S_key=" + S_key + "&sState=" + sState);
                }
                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)
        {
            pagesize    = 20;
            PageBarHTML = "";

            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("3-1-1-8") || CheckUserPopedoms("3-1-2-8") || CheckUserPopedoms("3-2-1-8") || CheckUserPopedoms("3-2-2-8") || CheckUserPopedoms("3-2-3-8") || CheckUserPopedoms("3-2-4-8") || CheckUserPopedoms("3-2-5-8") || CheckUserPopedoms("3-3-1-8") || CheckUserPopedoms("3-3-2-8") || CheckUserPopedoms("3-3-3-8"))
                {
                    if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                    {
                        pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                    }
                    else
                    {
                        pageindex = 1;
                    }
                    if (ispost)
                    {
                        Act = HTTPRequest.GetFormString("Act");
                    }
                    else
                    {
                        Act = HTTPRequest.GetQueryString("Act");
                    }
                    orderid   = HTTPRequest.GetInt("orderid", 0);
                    ordertype = HTTPRequest.GetInt("ordertype", 0);
                    if (orderid > 0)
                    {
                        oi    = Orders.GetOrderInfoModel(orderid);
                        dList = Orders.GetOrderWorkingLogInfoList(pagesize, pageindex, " OrderID=" + orderid, out pagetotal, 1, "*");

                        PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act);
                    }
                    else
                    {
                        AddErrLine("参数错误!");
                    }
                }
                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)
        {
            pagesize    = 20;
            PageBarHTML = "";
            string tSQL = "";

            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("2-2-2"))
                {
                    if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                    {
                        pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                    }
                    else
                    {
                        pageindex = 1;
                    }
                    if (ispost)
                    {
                        Act   = HTTPRequest.GetFormString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                    }
                    else
                    {
                        Act   = HTTPRequest.GetQueryString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
                    }
                    if (Act.Trim() == "Search" && S_key.Trim() != "")
                    {
                        tSQL = " pName like'%" + S_key + "%' or pBarcode like '%" + S_key + "%' ";
                    }


                    dList = tbProductsInfo.GetProductsInfoList(pagesize, pageindex, tSQL, out pagetotal, 1, "*");

                    PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act + "&S_key=" + S_key);
                }
                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)
 {
     pagesize    = 30;
     PageBarHTML = "";
     if (this.userid > 0)
     {
         if (CheckUserPopedoms("X") || CheckUserPopedoms("8-4-1"))
         {
             string tSQL = "";
             if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
             {
                 pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
             }
             else
             {
                 pageindex = 1;
             }
             if (ispost)
             {
                 Act   = HTTPRequest.GetFormString("Act");
                 S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
             }
             else
             {
                 Act   = HTTPRequest.GetQueryString("Act");
                 S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
             }
             if (M_Config != null)
             {
                 tSQL        = " m_ConfigInfoID = " + M_Config.m_ConfigInfoID;
                 dList       = M_Utils.GetM_MemberList(pagesize, pageindex, tSQL, out pagetotal, 1, "*");
                 PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act + "&S_key=" + S_key);
             }
         }
         else
         {
             AddErrLine("权限不足!");
             AddScript("window.parent.HidBox();");
         }
     }
     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)
        {
            pagesize    = 20;
            PageBarHTML = "";

            if (this.userid > 0)
            {
                if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                {
                    pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                }
                else
                {
                    pageindex = 1;
                }
                if (ispost)
                {
                    Act   = HTTPRequest.GetFormString("Act");
                    S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                }
                else
                {
                    Act   = HTTPRequest.GetQueryString("Act");
                    S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
                }

                ProductID = HTTPRequest.GetInt("ProductID", 0);
                StorageID = HTTPRequest.GetInt("StorageID", 0);
                sDate     = HTTPRequest.GetString("sDate").Trim() != "" ? Convert.ToDateTime(HTTPRequest.GetString("sDate").Trim() + " 23:59:59") : DateTime.Now;
                if (StorageID > 0)
                {
                    si    = tbStorageInfo.GetStorageInfoModel(StorageID);
                    dList = tbProductsInfo.GetProductsStorageInfoByStorageID(0, StorageID, sDate, ProductID);// DataUtils.GetStock_analysis(0, DateTime.Now, ProductID);
                }
                else
                {
                    AddErrLine("请先选择仓库!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
示例#6
0
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            string referer = HTTPRequest.GetQueryString("reurl");

            if (!HTTPRequest.IsPost() || referer != "")
            {
                string r = "";
                if (referer != "")
                {
                    r = referer;
                }
                else
                {
                    if ((HTTPRequest.GetUrlReferrer() == "") || (HTTPRequest.GetUrlReferrer().IndexOf("login") > -1) ||
                        HTTPRequest.GetUrlReferrer().IndexOf("logout") > -1)
                    {
                        r = "Default.aspx";
                    }
                    else
                    {
                        r = HTTPRequest.GetUrlReferrer();
                    }
                }
                Utils.WriteCookie("reurl", (referer == "" || referer.IndexOf("login.aspx") > -1) ? r : referer);
            }


            SetUrl(Utils.UrlDecode(UsersUtils.GetReUrl()));

            SetMetaRefresh();
            SetShowBackLink(false);

            tbUserInfo.UpdateUserOnlineTime(userid, DateTime.Now.ToString());
            OnlineUsers.DeleteRows(olid);
            UsersUtils.ClearUserCookie();
            this.userid = 0;

            AddMsgLine("已经清除了您的登录信息");
        }
        public string className        = ""; //分类名称


        protected virtual void Page_Load(object sender, EventArgs e)
        {
            pagesize    = 20;
            PageBarHTML = "";

            Act = HTTPRequest.GetQueryString("Act");
            if (this.userid > 0)
            {
                //仓库分类树
                StorageClassJson = Caches.GetStorageInfoToJson(-1, false, true);
                Aclass           = HTTPRequest.GetString("aclass");
                if (Aclass.IndexOf("aclass") > -1)
                {
                    string sID   = "";
                    string sCode = "";
                    string sName = "";

                    //获得仓库分类编号
                    StorageClassID = HTTPRequest.GetString("sClassID");
                    //获得仓库名称、编号、系统编号
                    StorageName = tbStockProductInfo.getStorageNameByClass(Convert.ToInt32(StorageClassID));
                    for (int i = 0; i < StorageName.Rows.Count; i++)
                    {
                        if (StorageName.Rows[i]["sState"].ToString() == "0")
                        {
                            sName += StorageName.Rows[i]["sName"].ToString() + "(" + StorageName.Rows[i]["sCode"].ToString() + ")" + ",";
                            sID   += StorageName.Rows[i]["StorageID"].ToString() + ",";
                            sCode += StorageName.Rows[i]["sCode"].ToString() + ",";
                        }
                    }
                    Response.ClearContent();
                    Response.Buffer          = true;
                    Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);
                    Response.Expires         = 0;

                    Response.Write("{sID:'" + sID + "',sCode:'" + sCode + "',sName:'" + sName + "'}");
                    Response.End();
                }

                if (CheckUserPopedoms("X") || CheckUserPopedoms("7-2-1-5-5-1") || CheckUserPopedoms("5-7") || CheckUserPopedoms("5-4"))
                {
                    //StorageList = Caches.GetStorageInfoList("");
                    //StorageName = Utils.ChkSQL(HTTPRequest.GetString("StorageName"));

                    ProductID = HTTPRequest.GetInt("ProductID", 0);
                    StorageID = HTTPRequest.GetInt("StorageID", 0);
                    sDate     = HTTPRequest.GetString("sDate").Trim() != "" ? Convert.ToDateTime(HTTPRequest.GetString("sDate").Trim() + " 23:59:59") : DateTime.Now;


                    if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                    {
                        pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                    }
                    else
                    {
                        pageindex = 1;
                    }
                    if (Act.Trim() != "")
                    {
                        className      = HTTPRequest.GetString("StorageClassName").Trim();
                        StorageClassID = HTTPRequest.GetString("StorageClassNum");
                        //if (StorageClassID == "")
                        //{
                        //    AddMsgLine("请选择仓库类别后再进行查询!");
                        //}
                        //else
                        //{
                        StorageName = tbStockProductInfo.getStorageNameByClass(Utils.StrToInt(StorageClassID, 0));
                        if (StorageID == 0)
                        {
                            dList = tbProductsInfo.GetProductsStorageInfoByStorageID(Utils.StrToInt(StorageClassID, 0), StorageID, sDate, ProductID);
                        }
                        else
                        {
                            dList = tbProductsInfo.GetProductsStorageInfoByStorageID(0, StorageID, sDate, ProductID);    // DataUtils.GetStock_analysis(0, DateTime.Now, ProductID);
                        }
                        //}
                    }
                    if (ispost)
                    {
                        Act   = HTTPRequest.GetFormString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                    }
                    else
                    {
                        S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));

                        //导出
                        if (Act.IndexOf("Export") > -1)
                        {
                            DataTable dt = dList.Copy();
                            if (dt.Rows.Count > 0)
                            {
                                for (int j = 0; j < dt.Rows.Count; j++)
                                {
                                    dt.Rows[j]["pStorage"] = (Convert.ToDecimal(dt.Rows[j]["pStorage"].ToString()) + Convert.ToDecimal(dt.Rows[j]["pStorageIn"].ToString()) - Convert.ToDecimal(dt.Rows[j]["pStorageOut"].ToString()) + Convert.ToDecimal(dt.Rows[j]["Beginning"].ToString())).ToString();
                                }
                                dt.AcceptChanges();

                                dt.Columns.RemoveAt(0);
                                dt.Columns.RemoveAt(0);
                                dt.Columns.RemoveAt(6);
                                dt.Columns.RemoveAt(6);
                                dt.Columns.RemoveAt(6);
                                dt.Columns.RemoveAt(7);
                                DataSet dset = new DataSet();
                                dt.Columns["sName"].SetOrdinal(0);
                                dset.Tables.Add(dt);
                                dset.Tables[0].Columns[0].ColumnName = "仓库名称";
                                dset.Tables[0].Columns[1].ColumnName = "商品条码";
                                dset.Tables[0].Columns[2].ColumnName = "商品名称";
                                dset.Tables[0].Columns[3].ColumnName = "默认售价";
                                dset.Tables[0].Columns[4].ColumnName = "库存数量";
                                dset.Tables[0].Columns[5].ColumnName = "入库未核销";
                                dset.Tables[0].Columns[6].ColumnName = "出库未核销";
                                dset.Tables[0].Columns[7].ColumnName = "不可用库存";



                                CreateExcel(dset.Tables[0], "Data_" + sDate.ToShortDateString() + ".xls");
                            }
                            else
                            {
                                AddErrLine("请选择仓库类别后再进行查询!");
                            }
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
        public string className = "";      //分类名称

        protected virtual void Page_Load(object sender, EventArgs e)
        {
            Act = HTTPRequest.GetQueryString("Act");
            if (this.userid > 0)
            {
                //仓库分类树
                StorageClassJson = Caches.GetStorageInfoToJson(-1, false, true);
                Aclass           = HTTPRequest.GetString("aclass");
                if (Aclass.IndexOf("aclass") > -1)
                {
                    string sID   = "";
                    string sCode = "";
                    string sName = "";
                    //获得仓库分类编号
                    StorageClassID = HTTPRequest.GetInt("sClassID", 0);
                    //获得仓库名称、编号、系统编号
                    StorageName = tbStockProductInfo.getStorageNameByClass(StorageClassID);
                    for (int i = 0; i < StorageName.Rows.Count; i++)
                    {
                        if (StorageName.Rows[i]["sState"].ToString() == "0")
                        {
                            sName += StorageName.Rows[i]["sName"].ToString() + "(" + StorageName.Rows[i]["sCode"].ToString() + ")" + ",";
                            sID   += StorageName.Rows[i]["StorageID"].ToString() + ",";
                            sCode += StorageName.Rows[i]["sCode"].ToString() + ",";
                        }
                    }
                    Response.ClearContent();
                    Response.Buffer          = true;
                    Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);
                    Response.Expires         = 0;

                    Response.Write("{sID:'" + sID + "',sCode:'" + sCode + "',sName:'" + sName + "'}");
                    Response.End();
                }

                if (CheckUserPopedoms("X") || CheckUserPopedoms("7-2-1-5-5") || CheckUserPopedoms("5-7") || CheckUserPopedoms("5-4"))
                {
                    S_key          = HTTPRequest.GetString("S_key");
                    className      = HTTPRequest.GetString("StorageClassName");
                    ProductID      = HTTPRequest.GetInt("ProductID", 0);
                    StorageID      = HTTPRequest.GetInt("StorageID", 0);
                    StorageClassID = HTTPRequest.GetInt("StorageClassNum", 0);
                    bDate          = HTTPRequest.GetString("bDate").Trim() != "" ? Convert.ToDateTime(HTTPRequest.GetString("bDate").Trim() + " 00:00:00") : DateTime.Now.AddDays(-DateTime.Now.Day + 1);
                    eDate          = HTTPRequest.GetString("eDate").Trim() != "" ? Convert.ToDateTime(HTTPRequest.GetString("eDate").Trim() + " 23:59:59") : DateTime.Now;

                    if (StorageClassID > 0)
                    {
                        StorageName = tbStockProductInfo.getStorageNameByClass(Convert.ToInt32(StorageClassID));
                    }
                    //json表格
                    if (Act == "data")
                    {
                        DataSet ds = tbStorageProductLogInfo.GetStorageList(StorageClassID, StorageID, ProductID, bDate, eDate);
                        if (ds != null)
                        {
                            bList = ds.Tables [0];
                            dList = ds.Tables [1];
                            pList = ds.Tables [2];
                            sList = ds.Tables [3];
                        }

                        string bListJson = "";                        // Utils.DataTableToJSON (bList).ToString().TrimEnd(";".ToCharArray());
                        string dListJson = "";                        // Utils.DataTableToJSON (dList).ToString().TrimEnd(";".ToCharArray());
                        string pListJson = "";                        // Utils.DataTableToJSON (pList).ToString().TrimEnd(";".ToCharArray());
                        string sListJson = "";                        // Utils.DataTableToJSON (sList).ToString().TrimEnd(";".ToCharArray());

                        if (bList != null)
                        {
                            foreach (DataRow dr_bL in bList.Rows)
                            {
                                bListJson += "{\"storageid\":" + dr_bL["storageid"].ToString() + "," +
                                             "\"quantity\":" + dr_bL["quantity"].ToString() + "," +
                                             "\"productsid\":" + dr_bL["productsid"].ToString() + "," +
                                             "\"pbarcode\":\"" + dr_bL["pbarcode"].ToString() + "\"" + "," +
                                             "\"pname\":\"" + dr_bL["pname"].ToString() + "\"" + "," +
                                             "\"punits\":\"" + dr_bL["punits"].ToString() + "\"" + "," +
                                             "\"pmaxunits\":\"" + dr_bL["pmaxunits"].ToString() + "\"" + "," +
                                             "\"ptoboxno\":" + dr_bL["ptoboxno"].ToString() +
                                             "},";
                            }
                        }

                        if (dList != null)
                        {
                            foreach (DataRow dr_dL in dList.Rows)
                            {
                                dListJson += "{\"StaffID\":" + dr_dL["StaffID"].ToString() + "," +
                                             "\"splremake\":\"" + dr_dL["splremake"].ToString() + "\"," +
                                             "\"splappendtime\":\"" + dr_dL["splappendtime"].ToString() + "\"," +
                                             "\"orderlistid\":" + dr_dL["orderlistid"].ToString() + "," +
                                             "\"storageid\":" + dr_dL["storageid"].ToString() + "," +
                                             "\"productsid\":" + dr_dL["productsid"].ToString() + "," +
                                             "\"quantity\":" + dr_dL["quantity"].ToString() + "," +
                                             "\"orderid\":\"" + dr_dL["orderid"].ToString() + "\"," +
                                             "\"oordernum\":\"" + dr_dL["oordernum"].ToString() + "\"," +
                                             "\"otype\":\"" + dr_dL["otype"].ToString() + "\"," +
                                             "\"oappendtime\":\"" + dr_dL["oappendtime"].ToString() + "\"," +
                                             "\"oorderdatetime\":\"" + dr_dL["oorderdatetime"].ToString() + "\"," +
                                             "\"ostate\":\"" + dr_dL["ostate"].ToString() + "\"," +
                                             "\"osteps\":\"" + dr_dL["osteps"].ToString() + "\"," +
                                             "\"storesid\":\"" + dr_dL["storesid"].ToString() + "\"," +
                                             "\"ocustomersname\":\"" + dr_dL["ocustomersname"].ToString() + "\"," +
                                             "\"StoresSupplierName\":\"" + dr_dL["StoresSupplierName"].ToString() + "\"" +
                                             "},";
                            }
                        }

                        if (pList != null)
                        {
                            foreach (DataRow dr_pL in pList.Rows)
                            {
                                pListJson += "{\"ProductsID\":" + dr_pL["ProductsID"].ToString() + "," +
                                             "\"productclassid\":" + dr_pL["productclassid"].ToString() + "," +
                                             "\"pcode\":\"" + dr_pL["pcode"].ToString() + "\"," +
                                             "\"pbarcode\":\"" + dr_pL["pbarcode"].ToString() + "\"," +
                                             "\"pname\":\"" + dr_pL["pname"].ToString() + "\"," +
                                             "\"pbrand\":\"" + dr_pL["pbrand"].ToString() + "\"," +
                                             "\"pstandard\":\"" + dr_pL["pstandard"].ToString() + "\"," +
                                             "\"punits\":\"" + dr_pL["punits"].ToString() + "\"," +
                                             "\"pmaxunits\":\"" + dr_pL["pmaxunits"].ToString() + "\"," +
                                             "\"ptoboxno\":" + dr_pL["ptoboxno"].ToString() + "," +
                                             "\"pstate\":" + dr_pL["pstate"].ToString() +
                                             "},";
                            }
                        }

                        if (sList != null)
                        {
                            foreach (DataRow dr_sL in sList.Rows)
                            {
                                sListJson += "{\"storageid\":" + dr_sL["storageid"].ToString() + "," +
                                             "\"scode\":\"" + dr_sL["scode"].ToString() + "\"," +
                                             "\"sname\":\"" + dr_sL["sname"].ToString() + "\"," +
                                             "\"smanager\":\"" + dr_sL["smanager"].ToString() + "\"," +
                                             "\"stel\":\"" + dr_sL["stel"].ToString() + "\"," +
                                             "\"storageclassid\":" + dr_sL["storageclassid"].ToString() + "," +
                                             "\"sstate\":" + dr_sL["sstate"].ToString() +
                                             "},";
                            }
                        }

                        string Json_Str = "{\"bList\":[" + bListJson.TrimEnd(",".ToCharArray()) + "]," +
                                          "\"dList\":[" + dListJson.TrimEnd(",".ToCharArray()) + "]," +
                                          "\"pList\":[" + pListJson.TrimEnd(",".ToCharArray()) + "]," +
                                          "\"sList\":[" + sListJson.TrimEnd(",".ToCharArray()) + "]}";

                        Response.ClearContent();
                        Response.Buffer          = true;
                        Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);

                        Response.Expires = 0;

                        Response.Charset         = "utf-8";
                        Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
                        Response.ContentType     = "application/json";
                        if (Json_Str.Trim() == "")
                        {
                            Json_Str = "{\"results\": []}";
                        }
                        else
                        {
                            Json_Str = "{\"results\": " + Json_Str + "}";
                        }
                        Response.Write(Json_Str);
                        Response.End();
                    }

                    //导出
                    if (Act == "exp")
                    {
                        DataSet ds = tbStorageProductLogInfo.GetStorageList(StorageClassID, StorageID, ProductID, bDate, eDate);
                        if (ds != null)
                        {
                            bList = ds.Tables [0];
                            dList = ds.Tables [1];
                            pList = ds.Tables [2];
                            sList = ds.Tables [3];

                            DataTable _t = new DataTable();
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
示例#9
0
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            pagesize    = 20;
            PageBarHTML = "";
            string tSQL = " 1=1 ";

            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("4-1"))
                {
                    if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                    {
                        pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                    }
                    else
                    {
                        pageindex = 1;
                    }
                    if (ispost)
                    {
                        Act   = HTTPRequest.GetFormString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                    }
                    else
                    {
                        Act   = HTTPRequest.GetQueryString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
                    }
                    sType  = HTTPRequest.GetInt("sType", -1);
                    sState = HTTPRequest.GetInt("sState", -1);

                    DepartmentsClassID = HTTPRequest.GetInt("DepartmentsClassID", 0);
                    if (sType > -1)
                    {
                        tSQL += " and sType=" + sType + " ";
                    }
                    if (sState > -1)
                    {
                        tSQL += " and sState=" + sState + " ";
                    }
                    if (DepartmentsClassID > 0)
                    {
                        Departments = DataClass.GetDepartmentsClassInfoModel(DepartmentsClassID);
                        string DepartmentsClassIDStr = DataClass.GetDepartmentsClassChildStr(DepartmentsClassID);
                        DepartmentsClassIDStr = DepartmentsClassIDStr.Trim() != "" ? DepartmentsClassIDStr + "," + DepartmentsClassID.ToString() : DepartmentsClassID.ToString();
                        tSQL += " and DepartmentsClassID in(" + DepartmentsClassIDStr + ")";
                    }
                    if (Act.Trim() == "Search" && S_key.Trim() != "")
                    {
                        tSQL += " and sName like '%" + S_key.Trim() + "%' ";
                    }
                    dList       = tbStaffInfo.GetStaffInfoList(pagesize, pageindex, tSQL, out pagetotal, 1, "*");
                    PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act + "&S_key=" + S_key + "&sType=" + sType + "&sState=" + sState + "&DepartmentsClassID=" + DepartmentsClassID);
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
示例#10
0
        public bool ShowProductCostPrice = false; //是否显示成本

        protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X"))
                {
                    Act = HTTPRequest.GetString("Act");

                    //邮件校验码
                    if (HTTPRequest.GetString("rCode") != "")
                    {
                        Session ["r_Code"] = HTTPRequest.GetString("rCode");
                    }

                    string _rCode = Session["r_Code"] != null?Convert.ToString(Session["r_Code"]) : "";                 //邮件获取

                    string s_rCode = Session["s_r_Code"] != null?Convert.ToString(Session["s_r_Code"]) : "";            //本地校验


                    if (_rCode == "" || _rCode != s_rCode)
                    {
                        string s_r_Code = s_rCode.Trim() != ""?s_rCode: MakeCode(6);                       //生成6位验证码

                        if (Act == "SendCode")
                        {
                            Session ["s_r_Code"] = s_r_Code;
                            UsersUtils.SendMailToEmail(config.ProductCostPriceCodeMail, "商品成本维护校验码", "请在10分钟内输入商品成本维护校验码:<b>" + s_r_Code + "</b>");
                            Response.ClearContent();
                            Response.Buffer          = true;
                            Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);
                            Response.Expires         = 0;

                            Response.Write("{state:true,msg:\"OK!\"}");
                            Response.End();
                        }

                        if (Act.Trim() == "UpdatePrice")
                        {
                            Response.ClearContent();
                            Response.Buffer          = true;
                            Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);
                            Response.Expires         = 0;

                            Response.Write("{state:false,msg:\"No Code!\"}");
                            Response.End();
                        }
                        else
                        {
                            ShowRCodeInput(s_r_Code);
                        }                        //AddErrLine ("请输入授权码!");
                    }
                    else
                    {
                        //仓库分类树
                        StorageClassJson = Caches.GetStorageInfoToJson(-1, false, true);
                        Aclass           = HTTPRequest.GetString("aclass");
                        if (Aclass.IndexOf("aclass") > -1)
                        {
                            string sID   = "";
                            string sCode = "";
                            string sName = "";

                            //获得仓库分类编号
                            StorageClassID = HTTPRequest.GetString("sClassID");
                            //获得仓库名称、编号、系统编号
                            StorageName = tbStockProductInfo.getStorageNameByClass(Convert.ToInt32(StorageClassID));
                            for (int i = 0; i < StorageName.Rows.Count; i++)
                            {
                                if (StorageName.Rows [i] ["sState"].ToString() == "0")
                                {
                                    sName += StorageName.Rows [i] ["sName"].ToString() + "(" + StorageName.Rows [i] ["sCode"].ToString() + ")" + ",";
                                    sID   += StorageName.Rows [i] ["StorageID"].ToString() + ",";
                                    sCode += StorageName.Rows [i] ["sCode"].ToString() + ",";
                                }
                            }
                            Response.ClearContent();
                            Response.Buffer          = true;
                            Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);
                            Response.Expires         = 0;

                            Response.Write("{sID:'" + sID + "',sCode:'" + sCode + "',sName:'" + sName + "'}");
                            Response.End();
                        }

                        StorageID = HTTPRequest.GetInt("StorageID", 0);
                        sDate     = HTTPRequest.GetString("sDate").Trim() != "" ? Convert.ToDateTime(HTTPRequest.GetString("sDate").Trim() + " 23:59:59") : DateTime.Now;

                        //显示列表
                        if (Act.Trim() != "")
                        {
                            className      = HTTPRequest.GetString("StorageClassName").Trim();
                            StorageClassID = HTTPRequest.GetString("StorageClassNum");
                            if (StorageClassID == "")
                            {
                                AddMsgLine("请选择仓库类别后再进行查询!");
                            }
                            else
                            {
                                priceList   = tbProductPriceNOAuto.GetProductPriceNOAutoListNew("").Tables [0];
                                StorageName = tbStockProductInfo.getStorageNameByClass(Convert.ToInt32(StorageClassID));
                                if (StorageID == 0)
                                {
                                    dList = tbProductsInfo.GetProductsStorageInfoByStorageID(Convert.ToInt32(StorageClassID), StorageID, sDate, ProductID);
                                }
                                else
                                {
                                    dList = tbProductsInfo.GetProductsStorageInfoByStorageID(0, StorageID, sDate, ProductID);                                     // DataUtils.GetStock_analysis(0, DateTime.Now, ProductID);
                                }

                                if (dList.Rows.Count > 0)
                                {
                                    DataColumn dc = dList.Columns.Add("pPrice", Type.GetType("System.Decimal"));
                                    dc.DefaultValue = 0;
                                    DataColumn dc2 = dList.Columns.Add("pPriceRMB", Type.GetType("System.Decimal"));
                                    dc2.DefaultValue = 0;
                                    for (int k = 0; k < priceList.Rows.Count; k++)
                                    {
                                        for (int j = 0; j < dList.Rows.Count; j++)
                                        {
                                            if (dList.Rows [j] ["ProductsID"].ToString() == priceList.Rows [k] ["ProductsID"].ToString())
                                            {
                                                dList.Rows [j] ["pPrice"]    = Convert.ToDecimal(priceList.Rows [k] ["Price"]);
                                                dList.Rows [j] ["pPriceRMB"] = Convert.ToDecimal(priceList.Rows [k] ["PriceRMB"]);
                                            }
                                        }
                                    }
                                    dList.AcceptChanges();
                                }
                            }
                        }

                        //更新成本
                        if (Act == "UpdatePrice")
                        {
                            ProductID = HTTPRequest.GetInt("ProductID", 0);
                            Price     = Convert.ToDecimal(HTTPRequest.GetFloat("Price", 0));
                            PriceRMB  = Convert.ToDecimal(HTTPRequest.GetFloat("PriceRMB", 0));

                            if (ProductID > 0)
                            {
                                ProductPriceNOAutoInfo pp = new ProductPriceNOAutoInfo();
                                pp.ProductsID   = ProductID;
                                pp.Price        = Price;
                                pp.PriceRMB     = PriceRMB;
                                pp.ppAppendTime = DateTime.Now;

                                if (tbProductPriceNOAuto.AddProductPriceNOAuto(pp) > 0)
                                {
                                    Response.ClearContent();
                                    Response.Buffer          = true;
                                    Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);
                                    Response.Expires         = 0;

                                    Response.Write("{state:true,ProductsID:" + ProductID + ",Price:" + Price + "}");
                                    Response.End();
                                }
                            }
                        }

                        if (ispost)
                        {
                            Act   = HTTPRequest.GetFormString("Act");
                            S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                        }
                        else
                        {
                            S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));

                            //导出
                            if (Act.IndexOf("Export") > -1)
                            {
                                DataTable dt = dList.Copy();
                                if (dt.Rows.Count > 0)
                                {
                                    for (int j = 0; j < dt.Rows.Count; j++)
                                    {
                                        dt.Rows[j]["pStorage"] = (Convert.ToDecimal(dt.Rows[j]["pStorage"].ToString()) + Convert.ToDecimal(dt.Rows[j]["pStorageIn"].ToString()) - Convert.ToDecimal(dt.Rows[j]["pStorageOut"].ToString()) + Convert.ToDecimal(dt.Rows[j]["Beginning"].ToString())).ToString();
                                    }
                                    dt.AcceptChanges();

                                    dt.Columns.RemoveAt(0);
                                    dt.Columns.RemoveAt(0);
                                    dt.Columns.RemoveAt(6);
                                    dt.Columns.RemoveAt(6);
                                    dt.Columns.RemoveAt(6);
                                    dt.Columns.RemoveAt(7);
                                    DataSet dset = new DataSet();
                                    dt.Columns["sName"].SetOrdinal(0);
                                    dset.Tables.Add(dt);
                                    dset.Tables[0].Columns[0].ColumnName = "仓库名称";
                                    dset.Tables[0].Columns[1].ColumnName = "商品条码";
                                    dset.Tables[0].Columns[2].ColumnName = "商品名称";
                                    dset.Tables[0].Columns[3].ColumnName = "默认售价";
                                    dset.Tables[0].Columns[4].ColumnName = "库存数量";
                                    dset.Tables[0].Columns[5].ColumnName = "入库未核销";
                                    dset.Tables[0].Columns[6].ColumnName = "出库未核销";
                                    dset.Tables[0].Columns[7].ColumnName = "不可用库存";
                                    dset.Tables[0].Columns[8].ColumnName = "成本(€)";
                                    dset.Tables[0].Columns[9].ColumnName = "成本(¥)";



                                    CreateExcel(dset.Tables[0], "Data_" + sDate.ToShortDateString() + ".xls");
                                }
                                else
                                {
                                    AddErrLine("请选择仓库类别后再进行查询!");
                                }
                            }
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
        public decimal SUMMoney = 0;          //合计总金额
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            pagesize    = 30;
            PageBarHTML = "";
            string tSQL = "";

            if (this.userid > 0)
            {
                if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                {
                    pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                }
                else
                {
                    pageindex = 1;
                }
                if (ispost)
                {
                    Act          = HTTPRequest.GetFormString("Act");
                    S_key        = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                    AllOrderList = HTTPRequest.GetFormString("AllOrderList");
                }
                else
                {
                    Act          = HTTPRequest.GetQueryString("Act");
                    S_key        = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
                    AllOrderList = HTTPRequest.GetQueryString("AllOrderList");
                }
                ordertype    = HTTPRequest.GetInt("ordertype", 0);
                ordertypeStr = Utils.ChkSQL(HTTPRequest.GetString("ordertypeStr"));
                string _otypestr = "0";

                switch (ordertype)
                {
                case 1:    //采购入库=1
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-1-1-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|1|") > -1)
                            {
                                _otypestr += ",1";
                            }
                        }
                        else
                        {
                            _otypestr += ",1";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 采购入库单 列表!");
                    }
                    break;

                case 2:    //采购退货=2
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-1-2-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|2|") > -1)
                            {
                                _otypestr += ",2";
                            }
                        }
                        else
                        {
                            _otypestr += ",2";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 采购退货单 列表!");
                    }
                    break;

                case 3:    //销售发货=3
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-1-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|3|") > -1)
                            {
                                _otypestr += ",3";
                            }
                        }
                        else
                        {
                            _otypestr += ",3";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 销售发货单 列表!");
                    }
                    break;

                case 4:    //销售退货=4
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-2-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|4|") > -1)
                            {
                                _otypestr += ",4";
                            }
                        }
                        else
                        {
                            _otypestr += ",4";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 销售退货单 列表!");
                    }
                    break;

                case 5:    //赠品=5
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-3-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|5|") > -1)
                            {
                                _otypestr += ",5";
                            }
                        }
                        else
                        {
                            _otypestr += ",5";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 赠品单 列表!");
                    }
                    break;

                case 6:    //样品=6
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-4-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|6|") > -1)
                            {
                                _otypestr += ",6";
                            }
                        }
                        else
                        {
                            _otypestr += ",6";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 样品单 列表!");
                    }
                    break;

                case 7:    //代购=7
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-5-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|7|") > -1)
                            {
                                _otypestr += ",7";
                            }
                        }
                        else
                        {
                            _otypestr += ",7";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 代购单 列表!");
                    }
                    break;

                case 8:    //库存调整=8
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-2-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|8|") > -1)
                            {
                                _otypestr += ",8";
                            }
                        }
                        else
                        {
                            _otypestr += ",8";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 库存调整单 列表!");
                    }
                    break;

                case 9:    //库存调拨=9
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-1-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|9|") > -1)
                            {
                                _otypestr += ",9";
                            }
                        }
                        else
                        {
                            _otypestr += ",9";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 库存调拨单 列表!");
                    }
                    break;

                case 10:    //坏货=10
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-3-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|10|") > -1)
                            {
                                _otypestr += ",10";
                            }
                        }
                        else
                        {
                            _otypestr += ",10";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 坏货单 列表!");
                    }
                    break;

                case 11:    //换货=11
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-6-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|11|") > -1)
                            {
                                _otypestr += ",11";
                            }
                        }
                        else
                        {
                            _otypestr += ",11";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 坏货单 列表!");
                    }
                    break;

                default:
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-1-1-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|1|") > -1)
                            {
                                _otypestr += ",1";
                            }
                        }
                        else
                        {
                            _otypestr += ",1";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-1-2-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|2|") > -1)
                            {
                                _otypestr += ",2";
                            }
                        }
                        else
                        {
                            _otypestr += ",2";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-1-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|3|") > -1)
                            {
                                _otypestr += ",3";
                            }
                        }
                        else
                        {
                            _otypestr += ",3";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-2-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|4|") > -1)
                            {
                                _otypestr += ",4";
                            }
                        }
                        else
                        {
                            _otypestr += ",4";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-3-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|5|") > -1)
                            {
                                _otypestr += ",5";
                            }
                        }
                        else
                        {
                            _otypestr += ",5";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-4-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|6|") > -1)
                            {
                                _otypestr += ",6";
                            }
                        }
                        else
                        {
                            _otypestr += ",6";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-5-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|7|") > -1)
                            {
                                _otypestr += ",7";
                            }
                        }
                        else
                        {
                            _otypestr += ",7";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-1-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|8|") > -1)
                            {
                                _otypestr += ",8";
                            }
                        }
                        else
                        {
                            _otypestr += ",8";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-2-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|9|") > -1)
                            {
                                _otypestr += ",9";
                            }
                        }
                        else
                        {
                            _otypestr += ",9";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-3-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|10|") > -1)
                            {
                                _otypestr += ",10";
                            }
                        }
                        else
                        {
                            _otypestr += ",10";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-2-6-8"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|11|") > -1)
                            {
                                _otypestr += ",11";
                            }
                        }
                        else
                        {
                            _otypestr += ",11";
                        }
                    }
                    break;
                }
                tSQL             = " tbOrderInfo.oType in(" + _otypestr + ") ";
                StoresSupplierID = HTTPRequest.GetInt("StoresSupplierID", 0);
                if (StoresSupplierID > 0)
                {
                    tSQL += " and tbOrderInfo.StoresID=" + StoresSupplierID;
                }
                StoresSupplier = Utils.ChkSQL(HTTPRequest.GetString("StoresSupplier"));

                StorageID = HTTPRequest.GetInt("StorageID", 0);
                if (StorageID > 0)
                {
                    tSQL += " and tbOrderInfo.OrderID in(select siol.OrderID from tbOrderListInfo siol where siol.StorageID=" + StorageID + " ) ";
                }
                StorageName = Utils.ChkSQL(HTTPRequest.GetString("StorageName"));

                oOrderNum = Utils.ChkSQL(HTTPRequest.GetString("oOrderNum"));
                if (oOrderNum.Trim() != "")
                {
                    tSQL += " and tbOrderInfo.oOrderNum like '%" + oOrderNum + "%'";
                }
                StaffID = HTTPRequest.GetInt("StaffID", 0);
                if (StaffID > 0)
                {
                    tSQL += " and tbOrderInfo.StaffID=" + StaffID;
                }
                StaffName = Utils.ChkSQL(HTTPRequest.GetString("StaffName"));

                UserID = HTTPRequest.GetInt("UserID", 0);
                if (UserID > 0)
                {
                    tSQL += " and tbOrderInfo.UserID=" + UserID;
                }
                UserName = Utils.ChkSQL(HTTPRequest.GetString("User"));

                oCustomersOrderID = Utils.ChkSQL(HTTPRequest.GetString("oCustomersOrderID"));
                if (oCustomersOrderID.Trim() != "")
                {
                    tSQL += " and tbOrderInfo.oCustomersOrderID like '%" + oCustomersOrderID + "%'";
                }


                ProductsName = Utils.ChkSQL(HTTPRequest.GetString("ProductsName"));
                ProductsID   = HTTPRequest.GetInt("ProductsID", 0);
                if (ProductsID > 0)
                {
                    tSQL += " and tbOrderInfo.OrderID in(select pol.OrderID from tbOrderListInfo pol where pol.ProductsID=" + ProductsID + " ) ";
                }
                //按操作类型查询

                dDateTimeB = Utils.ChkSQL(HTTPRequest.GetString("dDateTimeB"));
                dDateTimeE = Utils.ChkSQL(HTTPRequest.GetString("dDateTimeE"));

                dDateTimeB = dDateTimeB.Trim() == "" ? DateTime.Now.Year + "-1-1" : dDateTimeB.Trim();

                //步骤
                oSteps  = HTTPRequest.GetInt("oSteps", -1);
                sType   = HTTPRequest.GetInt("sType", 1);
                dType   = -2;
                dType_b = -2;

                if (sType == 1)
                {
                    oOrderDateTimeB = Utils.ChkSQL(HTTPRequest.GetString("oOrderDateTimeB"));
                    if (oOrderDateTimeB.Trim() == "")
                    {
                        if (ordertype != 0)
                        {
                            oOrderDateTimeB = DateTime.Now.Year + "-1-1";
                        }
                    }
                    if (oOrderDateTimeB.Trim() != "" && Utils.IsDateString(oOrderDateTimeB.Trim()))
                    {
                        tSQL += " and tbOrderInfo.oOrderDateTime>='" + Convert.ToDateTime(oOrderDateTimeB.Trim()).ToString("yyyy-MM-dd") + " 00:00:00 '";
                    }
                    oOrderDateTimeE = Utils.ChkSQL(HTTPRequest.GetString("oOrderDateTimeE"));
                    if (oOrderDateTimeE.Trim() != "" && Utils.IsDateString(oOrderDateTimeE.Trim()))
                    {
                        tSQL += " and tbOrderInfo.oOrderDateTime<='" + Convert.ToDateTime(oOrderDateTimeE.Trim()).ToString("yyyy-MM-dd") + " 23:59:59 '";
                    }
                }

                if (oSteps > -1)
                {
                    if (sType == 1)
                    {
                        tSQL += " and tbOrderInfo.oSteps=" + oSteps;
                    }
                    if (sType == 2)
                    {
                        dType_b = -2;
                        switch (oSteps)
                        {
                        case 1:        //开单
                            dType = 0; //新开单
                            break;

                        case 2:        //审核
                            dType = 2; //新单已审核
                            break;

                        case 3:        //发货
                            dType = 3; //已发货
                            break;

                        case 4:        //收货
                            dType = 4; //已收货
                            break;

                        case 5:        //验收核销
                            dType = 5; //已验收确认(已核销)
                            break;

                        case 6:    //对账中
                            dType = 11;
                            break;

                        case 7:    //已对账
                            dType = 12;
                            break;

                        case 8:    //已收款
                            dType = 13;
                            break;

                        case 9:    //已结账
                            dType = 14;
                            break;
                        }
                    }
                }
                else if (oSteps == -2)//查看非全额收货单据,oSteps=-2
                {
                    NextID = HTTPRequest.GetInt("NextID", -1);
                    if (NextID == 0)
                    {
                        tSQL += " and tbOrderInfo.OrderID in(select OrderID from tbOrderNOFullInfo where oNextOrderID=0 )   ";
                    }
                    else
                    {
                        tSQL += " and tbOrderInfo.OrderID in(select ooool.OrderID from ( " +
                                "select oool.ProductsID,oool.OrderID,SUM(oool.oQuantity) as oQuantity,SUM(oool.oldQuantity) as oldQuantity from ( " +
                                "select  osl.ProductsID,osl.OrderListID, osl.OrderID,osl.oQuantity,oosl.oQuantity as oldQuantity from  " +
                                "(select ol.ProductsID,ol.OrderListID,ol.OrderID, ol.oQuantity,ol.StorageID from tbOrderListInfo as ol where ol.oWorkType<>0) as osl left join " +
                                "(select ool.oQuantity,ool.ProductsID,ool.StorageID,ool.OrderID from tbOrderListInfo as ool where ool.oWorkType=0) as oosl on osl.ProductsID = oosl.ProductsID and osl.OrderID=oosl.OrderID and osl.StorageID=oosl.StorageID " +
                                ") as oool " +
                                "group by oool.ProductsID,oool.OrderID " +
                                ") as ooool where ooool.oQuantity<>ooool.oldQuantity and ooool.OrderID in(select o.OrderID from tbOrderInfo as o where o.oSteps not in(1,2,3) and o.OrderID not in(select OrderID from tbOrderNOFullInfo where oState=0) and o.oType in(1,2,3,4,5,6,7,10)) )   ";
                    }
                }

                //仅选择了开始
                if (dType > -2 && dType_b == -2)
                {
                    if (dDateTimeB.Trim() != "" && dDateTimeE.Trim() == "")
                    {
                        tSQL += " and tbOrderInfo.OrderID in(select OrderID from tbOrderWorkingLogInfo where oType=" + dType + " and pAppendTime>='" + Convert.ToDateTime(dDateTimeB.Trim()).ToString("yyyy-MM-dd") + " 00:00:00') ";
                    }
                    if (dDateTimeE.Trim() != "" && dDateTimeB.Trim() == "")
                    {
                        tSQL += " and tbOrderInfo.OrderID in(select OrderID from tbOrderWorkingLogInfo where oType=" + dType + " and pAppendTime<='" + Convert.ToDateTime(dDateTimeE.Trim()).ToString("yyyy-MM-dd") + " 23:59:59') ";
                    }
                    if (dDateTimeE.Trim() != "" && dDateTimeB.Trim() != "")
                    {
                        tSQL += " and tbOrderInfo.OrderID in(select OrderID from tbOrderWorkingLogInfo where oType=" + dType + " and pAppendTime between '" + Convert.ToDateTime(dDateTimeB.Trim()).ToString("yyyy-MM-dd") + " 00:00:00' and '" + Convert.ToDateTime(dDateTimeE.Trim()).ToString("yyyy-MM-dd") + " 23:59:59') ";
                    }
                }
                else if (dType > -2 && dType_b > -2)//开始与结束都选择
                {
                    if (dDateTimeB.Trim() != "" && dDateTimeE.Trim() == "")
                    {
                        tSQL += " and tbOrderInfo.OrderID in(select OrderID from tbOrderWorkingLogInfo where oType = " + dType_b + " and OrderID in(select OrderID from tbOrderWorkingLogInfo where oType=" + dType + " and pAppendTime>='" + Convert.ToDateTime(dDateTimeB.Trim()).ToString("yyyy-MM-dd") + " 00:00:00')   and pAppendTime>='" + Convert.ToDateTime(dDateTimeB.Trim()).ToString("yyyy-MM-dd") + " 00:00:00') ";
                    }
                    if (dDateTimeE.Trim() != "" && dDateTimeB.Trim() == "")
                    {
                        tSQL += " and tbOrderInfo.OrderID in(select OrderID from tbOrderWorkingLogInfo where oType = " + dType_b + " and OrderID in(select OrderID from tbOrderWorkingLogInfo where oType=" + dType + " and pAppendTime<='" + Convert.ToDateTime(dDateTimeE.Trim()).ToString("yyyy-MM-dd") + " 23:59:59')    and pAppendTime<='" + Convert.ToDateTime(dDateTimeE.Trim()).ToString("yyyy-MM-dd") + " 23:59:59') ";
                    }
                    if (dDateTimeE.Trim() != "" && dDateTimeB.Trim() != "")
                    {
                        tSQL += " and tbOrderInfo.OrderID in(select OrderID from tbOrderWorkingLogInfo where oType = " + dType_b + " and OrderID in(select OrderID from tbOrderWorkingLogInfo where oType=" + dType + " and pAppendTime between '" + Convert.ToDateTime(dDateTimeB.Trim()).ToString("yyyy-MM-dd") + " 00:00:00' and '" + Convert.ToDateTime(dDateTimeE.Trim()).ToString("yyyy-MM-dd") + " 23:59:59')   and pAppendTime between '" + Convert.ToDateTime(dDateTimeB.Trim()).ToString("yyyy-MM-dd") + " 00:00:00' and '" + Convert.ToDateTime(dDateTimeE.Trim()).ToString("yyyy-MM-dd") + " 23:59:59') ";
                    }
                }

                oState = HTTPRequest.GetInt("oState", -1);
                if (oState > -1)
                {
                    tSQL += " and tbOrderInfo.oState=" + oState;
                }

                bool getWorkType0 = false;

                if (oSteps == 1)
                {
                    getWorkType0 = true;
                }

                if (!IsErr())
                {
                    OrderStpes = Orders.GetOrderSteps();

                    if (Act.IndexOf("Export") > -1)                   //导出
                    {
                        if (AllOrderList.Trim().IndexOf("true") > -1) //导出单据详细列表

                        {
                            if (CheckUserPopedoms("X"))
                            {
                                //Response.Write(oState+"------"+ getWorkType0);
                                //Response.End();


                                DataSet _orderLists = Orders.GetOrderListByOrderWhere(tSQL, getWorkType0);

                                _orderLists.Tables [0].Columns [0].ColumnName  = "单号";
                                _orderLists.Tables [0].Columns [1].ColumnName  = "单据类型";
                                _orderLists.Tables [0].Columns [2].ColumnName  = "客户名称";
                                _orderLists.Tables [0].Columns [3].ColumnName  = "联系人";
                                _orderLists.Tables [0].Columns [4].ColumnName  = "电话号码";
                                _orderLists.Tables [0].Columns [5].ColumnName  = "地址";
                                _orderLists.Tables [0].Columns [6].ColumnName  = "客户订单号";
                                _orderLists.Tables [0].Columns [7].ColumnName  = "客户子名称";
                                _orderLists.Tables [0].Columns [8].ColumnName  = "业务员";
                                _orderLists.Tables [0].Columns [9].ColumnName  = "操作员";
                                _orderLists.Tables [0].Columns [10].ColumnName = "创建时间";
                                _orderLists.Tables [0].Columns [11].ColumnName = "单据时间";
                                _orderLists.Tables [0].Columns [12].ColumnName = "单据状态";
                                _orderLists.Tables [0].Columns [13].ColumnName = "单据步骤";
                                _orderLists.Tables [0].Columns [14].ColumnName = "仓库名称";
                                _orderLists.Tables [0].Columns [15].ColumnName = "是否赠品";
                                _orderLists.Tables [0].Columns [16].ColumnName = "商品名称";
                                _orderLists.Tables [0].Columns [17].ColumnName = "条码";
                                _orderLists.Tables [0].Columns [18].ColumnName = "装件数";
                                _orderLists.Tables [0].Columns [19].ColumnName = "小单位";
                                _orderLists.Tables [0].Columns [20].ColumnName = "大单位";
                                _orderLists.Tables [0].Columns [21].ColumnName = "数量";
                                _orderLists.Tables [0].Columns [22].ColumnName = "单价";
                                _orderLists.Tables [0].Columns [23].ColumnName = "金额";

                                CreateExcel(_orderLists.Tables [0], "Data_" + DateTime.Now.ToShortDateString() + ".xls");
                            }
                            else
                            {
                                AddErrLine("权限不足,无法导出 列表!");
                            }
                        }
                        else
                        {
                            DataSet _exDs = Orders.GetOrderInfoList(tSQL);
                            _exDs.Tables[0].Columns[0].ColumnName  = "系统编号";
                            _exDs.Tables[0].Columns[1].ColumnName  = "单号";
                            _exDs.Tables[0].Columns[2].ColumnName  = "单据类型";
                            _exDs.Tables[0].Columns[3].ColumnName  = "客户系统编号";
                            _exDs.Tables[0].Columns[4].ColumnName  = "客户名称";
                            _exDs.Tables[0].Columns[5].ColumnName  = "联系人";
                            _exDs.Tables[0].Columns[6].ColumnName  = "联系电话";
                            _exDs.Tables[0].Columns[7].ColumnName  = "地址";
                            _exDs.Tables[0].Columns[8].ColumnName  = "客户订单号";
                            _exDs.Tables[0].Columns[9].ColumnName  = "客户子名称";
                            _exDs.Tables[0].Columns[10].ColumnName = "业务员编号";
                            _exDs.Tables[0].Columns[11].ColumnName = "操作员编号";
                            _exDs.Tables[0].Columns[12].ColumnName = "创建时间";
                            _exDs.Tables[0].Columns[13].ColumnName = "单据时间";
                            _exDs.Tables[0].Columns[14].ColumnName = "单据状态(0正常,1作废)";
                            _exDs.Tables[0].Columns[15].ColumnName = "单据步骤";
                            _exDs.Tables[0].Columns[16].ColumnName = "是否预付款";
                            _exDs.Tables[0].Columns[17].ColumnName = "客户名称B";
                            _exDs.Tables[0].Columns[18].ColumnName = "合计金额";
                            _exDs.Tables[0].Columns[19].ColumnName = "业务员";
                            _exDs.Tables[0].Columns[20].ColumnName = "操作员";
                            _exDs.Tables[0].Columns[21].ColumnName = "操作员姓名";
                            _exDs.Tables[0].Columns[22].ColumnName = "打印时间";

                            CreateExcel(_exDs.Tables[0], "Data_" + DateTime.Now.ToShortDateString() + ".xls");
                        }
                    }
                    else
                    {
                        if (oSteps == -2)
                        {
                            dList = Orders.GetOrderInfoList(tSQL).Tables[0];

                            foreach (DataRow dr in dList.Rows)
                            {
                                SUMMoney += decimal.Parse(dr["SumMoney"].ToString());
                            }

                            PageBarHTML = "";
                        }
                        else
                        {
                            SUMMoney = Orders.GetOrderSumMoney(tSQL);

                            dList = Orders.GetOrderInfoList_xp(pagesize, pageindex, tSQL, out pagetotal, "nOrderNum desc,OrderID desc");
                            //dList = Orders.GetOrderInfoList(pagesize, pageindex, tSQL, out pagetotal, 1, "*");//oOrderNum

                            PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act +
                                                        "&S_key=" + S_key +
                                                        "&StoresSupplier=" + StoresSupplier +
                                                        "&StoresSupplierID=" + StoresSupplierID +
                                                        "&oOrderNum=" + oOrderNum +
                                                        "&StaffID=" + StaffID +
                                                        "&StaffName=" + StaffName +
                                                        "&UserID=" + UserID +
                                                        "&UserName="******"&oCustomersOrderID=" + oCustomersOrderID +
                                                        "&oOrderDateTimeB=" + oOrderDateTimeB +
                                                        "&oOrderDateTimeE=" + oOrderDateTimeE +
                                                        "&oState=" + oState +
                                                        "&oSteps=" + oSteps +
                                                        "&ProductsName=" + ProductsName +
                                                        "&ProductsID=" + ProductsID +
                                                        "&ordertypeStr=" + ordertypeStr +
                                                        "&dType_b=" + dType_b +
                                                        "&dType=" + dType +
                                                        "&dDateTimeB=" + dDateTimeB +
                                                        "&dDateTimeE=" + dDateTimeE +
                                                        "&sType=" + sType +
                                                        "&StorageID=" + StorageID +
                                                        "&StorageName=" + StorageName);
                        }
                    }
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
示例#12
0
        public int sType = -1;//发生类型,上岗=0,离岗=1

        protected virtual void Page_Load(object sender, EventArgs e)
        {
            pagesize = 20;
            PageBarHTML = "  ";
            string tSQL = " tbStaffStoresInfo.StaffStoresID<>0 ";

            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("4-2"))
                {
                    if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                    {
                        pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                    }
                    else
                    {
                        pageindex = 1;
                    }
                    if (ispost)
                    {
                        Act = HTTPRequest.GetFormString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                        StoresName = Utils.ChkSQL(HTTPRequest.GetFormString("StoresName"));
                        sType = HTTPRequest.GetFormInt("sType", -1);
                    }
                    else
                    {
                        Act = HTTPRequest.GetQueryString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
                        StoresName = Utils.ChkSQL(HTTPRequest.GetQueryString("StoresName"));
                        sType = HTTPRequest.GetQueryInt("sType", -1);
                    }

                    if (Act.Trim() == "Search" && S_key.Trim() != "")
                    {
                        tSQL = tSQL + " and tbStaffStoresInfo.StaffID in (select StaffID from tbStaffInfo where tbStaffInfo.sName like'%" + S_key + "%') ";
                    }
                    if (Act.Trim() == "SearchB")
                    {

                    }
                    if (StoresName.Trim() != "")
                    {
                        tSQL = tSQL + " and tbStaffStoresInfo.StoresID in (select StoresID from tbStoresInfo where tbStoresInfo.sName like'%" + StoresName.Trim() + "%') ";
                    }
                    if (sType > -1)
                    {
                        tSQL = tSQL + " and tbStaffStoresInfo.sType=" + sType + " ";
                    }
                    if (Act.Trim() == "SearchB")
                    {
                        dList = tbStaffStoresInfo.GetStaff_StoresList(0, DateTime.Now.AddYears(-100), DateTime.Now, -1);

                        DataView view = new DataView();
                        view.Table = dList;
                        view.RowFilter = "edate > '" + DateTime.Now + "'";//离岗时间大于当前的
                        view.Sort = "StaffID DESC,StoresID DESC";
                        dList = view.ToTable();

                    }
                    else if (Act.Trim() == "SearchC")
                    {
                        dList = tbStaffStoresInfo.GetStaff_StoresList(0, DateTime.Now.AddYears(-100), DateTime.Now, -1);
                        DataView view = new DataView();
                        view.Table = dList;

                        view.Sort = "StaffID DESC,StoresID DESC";
                        dList = view.ToTable();
                    }
                    else
                    {
                        dList = tbStaffStoresInfo.GetStaffStoresInfoList(pagesize, pageindex, tSQL, out pagetotal, 1, "*,(select sName from tbStoresInfo where StoresID=tbStaffStoresInfo.StoresID) as StoresName,(select sName from tbStaffInfo where StaffID=tbStaffStoresInfo.StaffID) as StaffName");

                        PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act + "&S_key=" + S_key + "&StoresName=" + StoresName + "&sType=" + sType);
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
示例#13
0
        public int sType;//查询类型
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("7-1-1-1"))
                {
                    Act = HTTPRequest.GetString("Act");
                    string arrayTime  = "";
                    string arrayMoney = "";
                    //重新组合
                    string _arrayTime  = "";
                    string _arrayMoney = "";
                    string sName       = "";//选择的名称

                    sName     = HTTPRequest.GetString("sName");
                    regionID  = HTTPRequest.GetString("regionID");
                    sType     = HTTPRequest.GetInt("sType", 0);
                    SalesType = HTTPRequest.GetInt("SalesType", 0);
                    bDate     = Utils.IsDateString(Utils.ChkSQL(HTTPRequest.GetString("bDate"))) ? DateTime.Parse(Utils.ChkSQL(HTTPRequest.GetString("bDate"))) : DateTime.Now;
                    if (SalesType == 0)
                    {
                        mDate = "[日期:" + bDate.ToString("yyyy年MM月") + "]";
                        unit  = 0;
                    }
                    else
                    {
                        mDate = "[日期:" + bDate.ToString("yyyy年") + "]";
                        unit  = 1;
                    }
                    if (ispost)
                    {
                        if (regionID == "")
                        {
                            //0.如果木有选择区域或客户
                            mList = tbProductsInfo.getProductsSaleDetails(SalesType, 0, bDate, "", sType);
                        }
                        else
                        {
                            string[] regionArrary       = regionID.Split(',');
                            bool     region_child       = false;
                            string   regionChildrenNode = "";
                            for (int i = 0; i < regionArrary.Length - 1; i++)
                            {
                                //1.是否存在子节点
                                if (sType == 0)
                                {
                                    region_child = DataClass.ExistsRegionClassChild(Convert.ToInt32(regionArrary[i]));
                                }
                                if (sType == 1)
                                {
                                    region_child = DataClass.ExistsCustomersClassChild(Convert.ToInt32(regionArrary[i]));
                                }
                                if (sType == 2)
                                {
                                    region_child = DataClass.ExistsProductClassChild(Convert.ToInt32(regionArrary[i]));
                                }

                                if (region_child)
                                {
                                    //2.寻找子节点
                                    if (sType == 0)
                                    {
                                        regionChildrenNode = tbRegionInfo.getRegionChildrenCount(regionArrary[i]);
                                    }
                                    if (sType == 1)
                                    {
                                        regionChildrenNode = DataClass.getCustormChildrenCount(regionArrary[i]);
                                    }
                                    if (sType == 2)
                                    {
                                        regionChildrenNode = DataClass.getProductsChildrenCount(regionArrary[i]);
                                    }
                                    regionChildrenNode = regionChildrenNode.Substring(0, regionChildrenNode.Length - 1);
                                    //3.找到各个子节点下得数据
                                    DataTable listNode = tbProductsInfo.getProductsSaleDetails(SalesType, 0, bDate, regionChildrenNode, sType);
                                    //4.将找到的每次循环的值保存到dataset中
                                    DataTable dtd = listNode.Copy();
                                    dtd.TableName = "l_" + i;
                                    ds.Tables.Add(dtd);
                                }
                                else
                                {
                                    //5.如果木有子节点
                                    DataTable list = tbProductsInfo.getProductsSaleDetails(SalesType, 0, bDate, regionArrary[i].ToString(), sType);
                                    //5.1 将找到的每次循环的值保存到dataset中
                                    DataTable dtd = list.Copy();
                                    dtd.TableName = "m_" + i;
                                    ds.Tables.Add(dtd);
                                }
                            }
                        }
                        //6.如果木有选择区域
                        if (mList.Rows.Count > 0)
                        {
                            for (int i = 0; i < mList.Rows.Count; i++)
                            {
                                if (SalesType == 0)
                                {
                                    arrayTime += Convert.ToDateTime(mList.Rows[i]["searchTime"].ToString()).ToString("dd") + ",";
                                }
                                if (SalesType == 1)
                                {
                                    arrayTime += Convert.ToDateTime(mList.Rows[i]["searchTime"].ToString()).ToString("MM") + ",";
                                }
                                //dataDetails:销售金额总量;moneyDetails:销售金额百分比

                                if (sType == 2)
                                {
                                    arrayMoney += "{name:'<b>总金额</b>:" + decimal.Round(decimal.Parse(mList.Rows[i]["moneyDetails"].ToString()), 2) + ",总数量',y:" + decimal.Round(decimal.Parse(mList.Rows[i]["dataDetails"].ToString()), 2) + "},";
                                }
                                else
                                {
                                    arrayMoney += "{name:'<b>总金额</b>',y:" + decimal.Round(decimal.Parse(mList.Rows[i]["dataDetails"].ToString()), 2) + "},";
                                }
                            }
                            arrayTime  = arrayTime.Substring(0, arrayTime.Length - 1);
                            arrayMoney = "{name:'全部'," + "data:[" + arrayMoney + "]}";
                        }
                        else
                        {
                            string[] spName = sName.Split(':');
                            //7.如果选择了区域
                            if (ds.Tables.Count > 0)
                            {
                                //7.1 循环dataset中的table
                                for (int m = 0; m < ds.Tables.Count; m++)
                                {
                                    _arrayTime = "";
                                    arrayMoney = "";
                                    //7.2循环每个table中得行
                                    for (int n = 0; n < ds.Tables[m].Rows.Count; n++)
                                    {
                                        if (SalesType == 0)
                                        {
                                            _arrayTime += Convert.ToDateTime(ds.Tables[m].Rows[n]["searchTime"].ToString()).ToString("dd") + ",";
                                        }
                                        if (SalesType == 1)
                                        {
                                            _arrayTime += Convert.ToDateTime(ds.Tables[m].Rows[n]["searchTime"].ToString()).ToString("MM") + ",";
                                        }
                                        if (sType == 2)
                                        {
                                            arrayMoney += "{name:'<b>总金额</b>" + decimal.Round(decimal.Parse(ds.Tables[m].Rows[n]["moneyDetails"].ToString()), 2) + "<b>,总数量</b>',y:" + decimal.Round(decimal.Parse(ds.Tables[m].Rows[n]["dataDetails"].ToString()), 2) + "},";
                                        }
                                        else
                                        {
                                            arrayMoney += "{name:'<b>总金额</b>',y:" + decimal.Round(decimal.Parse(ds.Tables[m].Rows[n]["dataDetails"].ToString()), 2) + "},";
                                        }
                                    }

                                    _arrayMoney += "{name:'" + spName[m] + "'," + "data:[" + arrayMoney + "]},";
                                    arrayTime    = _arrayTime.Substring(0, _arrayTime.Length - 1);
                                    jcount++;
                                }
                                arrayMoney = _arrayMoney.Substring(0, _arrayMoney.Length - 1);
                            }
                        }


                        sTjson = "cDetails:{'time':'" + arrayTime + "','salesMoney':[" + arrayMoney + "],'SalesType':'" + SalesType + "','jcount':" + jcount + ",'mDate':'" + mDate + "','unit':" + unit + "}";
                        if (Act.IndexOf("go") > -1)
                        {
                            Response.Charset         = "utf-8";
                            Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
                            //Response.ContentType = "application/json";
                            Response.Clear();
                            Response.Write("{" + sTjson + "}");
                            Response.End();
                        }
                    }
                    else
                    {
                        doValue = HTTPRequest.GetQueryString("doValue").ToString();
                        string getClickStr = "";
                        getClickStr = HTTPRequest.GetString("pid");
                        if (getClickStr != "-1")
                        {
                            string[] getClickStrArray = getClickStr.Split(',');
                            for (int i = 0; i < getClickStrArray.Length; i++)
                            {
                                getClickStr = getClickStrArray[0].ToString();
                            }
                        }
                        if (doValue != "")
                        {
                            ReJson = true;
                            switch (doValue)
                            {
                            case "region":

                                regionJson = Caches.GetRegionInfoToJson(Convert.ToInt32(getClickStr), false, true);    //区域树
                                Json_Str   = "[" + regionJson + "]";
                                break;

                            case "custorm":
                                customerJson = Caches.GetCustomersInfoToJson(Convert.ToInt32(getClickStr), true, true);    //客户树
                                Json_Str     = "[" + customerJson + "]";
                                break;

                            case "product":
                                productJson = Caches.GetProductsInfoToJson(Convert.ToInt32(getClickStr), true, true);
                                Json_Str    = "[" + productJson + "]";
                                break;
                            }
                        }
                        if (Json_Str == "")
                        {
                            Json_Str = "{\"results\": []}";
                        }
                        if (ReJson)
                        {
                            Response.Write(Json_Str);
                            Response.End();
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
示例#14
0
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            pagesize    = 30;
            PageBarHTML = "";
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("8-2-1"))
                {
                    string tSQL = "";
                    if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                    {
                        pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                    }
                    else
                    {
                        pageindex = 1;
                    }
                    if (ispost)
                    {
                        Act   = HTTPRequest.GetFormString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                    }
                    else
                    {
                        Act   = HTTPRequest.GetQueryString("Act");
                        S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
                    }
                    if (M_Config != null)
                    {
                        status    = HTTPRequest.GetInt("status", -1);
                        sendgoods = HTTPRequest.GetInt("sendgoods", -1);
                        rate      = HTTPRequest.GetInt("rate", -1);

                        oDateTimeB = Utils.ChkSQL(HTTPRequest.GetString("oDateTimeB"));
                        oDateTimeE = Utils.ChkSQL(HTTPRequest.GetString("oDateTimeE"));

                        tSQL = " m_ConfigInfoID = " + M_Config.m_ConfigInfoID;

                        //交易状态
                        if (status > -1)
                        {
                            if (status <= TradeStatusStr.Length)
                            {
                                status_str = TradeStatus[status];
                            }
                        }
                        //发货状态
                        if (sendgoods > -1)
                        {
                        }
                        //平价状态
                        if (rate > -1)
                        {
                            switch (rate)
                            {
                            case 0:    //买家未评价
                                tSQL += " and m_TradeInfoID in(select m_TradeInfoID from tb_M_OrderInfo where buyer_rate=0)";
                                break;

                            case 1:    //买家已经评价
                                tSQL += " and m_TradeInfoID in(select m_TradeInfoID from tb_M_OrderInfo where buyer_rate=1)";
                                break;

                            case 2:    //卖家未评价
                                tSQL += " and m_TradeInfoID in(select m_TradeInfoID from tb_M_OrderInfo where seller_rate=0)";
                                break;

                            case 3:    //卖家已评价
                                tSQL += " and m_TradeInfoID in(select m_TradeInfoID from tb_M_OrderInfo where seller_rate=1)";
                                break;

                            case 4:    //双方未评价
                                tSQL += " and m_TradeInfoID in(select m_TradeInfoID from tb_M_OrderInfo where buyer_rate=0 and seller_rate=0)";
                                break;

                            case 5:    //双方已评价
                                tSQL += " and m_TradeInfoID in(select m_TradeInfoID from tb_M_OrderInfo where buyer_rate=1 and seller_rate=1)";
                                break;
                            }
                        }

                        if (Utils.IsDateString(oDateTimeB))
                        {
                            tSQL += " and created>='" + oDateTimeB + "'";
                        }
                        if (Utils.IsDateString(oDateTimeE))
                        {
                            tSQL += " and created<='" + oDateTimeE + "'";
                        }
                        //退款交易
                        //if (Act == "refund")
                        //{
                        //tSQL += " and m_OrderRefundInfoID in(select m_OrderRefundInfoID from tb_M_OrderRefundInfo where m_ConfigInfoID=tb_M_TradeInfo.m_ConfigInfoID and tid=tb_M_TradeInfo.tid)";
                        //}
                        //已完成的交易
                        //if(Act=="ok")
                        //{
                        //    tSQL += " and status in('TRADE_FINISHED','TRADE_CLOSED','TRADE_CLOSED_BY_TAOBAO','ALL_CLOSED')";
                        //}

                        if (status_str.Trim() != "")
                        {
                            tSQL += " and status = '" + status_str.Trim() + "'";
                        }

                        if (S_key.Trim() != "")
                        {
                            tSQL += " and (charindex('" + S_key.Trim() + "',[title])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[buyer_message])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[buyer_memo])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[seller_memo])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[trade_memo])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[buyer_alipay_no])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[receiver_name])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[receiver_state])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[receiver_city])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[receiver_district])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[receiver_address])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[receiver_zip])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[receiver_mobile])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[receiver_phone])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[buyer_email])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[promotion])>0 " +
                                    "or charindex('" + S_key.Trim() + "',[invoice_name])>0 " +
                                    ")";
                        }


                        dList = M_Utils.GetM_TradeInfoList(pagesize, pageindex, tSQL, out pagetotal, 1, "*");

                        if (dList != null)
                        {
                            //取交易号列表
                            string m_TradeInfoIDStr = "0";
                            foreach (DataRow dr in dList.Rows)
                            {
                                m_TradeInfoIDStr += "," + dr["m_TradeInfoID"].ToString();
                            }
                            oList = M_Utils.GetM_OrderInfoList(" m_ConfigInfoID=" + M_Config.m_ConfigInfoID + " and m_TradeInfoID in(" + m_TradeInfoIDStr + ")").Tables[0];
                        }
                        PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act + "&S_key=" + S_key);
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                    AddScript("window.parent.HidBox();");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
示例#15
0
        //public string tSQL = "";

        protected virtual void Page_Load(object sender, EventArgs e)
        {
            pagesize    = 30;
            PageBarHTML = "";
            string tSQL = "";

            if (this.userid > 0)
            {
                if (HTTPRequest.GetString("page").Trim() != "" && Utils.IsInt(HTTPRequest.GetString("page").Trim()))
                {
                    pageindex = int.Parse(HTTPRequest.GetString("page").Trim());
                }
                else
                {
                    pageindex = 1;
                }
                if (ispost)
                {
                    Act   = HTTPRequest.GetFormString("Act");
                    S_key = Utils.ChkSQL(HTTPRequest.GetFormString("S_key"));
                }
                else
                {
                    Act   = HTTPRequest.GetQueryString("Act");
                    S_key = Utils.ChkSQL(HTTPRequest.GetQueryString("S_key"));
                }
                ordertype    = HTTPRequest.GetInt("ordertype", 0);
                ordertypeStr = Utils.ChkSQL(HTTPRequest.GetString("ordertypeStr"));
                string _otypestr = "0";

                switch (ordertype)
                {
                case 1:                //采购入库=1
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-1-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|1|") > -1)
                            {
                                _otypestr += ",1";
                            }
                        }
                        else
                        {
                            _otypestr += ",1";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 采购入库单 列表!");
                    }
                    break;

                case 2:                //采购退货=2
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-2-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|2|") > -1)
                            {
                                _otypestr += ",2";
                            }
                        }
                        else
                        {
                            _otypestr += ",2";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 采购退货单 列表!");
                    }
                    break;

                case 3:                //销售发货=3
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-3-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|3|") > -1)
                            {
                                _otypestr += ",3";
                            }
                        }
                        else
                        {
                            _otypestr += ",3";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 销售发货单 列表!");
                    }
                    break;

                case 4:                //销售退货=4
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-4-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|4|") > -1)
                            {
                                _otypestr += ",4";
                            }
                        }
                        else
                        {
                            _otypestr += ",4";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 销售退货单 列表!");
                    }
                    break;

                case 5:                //赠品=5
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-5-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|5|") > -1)
                            {
                                _otypestr += ",5";
                            }
                        }
                        else
                        {
                            _otypestr += ",5";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 赠品单 列表!");
                    }
                    break;

                case 6:                //样品=6
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-6-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|6|") > -1)
                            {
                                _otypestr += ",6";
                            }
                        }
                        else
                        {
                            _otypestr += ",6";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 样品单 列表!");
                    }
                    break;

                case 7:                //代购=7
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-7-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|7|") > -1)
                            {
                                _otypestr += ",7";
                            }
                        }
                        else
                        {
                            _otypestr += ",7";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 代购单 列表!");
                    }
                    break;

                case 8:                //库存调整=8
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-8-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|8|") > -1)
                            {
                                _otypestr += ",8";
                            }
                        }
                        else
                        {
                            _otypestr += ",8";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 库存调整单 列表!");
                    }
                    break;

                case 9:                //库存调拨=9
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-8-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|9|") > -1)
                            {
                                _otypestr += ",9";
                            }
                        }
                        else
                        {
                            _otypestr += ",9";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 库存调拨单 列表!");
                    }
                    break;

                case 10:                //坏货=10
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-8-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|10|") > -1)
                            {
                                _otypestr += ",10";
                            }
                        }
                        else
                        {
                            _otypestr += ",10";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 坏货单 列表!");
                    }
                    break;

                case 11:                //换货=11
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-8-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|11|") > -1)
                            {
                                _otypestr += ",11";
                            }
                        }
                        else
                        {
                            _otypestr += ",11";
                        }
                    }
                    else
                    {
                        AddErrLine("权限不足,无法浏览 坏货单 列表!");
                    }
                    break;

                default:
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-1-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|1|") > -1)
                            {
                                _otypestr += ",1";
                            }
                        }
                        else
                        {
                            _otypestr += ",1";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-2-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|2|") > -1)
                            {
                                _otypestr += ",2";
                            }
                        }
                        else
                        {
                            _otypestr += ",2";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-3-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|3|") > -1)
                            {
                                _otypestr += ",3";
                            }
                        }
                        else
                        {
                            _otypestr += ",3";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-4-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|4|") > -1)
                            {
                                _otypestr += ",4";
                            }
                        }
                        else
                        {
                            _otypestr += ",4";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-5-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|5|") > -1)
                            {
                                _otypestr += ",5";
                            }
                        }
                        else
                        {
                            _otypestr += ",5";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-6-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|6|") > -1)
                            {
                                _otypestr += ",6";
                            }
                        }
                        else
                        {
                            _otypestr += ",6";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-7-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|7|") > -1)
                            {
                                _otypestr += ",7";
                            }
                        }
                        else
                        {
                            _otypestr += ",7";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-8-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|8|") > -1)
                            {
                                _otypestr += ",8";
                            }
                        }
                        else
                        {
                            _otypestr += ",8";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-8-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|9|") > -1)
                            {
                                _otypestr += ",9";
                            }
                        }
                        else
                        {
                            _otypestr += ",9";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-8-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|10|") > -1)
                            {
                                _otypestr += ",10";
                            }
                        }
                        else
                        {
                            _otypestr += ",10";
                        }
                    }
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("3-3-4-8-1"))
                    {
                        if (ordertypeStr.Trim() != "")
                        {
                            if (ordertypeStr.IndexOf("|11|") > -1)
                            {
                                _otypestr += ",11";
                            }
                        }
                        else
                        {
                            _otypestr += ",11";
                        }
                    }
                    break;
                }

                tSQL             = " tbOrderInfo.oType in(" + _otypestr + ") ";
                StoresSupplierID = HTTPRequest.GetInt("StoresSupplierID", 0);
                if (StoresSupplierID > 0)
                {
                    tSQL += " and tbOrderInfo.StoresID=" + StoresSupplierID;
                }
                StoresSupplier = Utils.ChkSQL(HTTPRequest.GetString("StoresSupplier"));

                StorageID = HTTPRequest.GetInt("StorageID", 0);
                if (StorageID > 0)
                {
                    tSQL += " and tbOrderInfo.OrderID in(select siol.OrderID from tbOrderListInfo siol where siol.StorageID=" + StorageID + " ) ";
                }
                StorageName = Utils.ChkSQL(HTTPRequest.GetString("StorageName"));

                oOrderNum = Utils.ChkSQL(HTTPRequest.GetString("oOrderNum"));
                if (oOrderNum.Trim() != "")
                {
                    tSQL += " and tbOrderInfo.oOrderNum like '%" + oOrderNum + "%'";
                }

                StaffID = HTTPRequest.GetInt("StaffID", 0);
                if (StaffID > 0)
                {
                    tSQL += " and tbOrderInfo.StaffID=" + StaffID;
                }
                StaffName = Utils.ChkSQL(HTTPRequest.GetString("StaffName"));

                UserID = HTTPRequest.GetInt("UserID", 0);
                if (UserID > 0)
                {
                    tSQL += " and tbOrderInfo.UserID=" + UserID;
                }
                UserName = Utils.ChkSQL(HTTPRequest.GetString("User"));

                ProductsName = Utils.ChkSQL(HTTPRequest.GetString("ProductsName"));
                ProductsID   = HTTPRequest.GetInt("ProductsID", 0);
                if (ProductsID > 0)
                {
                    tSQL += " and tbOrderInfo.OrderID in(select pol.OrderID from tbOrderListInfo pol where pol.ProductsID=" + ProductsID + " ) ";
                }

                dDateTimeB = Utils.ChkSQL(HTTPRequest.GetString("dDateTimeB"));
                dDateTimeE = Utils.ChkSQL(HTTPRequest.GetString("dDateTimeE"));

                dDateTimeB = dDateTimeB.Trim() == "" ? DateTime.Now.Year + "-1-1" : dDateTimeB.Trim();

                //步骤
                //oSteps = HTTPRequest.GetInt("oSteps", 2);//新单已审核
                sType = HTTPRequest.GetInt("sType", 1);

                oState = HTTPRequest.GetInt("oState", 0);
                //if (oState > -1)
                {
                    tSQL += " and tbOrderInfo.oState=" + oState;
                    tSQL += " and tbOrderInfo.oSteps in (2,3)";                    //新单已审核,发货

                    oOrderDateTimeB = Utils.ChkSQL(HTTPRequest.GetString("oOrderDateTimeB"));
                    if (oOrderDateTimeB.Trim() == "")
                    {
                        if (ordertype != 0)
                        {
                            oOrderDateTimeB = DateTime.Now.Year + "-1-1";
                        }
                    }
                    if (oOrderDateTimeB.Trim() != "" && Utils.IsDateString(oOrderDateTimeB.Trim()))
                    {
                        tSQL += " and tbOrderInfo.oOrderDateTime>='" + Convert.ToDateTime(oOrderDateTimeB.Trim()).ToString("yyyy-MM-dd") + " 00:00:00 '";
                    }
                    oOrderDateTimeE = Utils.ChkSQL(HTTPRequest.GetString("oOrderDateTimeE"));
                    if (oOrderDateTimeE.Trim() != "" && Utils.IsDateString(oOrderDateTimeE.Trim()))
                    {
                        tSQL += " and tbOrderInfo.oOrderDateTime<='" + Convert.ToDateTime(oOrderDateTimeE.Trim()).ToString("yyyy-MM-dd") + " 23:59:59 '";
                    }
                }



                if (!IsErr())
                {
                    OrderStpes = Orders.GetOrderSteps();

                    dList = Orders.GetOrderInfoList_xp(pagesize, pageindex, tSQL, out pagetotal, "nOrderNum desc,OrderID desc");


                    PageBarHTML = Utils.TenPage(pageindex, pagetotal, 0, "&Act=" + Act +
                                                "&S_key=" + S_key +
                                                "&StoresSupplier=" + StoresSupplier +
                                                "&StoresSupplierID=" + StoresSupplierID +
                                                "&oOrderNum=" + oOrderNum +
                                                "&StaffID=" + StaffID +
                                                "&StaffName=" + StaffName +
                                                "&UserID=" + UserID +
                                                "&UserName="******"&oCustomersOrderID=" + oCustomersOrderID +
                                                "&oOrderDateTimeB=" + oOrderDateTimeB +
                                                "&oOrderDateTimeE=" + oOrderDateTimeE +
                                                "&oState=" + oState +
                                                //"&oSteps=" + oSteps +
                                                "&ProductsName=" + ProductsName +
                                                "&ProductsID=" + ProductsID +
                                                "&ordertypeStr=" + ordertypeStr +
                                                "&dDateTimeB=" + dDateTimeB +
                                                "&dDateTimeE=" + dDateTimeE +
                                                "&sType=" + sType +
                                                "&StorageID=" + StorageID +
                                                "&StorageName=" + StorageName);
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }