Exemple #1
0
    private bool LoadRpt()
    {
        try
        {
            GetStrWhere();
            string frx   = "ProductDetailQuery.frx";
            string Comds = "WMS.SelectProductDetailQuery";

            if (rpt2.Checked)
            {
                frx   = "ProductTotalQuery.frx";
                Comds = "WMS.SelectProductTotalQuery";
            }
            WebReport1.Report = new Report();
            WebReport1.Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + @"RptFiles\" + frx);

            BLL.BLLBase bll = new BLL.BLLBase();

            DataTable dt = bll.FillDataTable(Comds, new DataParameter[] { new DataParameter("{0}", strWhere) });



            if (dt.Rows.Count == 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('您所选择的条件没有资料!');", true);
            }

            WebReport1.Report.RegisterData(dt, "ProductQuery");
        }
        catch (Exception ex)
        {
        }
        return(true);
    }
Exemple #2
0
    private void BindOther()
    {
        BLL.BLLBase bll = new BLL.BLLBase();
        DataRow dr;
        DataTable dtArea = bll.FillDataTable("Cmd.SelectArea");
        dr = dtArea.NewRow();
        dr["AreaCode"] = "";
        dr["AreaName"] = "请选择";
        dtArea.Rows.InsertAt(dr, 0);
        dtArea.AcceptChanges();

        this.ddlArea.DataValueField = "AreaCode";
        this.ddlArea.DataTextField = "AreaName";
        this.ddlArea.DataSource = dtArea;
        this.ddlArea.DataBind();

        DataTable dtBillType = bll.FillDataTable("Cmd.SelectBillType", new DataParameter[] { new DataParameter("{0}", "BillTypeCode not in ('040','050')") });
        dr = dtBillType.NewRow();
        dr["BillTypeCode"] = "";
        dr["BillTypeName"] = "请选择";
        dtBillType.Rows.InsertAt(dr, 0);
        dtBillType.AcceptChanges();

        this.ddlBillType.DataValueField = "BillTypeCode";
        this.ddlBillType.DataTextField = "BillTypeName";
        this.ddlBillType.DataSource = dtBillType;
        this.ddlBillType.DataBind();
    }
Exemple #3
0
    public override void BindDataSub(string BillID)
    {
        //string script = string.Format("document.getElementById('iframeRoleSet').src='RoleSet.aspx?GroupID={0}&GroupName={1}' ;", this.hdnRowValue.Value, Server.UrlEncode(hdnRowGroupName.Value));
        //ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "", script, true);
        string GroupName = hdnRowGroupName.Value;
        this.lbTitle.Text = "用户组 <font color='Gray'>" + GroupName + "</font> 权限设置";
        //InitSmartTree();
        //this.sTreeModule.ExpandDepth = 1;
        GroupOperationBind();
        if (GroupName == "admin")
        {
            this.lnkBtnSave.Enabled = false;
        }
        else
        {
            this.lnkBtnSave.Enabled = true;
        }

        BLL.BLLBase bll = new BLL.BLLBase();
        DataTable dtSub = bll.FillDataTable("Security.SelectGroupUser", new DataParameter[] { new DataParameter("@GroupID", BillID) });
        ViewState[FormID + "_S_gvGroupListUser"] = dtSub;
        this.gvGroupListUser.DataSource = dtSub;
        this.gvGroupListUser.DataBind();
        MovePage("S", this.gvGroupListUser, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1);
        lblCurrentPageSub1.Visible = false;
    }
        private AjaxResult ResetPwd(int id)
        {
            BLL.BLLBase bll = new BLLBase();
            AjaxResult re = null;

            this.ctx.BeginTransaction();
            try
            {
                bll.Update(this.ctx, new Admin() {ID = id, Password = PubFunc.Md5("123456")});

                this.ctx.CommitTransaction();

                re = new AjaxResult() { Success = 1 };
            }
            catch (Exception ex)
            {
                this.ctx.RollBackTransaction();

                re = new AjaxResult() { Success = 0, Message = "操作失败,原因:" + ex.Message };
            }
            finally
            {
                this.ctx.CloseConnection();
            }

            return re;
        }
Exemple #5
0
    public ReturnData strBaseData(string xmlpara)
    {
        ReturnData rr = new ReturnData();

        DataTable dt = Util.JsonHelper.Json2Dtb(xmlpara);


        string strWhere = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["strWhere"].ToString());

        string strFieldName = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["strFieldName"].ToString());
        string TableName    = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["TableName"].ToString());;

        if (strFieldName == "")
        {
            strFieldName = "*";
        }


        BLL.BLLBase bll = new BLL.BLLBase();
        dt = bll.FillDataTable("Security.SelectFieldValue", new DataParameter[] { new DataParameter("{0}", TableName), new DataParameter("{1}", strFieldName), new DataParameter("{2}", strWhere) });

        rr.data = Util.JsonHelper.Dtb2Json(dt);
        rr.type = "" + dt.GetType();

        return(rr);
    }
Exemple #6
0
    protected void btnUnTask_Click(object sender, EventArgs e)
    {
        BLL.BLLBase bll   = new BLL.BLLBase();
        int         State = int.Parse(bll.GetFieldValue("WMS_BillMaster", "State", string.Format("BillID='{0}'", this.txtID.Text)));

        if (State < 2)
        {
            JScript.ShowMessage(this.updatePanel, this.txtID.Text + "单号还未作业,不能进行取消作业。");
            return;
        }
        if (State > 2)
        {
            JScript.ShowMessage(this.updatePanel, this.txtID.Text + "单号已经执行,不能再进行取消作业。");
            return;
        }
        try
        {
            bll.ExecNonQueryTran("WMS.SpCancelOutStockTask", new DataParameter[] { new DataParameter("@BillID", strID), new DataParameter("@UserName", Session["EmployeeCode"].ToString()) });
            AddOperateLog("入库单", "入库取消作业单号:" + this.txtID.Text);
            DataTable dt = bll.FillDataTable("WMS.SelectBillMaster", new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", strID)) });
            BindData(dt);
        }
        catch (Exception ex)
        {
            JScript.ShowMessage(this.updatePanel, ex.Message);
        }
    }
Exemple #7
0
    protected void btnDeletet_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";

        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                //判断能否删除
                int Count = bll.GetRowCount("VUsed_CMD_Product", string.Format("ProductCode='{0}'", hk.Text));
                if (Count > 0)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "车型信息被其它单据使用,请调整后再删除!");
                    return;
                }

                strColorCode += "'" + hk.Text + "',";
            }
        }
        strColorCode += "'-1'";


        bll.ExecNonQuery("Cmd.DeleteProduct", new DataParameter[] { new DataParameter("{0}", strColorCode) });
        AddOperateLog("产品信息", "删除单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
        SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
    }
Exemple #8
0
        private void Main_Load(object sender, EventArgs e)
        {
            try
            {
                bll = new BLLBase();
                lbLog.Scrollable = true;
                Logger.OnLog    += new LogEventHandler(Logger_OnLog);
                context          = new Context();



                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);

                Dispatching.LED2008.LEDUtil.Initialize(context.Attributes["LedCollection"].ToString());

                toolStripButton_StartCrane_Click(null, null);

                dtCrane = bll.FillDataTable("WCS.SelectWCSCRANE");

                System.Threading.Thread.Sleep(1000);
                tmCraneErr.Interval = 3000;
                tmCraneErr.Elapsed += new System.Timers.ElapsedEventHandler(tmCraneWorker);
                tmCraneErr.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }
        }
    protected void btnDeletet_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";
        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                //判断能否删除
                int Count = bll.GetRowCount("VUsed_CMD_BillType", string.Format("BillTypeCode='{0}'", hk.Text));
                if (Count > 0)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "入库类型被其它单据使用,请调整后再删除!");
                    return;
                }

                strColorCode += "'" + hk.Text + "',";
            }
        }
        strColorCode += "'-1'";

        bll.ExecNonQuery("Cmd.DeleteBillType", new DataParameter[] { new DataParameter("{0}", strColorCode) });
        AddOperateLog("入库类型", "删除单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
        SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
    }
Exemple #10
0
    //主表显示
    public DataTable SetBtnEnabled(int PageIndex, string SqlCmd, string Filter, int pageSize, GridView dgview, LinkButton btnFirst, LinkButton btnPre, LinkButton btnNext, LinkButton btnLast, LinkButton btnToPage, Label lblCurrentPage, UpdatePanel UpdatePanel1)
    {
        int pageCount  = 0;
        int totalCount = 0;

        BLL.BLLBase bll    = new BLL.BLLBase();
        DataTable   dtView = bll.GetDataPage(SqlCmd, PageIndex, pageSize, out totalCount, out pageCount, new DataParameter[] { new DataParameter("{0}", Filter) });


        if (ViewState["CurrentPage"].ToString() == "0" || int.Parse(ViewState["CurrentPage"].ToString()) > pageCount)
        {
            ViewState["CurrentPage"] = pageCount;
        }



        if (dtView.Rows.Count == 0)
        {
            SetGridViewEmptyRow(dgview, dtView);

            btnFirst.Enabled       = false;
            btnPre.Enabled         = false;
            btnNext.Enabled        = false;
            btnLast.Enabled        = false;
            btnToPage.Enabled      = false;
            lblCurrentPage.Visible = false;
        }
        else
        {
            dgview.DataSource = dtView;
            dgview.DataBind();

            btnLast.Enabled   = true;
            btnFirst.Enabled  = true;
            btnToPage.Enabled = true;

            if (int.Parse(ViewState["CurrentPage"].ToString()) > 1)
            {
                btnPre.Enabled = true;
            }
            else
            {
                btnPre.Enabled = false;
            }

            if (int.Parse(ViewState["CurrentPage"].ToString()) < pageCount)
            {
                btnNext.Enabled = true;
            }
            else
            {
                btnNext.Enabled = false;
            }

            lblCurrentPage.Visible = true;
            lblCurrentPage.Text    = "共 [" + totalCount.ToString() + "] 笔记录  第 [" + ViewState["CurrentPage"] + "] 页  共 [" + pageCount.ToString() + "] 页";
        }
        ViewState[FormID + "_MainFormData"] = dtView;
        return(dtView);
    }
        private AjaxResult Del(int id)
        {
            BLL.BLLBase bll = new BLLBase();
            AjaxResult re = null;

            var ctx = new Common.DataContext();

            ctx.BeginTransaction();
            try
            {
                bll.Update(ctx, new Model.Channel() {ID = id, State = 255});

                ctx.CommitTransaction();

                re = new AjaxResult() {Success = 1};
            }
            catch (Exception ex)
            {
                ctx.RollBackTransaction();

                re = new AjaxResult() {Success = 0, Message = "操作失败,原因:" + ex.Message};
            }
            finally
            {
                ctx.CloseConnection();
            }

            return re;
        }
Exemple #12
0
    private void QuickDestopBind()
    {
        BLL.BLLBase bll  = new BLL.BLLBase();
        DataTable   dtOP = bll.FillDataTable("Security.SelectUserQuickDesktop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())) });

        foreach (TreeNode tnRoot in this.sTreeModule.Nodes)
        {
            bool IsAllSelected = false;
            foreach (TreeNode tnSub in tnRoot.ChildNodes)
            {
                tnSub.Checked = false;
                DataRow[] drs = dtOP.Select(string.Format("ModuleID={0}", tnSub.Value));
                if (drs.Length > 0)
                {
                    tnSub.Checked = true;
                }
                if (tnSub.Checked)
                {
                    IsAllSelected = true;
                }
            }
            if (IsAllSelected)
            {
                tnRoot.Checked = true;
            }
        }
    }
    /// <summary>
    /// 保存当前组用户
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            UpdateTempUser();
            string users = "-1,";

            if (ViewState["hdnRowValue"].ToString().Length > 0)
                users += ViewState["hdnRowValue"].ToString().Replace("'", "");

            users += "-1";

            BLL.BLLBase bll = new BLL.BLLBase();
            bll.ExecNonQuery("Security.UpdateUserGroup", new DataParameter[] { new DataParameter("@GroupID", GroupID), new DataParameter("{0}", users) });

            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, this.UpdatePanel1.GetType(), "Resize", "Close('1');", true);

        }
        catch (Exception ex)
        {
            System.Diagnostics.StackFrame frame = new System.Diagnostics.StackFrame(0);
            Session["ModuleName"] = this.Page.Title;
            Session["FunctionName"] = frame.GetMethod().Name;
            Session["ExceptionalType"] = ex.GetType().FullName;
            Session["ExceptionalDescription"] = ex.Message;
            Response.Redirect("../../../Common/MistakesPage.aspx");

        }
    }
Exemple #14
0
    /// <summary>
    /// 保存当前组用户

    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            UpdateTempUser();
            string users = "-1,";

            if (ViewState["hdnRowValue"].ToString().Length > 0)
            {
                users += ViewState["hdnRowValue"].ToString().Replace("'", "");
            }



            users += "-1";

            BLL.BLLBase bll = new BLL.BLLBase();
            bll.ExecNonQuery("Security.UpdateUserGroup", new DataParameter[] { new DataParameter("@GroupID", GroupID), new DataParameter("{0}", users) });

            ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1, this.UpdatePanel1.GetType(), "Resize", "Close('1');", true);
        }
        catch (Exception ex)
        {
            System.Diagnostics.StackFrame frame = new System.Diagnostics.StackFrame(0);
            Session["ModuleName"]             = this.Page.Title;
            Session["FunctionName"]           = frame.GetMethod().Name;
            Session["ExceptionalType"]        = ex.GetType().FullName;
            Session["ExceptionalDescription"] = ex.Message;
            Response.Redirect("../../../Common/MistakesPage.aspx");
        }
    }
Exemple #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string WareHouse = Request.QueryString["WareHouse"].ToString();
        string ShelfCode = Request.QueryString["ShelfCode"].ToString();
        string AreaCode  = Request.QueryString["AreaCode"].ToString();

        BLL.BLLBase bll = new BLL.BLLBase();
        writeJsvar("", "", "");
        DataTable tableCell;

        if (WareHouse != "" && AreaCode == "")
        {
            tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByWareHouse", new DataParameter[] { new DataParameter("@WareHouse", WareHouse) });
            ShowWareHouseChart(tableCell);
        }
        else if (AreaCode != "" && ShelfCode == "")
        {
            tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByArea", new DataParameter[] { new DataParameter("@AreaCode", AreaCode) });
            ShowCellChart(tableCell);
        }
        else
        {
            tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByShelf", new DataParameter[] { new DataParameter("{0}", string.Format("ShelfCode='{0}' and AreaCode='{1}'", ShelfCode, AreaCode)) });
            ShowCellChart(tableCell);
        }
        ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Resize", "resize();", true);
    }
Exemple #16
0
    private void BindOther()
    {
        BLL.BLLBase bll    = new BLL.BLLBase();
        DataTable   dtArea = bll.FillDataTable("Cmd.SelectArea", new DataParameter[] { new DataParameter("{0}", "1=1") });
        DataRow     dr     = dtArea.NewRow();

        dr["AreaCode"] = "";
        dr["AreaName"] = "请选择";
        dtArea.Rows.InsertAt(dr, 0);
        dtArea.AcceptChanges();

        this.ddlArea.DataValueField = "AreaCode";
        this.ddlArea.DataTextField  = "AreaName";
        this.ddlArea.DataSource     = dtArea;
        this.ddlArea.DataBind();


        DataTable dtBillType = bll.FillDataTable("Cmd.SelectBillType", new DataParameter[] { new DataParameter("{0}", "BillTypeCode not in ('040','050')"), new DataParameter("{1}", "BillTypeCode") });

        dr = dtBillType.NewRow();
        dr["BillTypeCode"] = "";
        dr["BillTypeName"] = "请选择";
        dtBillType.Rows.InsertAt(dr, 0);
        dtBillType.AcceptChanges();

        this.ddlBillType.DataValueField = "BillTypeCode";
        this.ddlBillType.DataTextField  = "BillTypeName";
        this.ddlBillType.DataSource     = dtBillType;
        this.ddlBillType.DataBind();
    }
Exemple #17
0
    private bool LoadRpt1()
    {
        try
        {
            strWhere  = "1=1";
            strWhere += string.Format("and CellCode between '{0}' AND '{1}'", SelectBegin.Text, SelectEnd.Text);
            string frx   = "BarCodeQuery.frx";
            string Comds = "Cmd.SelectCell";


            WebReport2.Report = new Report();
            WebReport2.Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + @"RptFiles\" + frx);

            BLL.BLLBase bll = new BLL.BLLBase();

            DataTable dt = bll.FillDataTable(Comds, new DataParameter[] { new DataParameter("{0}", strWhere) });



            if (dt.Rows.Count == 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('您所选择的条件没有资料!');", true);
            }

            WebReport2.Report.RegisterData(dt, "BarCode");
        }
        catch (Exception ex)
        {
        }
        return(true);
    }
Exemple #18
0
 public static void AddOperateLog(string UserName, string moduleName, string executeOperation)
 {
     //
     BLL.BLLBase bll = new BLL.BLLBase();
     bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[] { new DataParameter("@LoginUser", UserName), new DataParameter("@LoginTime", DateTime.Now),
                                                                          new DataParameter("@LoginModule", moduleName), new DataParameter("@ExecuteOperator", executeOperation) });
 }
Exemple #19
0
    public ReturnData autoCodeByTableName(string xmlpara)
    {
        ReturnData rr = new ReturnData();
        try
        {

            BLL.BLLBase bll = new BLL.BLLBase();

            DataTable dt = Util.JsonHelper.Json2Dtb(xmlpara);
            string PreName = dt.Rows[0]["PreName"].ToString();
            string dtTime = dt.Rows[0]["dtTime"].ToString();
            string TableName = dt.Rows[0]["TableName"].ToString();
            string Filter = dt.Rows[0]["Filter"].ToString();

            string strCode = bll.GetAutoCodeByTableName(PreName, TableName, DateTime.Parse(dtTime), Filter);
            rr.data = strCode;
            rr.type = "" + strCode.GetType();
        }
        catch (Exception ex)
        {

        }

        return rr;
    }
Exemple #20
0
    public override void BindDataSub(string BillID)
    {
        //string script = string.Format("document.getElementById('iframeRoleSet').src='RoleSet.aspx?GroupID={0}&GroupName={1}' ;", this.hdnRowValue.Value, Server.UrlEncode(hdnRowGroupName.Value));
        //ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.UpdatePanel1.GetType(), "", script, true);
        string GroupName = hdnRowGroupName.Value;

        this.lbTitle.Text = "用户组 <font color='Gray'>" + GroupName + "</font> 权限设置";
        //InitSmartTree();
        //this.sTreeModule.ExpandDepth = 1;
        GroupOperationBind();
        if (GroupName == "admin")
        {
            this.lnkBtnSave.Enabled = false;
        }
        else
        {
            this.lnkBtnSave.Enabled = true;
        }



        BLL.BLLBase bll   = new BLL.BLLBase();
        DataTable   dtSub = bll.FillDataTable("Security.SelectGroupUser", new DataParameter[] { new DataParameter("@GroupID", BillID) });

        ViewState[FormID + "_S_gvGroupListUser"] = dtSub;
        this.gvGroupListUser.DataSource          = dtSub;
        this.gvGroupListUser.DataBind();
        MovePage("S", this.gvGroupListUser, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1);
        lblCurrentPageSub1.Visible = false;
    }
Exemple #21
0
 public override void BindDataSub(string BillID)
 {
     BLL.BLLBase bll = new BLL.BLLBase();
     DataTable dtSub = bll.FillDataTable("WMS.SelectBillDetail", new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", BillID)) });
     ViewState[FormID + "_S_GridView2"] = dtSub;
     this.GridView2.DataSource = dtSub;
     this.GridView2.DataBind();
     MovePage("S", this.GridView2, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1);
 }
Exemple #22
0
    public override void BindDataSub(string BillID)
    {
        BLL.BLLBase bll   = new BLL.BLLBase();
        DataTable   dtSub = bll.FillDataTable("WMS.SelectBillTask", new DataParameter[] { new DataParameter("{0}", string.Format("BillID='{0}'", BillID)) });

        ViewState[FormID + "_S_GridView2"] = dtSub;
        this.GridView2.DataSource          = dtSub;
        this.GridView2.DataBind();
        MovePage("S", this.GridView2, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1);
    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";
        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                string hk = this.GridView1.Rows[i].Cells[1].Text;
                //判断能否删除
                int State = int.Parse(bll.GetFieldValue("WMS_BillMaster", "State", string.Format("BillID='{0}'", hk)));
                if (State == 0)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "单号还未审核不能作业,请审核后,再进行盘库作业。");
                    BindDataSub(this.hdnRowValue.Value);
                    return;
                }
                if (State > 1)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "单号已经作业,不能再进行盘库作业。");
                    BindDataSub(this.hdnRowValue.Value);
                    return;
                }

                strColorCode += "'" + hk + "',";
            }
        }

        strColorCode += "'-1'";
        if (strColorCode.Replace("'-1','-1'", "").Trim().Length == 0)
        {
            JScript.Instance.ShowMessage(this.UpdatePanel1, "请选择单据!");
            SetGridViewEmptyRow(GridView1, (DataTable)ViewState[FormID + "_MainFormData"]);
            BindDataSub(this.hdnRowValue.Value);
            return;
        }
        try
        {

            bll.ExecNonQueryTran("WMS.SpInventoryStockTask", new DataParameter[] { new DataParameter("@strWhere", strColorCode), new DataParameter("@UserName", Session["EmployeeCode"].ToString()) });

            AddOperateLog("盘库单", "盘库作业单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
            DataTable dt = SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
            SetBindDataSub(dt);
        }
        catch (Exception ex)
        {
            BindDataSub(this.hdnRowValue.Value);
            JScript.Instance.ShowMessage(this.UpdatePanel1, ex.Message);

        }
    }
Exemple #24
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";

        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                string hk = this.GridView1.Rows[i].Cells[1].Text;
                //判断能否删除
                int State = int.Parse(bll.GetFieldValue("WMS_BillMaster", "State", string.Format("BillID='{0}'", hk)));
                if (State == 0)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "单号还未审核不能作业,请审核后,再进行入库作业。");
                    BindDataSub(this.hdnRowValue.Value);
                    return;
                }
                if (State > 1)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "单号已经作业,不能再进行入库作业。");
                    BindDataSub(this.hdnRowValue.Value);
                    return;
                }

                strColorCode += "'" + hk + "',";
            }
        }

        strColorCode += "'-1'";
        if (strColorCode.Replace("'-1','-1'", "").Trim().Length == 0)
        {
            JScript.Instance.ShowMessage(this.UpdatePanel1, "请选择单据!");
            SetGridViewEmptyRow(GridView1, (DataTable)ViewState[FormID + "_MainFormData"]);
            BindDataSub(this.hdnRowValue.Value);
            return;
        }
        try
        {
            bll.ExecNonQueryTran("WMS.SpInstockTask", new DataParameter[] { new DataParameter("@strWhere", strColorCode), new DataParameter("@UserName", Session["EmployeeCode"].ToString()) });

            AddOperateLog("入库单", "入库作业单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
            DataTable dt = SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
            SetBindDataSub(dt);
        }
        catch (Exception ex)
        {
            BindDataSub(this.hdnRowValue.Value);
            JScript.Instance.ShowMessage(this.UpdatePanel1, ex.Message);
        }
    }
Exemple #25
0
    private void BindOther()
    {
        BLL.BLLBase bll         = new BLL.BLLBase();
        DataTable   ProductType = bll.FillDataTable("Cmd.SelectProductCategory", new DataParameter[] { new DataParameter("{0}", " IsFixed<>'1'") });
        DataRow     dr          = ProductType.NewRow();

        dr["CategoryCode"] = "";
        dr["CategoryName"] = "请选择";
        ProductType.Rows.InsertAt(dr, 0);
        ProductType.AcceptChanges();

        this.ddlProductType.DataValueField = "CategoryCode";
        this.ddlProductType.DataTextField  = "CategoryName";
        this.ddlProductType.DataSource     = ProductType;
        this.ddlProductType.DataBind();
    }
Exemple #26
0
    public void InitSmartTree()
    {
        this.sTreeModule.Nodes.Clear();
        try
        {
            string strUserName = Session["G_User"].ToString();
            BLL.BLLBase bll = new BLL.BLLBase();
            DataTable dtModules = bll.FillDataTable("Security.SelectUserOperateModule", new DataParameter[] { new DataParameter("@UserName", strUserName) });
            DataTable dtSubModules = bll.FillDataTable("Security.SelectUserOperateSubModule", new DataParameter[] { new DataParameter("@UserName", strUserName) });

            foreach (DataRow dr in dtModules.Rows)
            {
                TreeNode tnRoot = new TreeNode(dr["MenuTitle"].ToString(), dr["ID"].ToString());
                tnRoot.SelectAction = TreeNodeSelectAction.Expand;
                tnRoot.ShowCheckBox = true;
                this.sTreeModule.Nodes.Add(tnRoot);
            }

            if (dtModules.Rows.Count > 0)
            {
                foreach (DataRow drSub in dtSubModules.Rows)
                {
                    for (int i = 0; i < sTreeModule.Nodes.Count; i++)
                    {
                        if (sTreeModule.Nodes[i].Text == drSub["MenuParent"].ToString())
                        {
                            TreeNode tnChild = new TreeNode(drSub["MenuTitle"].ToString(), drSub["ID"].ToString());
                            tnChild.ShowCheckBox = true;
                            tnChild.SelectAction = TreeNodeSelectAction.Expand;
                            this.sTreeModule.Nodes[i].ChildNodes.Add(tnChild);
                            break;
                        }
                    }
                }
            }
        }
        catch (Exception e)
        {
            Session["ModuleName"] = "浏览公共模块";
            Session["FunctionName"] = "Page_Load";
            Session["ExceptionalType"] = e.GetType().FullName;
            Session["ExceptionalDescription"] = e.Message;
            Response.Redirect("~/Common/MistakesPage.aspx");
        }
    }
Exemple #27
0
    public void InitSmartTree()
    {
        this.sTreeModule.Nodes.Clear();
        try
        {
            string      strUserName  = Session["G_User"].ToString();
            BLL.BLLBase bll          = new BLL.BLLBase();
            DataTable   dtModules    = bll.FillDataTable("Security.SelectUserOperateModule", new DataParameter[] { new DataParameter("@UserName", strUserName) });
            DataTable   dtSubModules = bll.FillDataTable("Security.SelectUserOperateSubModule", new DataParameter[] { new DataParameter("@UserName", strUserName) });

            foreach (DataRow dr in dtModules.Rows)
            {
                TreeNode tnRoot = new TreeNode(dr["MenuTitle"].ToString(), dr["ID"].ToString());
                tnRoot.SelectAction = TreeNodeSelectAction.Expand;
                tnRoot.ShowCheckBox = true;
                this.sTreeModule.Nodes.Add(tnRoot);
            }

            if (dtModules.Rows.Count > 0)
            {
                foreach (DataRow drSub in dtSubModules.Rows)
                {
                    for (int i = 0; i < sTreeModule.Nodes.Count; i++)
                    {
                        if (sTreeModule.Nodes[i].Text == drSub["MenuParent"].ToString())
                        {
                            TreeNode tnChild = new TreeNode(drSub["MenuTitle"].ToString(), drSub["ID"].ToString());
                            tnChild.ShowCheckBox = true;
                            tnChild.SelectAction = TreeNodeSelectAction.Expand;
                            this.sTreeModule.Nodes[i].ChildNodes.Add(tnChild);
                            break;
                        }
                    }
                }
            }
        }
        catch (Exception e)
        {
            Session["ModuleName"]             = "浏览公共模块";
            Session["FunctionName"]           = "Page_Load";
            Session["ExceptionalType"]        = e.GetType().FullName;
            Session["ExceptionalDescription"] = e.Message;
            Response.Redirect("~/Common/MistakesPage.aspx");
        }
    }
Exemple #28
0
        private void Main_Load(object sender, EventArgs e)
        {
            try
            {
                bll = new BLLBase();
                lbLog.Scrollable = true;
                Logger.OnLog    += new LogEventHandler(Logger_OnLog);
                context          = new Context();

                ContextInitialize initialize = new ContextInitialize();
                initialize.InitializeContext(context);



                System.Threading.Thread.Sleep(3000);
                if (Screen.PrimaryScreen.WorkingArea.Width > 1366)
                {
                    View.frmMonitor2 f = new View.frmMonitor2();
                    ShowForm(f);
                }
                else
                {
                    View.frmMonitor f = new View.frmMonitor();
                    ShowForm(f);
                }



                tmWorkTimer.Interval = 5000;
                tmWorkTimer.Elapsed += new System.Timers.ElapsedEventHandler(tmWorker);
                tmWorkTimer.Start();
            }
            catch (Exception ee)
            {
                Logger.Error("初始化处理失败请检查配置,原因:" + ee.Message);
            }



            MainData.OnTask += new TaskEventHandler(Data_OnTask);
            for (int i = 0; i < 3; i++)
            {
                ((DataGridViewAutoFilterTextBoxColumn)this.dgvMain.Columns[i]).FilteringEnabled = true;
            }
        }
Exemple #29
0
    private void BindOther()
    {
        BLL.BLLBase bll         = new BLL.BLLBase();
        DataTable   ProductType = bll.FillDataTable("Cmd.SelectProductCategory", new DataParameter[] { new DataParameter("{0}", "cmd.AreaCode='001' AND IsFixed !='1'") });
        DataRow     dr          = ProductType.NewRow();

        dr["CategoryCode"] = "";
        dr["CategoryName"] = "请选择";
        ProductType.Rows.InsertAt(dr, 0);
        ProductType.AcceptChanges();

        this.ddlProductType.DataValueField = "CategoryCode";
        this.ddlProductType.DataTextField  = "CategoryName";
        this.ddlProductType.DataSource     = ProductType;
        this.ddlProductType.DataBind();


        DataTable dtArea = bll.FillDataTable("Cmd.SelectArea");

        dr             = dtArea.NewRow();
        dr["AreaCode"] = "";
        dr["AreaName"] = "请选择";
        dtArea.Rows.InsertAt(dr, 0);
        dtArea.AcceptChanges();

        this.ddlArea.DataValueField = "AreaCode";
        this.ddlArea.DataTextField  = "AreaName";
        this.ddlArea.DataSource     = dtArea;
        this.ddlArea.DataBind();

        DataTable dtBillType = bll.FillDataTable("Cmd.SelectBillType", new DataParameter[] { new DataParameter("{0}", "BillTypeCode not in ('040','050')") });

        dr = dtBillType.NewRow();
        dr["BillTypeCode"] = "";
        dr["BillTypeName"] = "请选择";
        dtBillType.Rows.InsertAt(dr, 0);
        dtBillType.AcceptChanges();

        this.ddlBillType.DataValueField = "BillTypeCode";
        this.ddlBillType.DataTextField  = "BillTypeName";
        this.ddlBillType.DataSource     = dtBillType;
        this.ddlBillType.DataBind();
    }
Exemple #30
0
    protected void ddlAreaCode_SelectedIndexChanged(object sender, EventArgs e)
    {
        string AreaCode = ddlArea.SelectedValue;

        BLL.BLLBase bll         = new BLL.BLLBase();
        DataTable   ProductType = bll.FillDataTable("Cmd.SelectProductCategory", new DataParameter[] { new DataParameter("{0}", "cmd.AreaCode='" + AreaCode + "' AND IsFixed !='1'") });

        DataRow dr = ProductType.NewRow();

        dr["CategoryCode"] = "";
        dr["CategoryName"] = "请选择";
        ProductType.Rows.InsertAt(dr, 0);
        ProductType.AcceptChanges();

        this.ddlProductType.DataValueField = "CategoryCode";
        this.ddlProductType.DataTextField  = "CategoryName";
        this.ddlProductType.DataSource     = ProductType;
        this.ddlProductType.DataBind();
    }
Exemple #31
0
    protected void btnDeletet_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";

        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                //判断能否删除
                int Count = bll.GetRowCount("VUsed_WMS_BillMaster", string.Format("BillID='{0}'", hk.Text));
                if (Count > 0)
                {
                    JScript.ShowMessage(this.UpdatePanel1, hk.Text + "移库单号被其它单据使用,请调整后再删除!");
                    return;
                }

                strColorCode += "'" + hk.Text + "',";
            }
        }
        strColorCode += "'-1'";


        string[] comds = new string[2];
        comds[0] = "WMS.DeleteBillMaster";
        comds[1] = "WMS.DeleteBillDetail";
        List <DataParameter[]> paras = new List <DataParameter[]>();

        paras.Add(new DataParameter[] { new DataParameter("{0}", strColorCode) });
        paras.Add(new DataParameter[] { new DataParameter("{0}", string.Format("BillID in ({0})", strColorCode)) });
        bll.ExecTran(comds, paras);

        AddOperateLog("移库单", "删除单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
        this.hdnRowIndex.Value = "0";
        dvscrollX.Value        = "0";
        dvscrollY.Value        = "0";

        DataTable dt = SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);

        SetBindDataSub(dt);
    }
Exemple #32
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        BLL.BLLBase bll = new BLL.BLLBase();
        bll.ExecNonQuery("Security.DeleteQuickDestop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())) });

        foreach (TreeNode tnRoot in this.sTreeModule.Nodes)
        {
            foreach (TreeNode tnSub in tnRoot.ChildNodes)
            {
                if (tnSub.Checked)
                {
                    string strModuleID = tnSub.Value;

                    bll.ExecNonQuery("Security.InsertQuickDestop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())), new DataParameter("@ModuleID", strModuleID) });
                }
            }
        }

        JScript.Instance.ShowMessage(this, "设置成功!");
    }
Exemple #33
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        BLL.BLLBase bll = new BLL.BLLBase();
        bll.ExecNonQuery("Security.DeleteQuickDestop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())) });

        foreach (TreeNode tnRoot in this.sTreeModule.Nodes)
        {
            foreach (TreeNode tnSub in tnRoot.ChildNodes)
            {
                if (tnSub.Checked)
                {
                    string strModuleID = tnSub.Value;

                    bll.ExecNonQuery("Security.InsertQuickDestop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())), new DataParameter("@ModuleID", strModuleID) });
                }
            }
        }

        JScript.Instance.ShowMessage(this, "设置成功!");
    }
Exemple #34
0
    public ReturnData GetCellInfo(string xmlpara)
    {
        ReturnData rr = new ReturnData();

        try
        {
            DataTable dt       = Util.JsonHelper.Json2Dtb(xmlpara);
            string    CellCode = dt.Rows[0]["CellCode"].ToString();

            BLL.BLLBase bll    = new BLL.BLLBase();
            DataTable   dtCell = bll.FillDataTable("CMD.SelectWareHouseCellInfoByCell", new DataParameter[] { new DataParameter("@CellCode", CellCode) });
            string      str    = Util.JsonHelper.Dtb2Json(dtCell);
            rr.data = str;
            rr.type = "" + dtCell.GetType();
        }
        catch (Exception ex)
        {
        }

        return(rr);
    }
Exemple #35
0
    protected void btnDeletet_Click(object sender, EventArgs e)
    {
        string strColorCode = "'-1',";
        BLL.BLLBase bll = new BLL.BLLBase();
        for (int i = 0; i < this.GridView1.Rows.Count; i++)
        {
            CheckBox cb = (CheckBox)(this.GridView1.Rows[i].FindControl("cbSelect"));
            if (cb != null && cb.Checked)
            {
                HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                //判断能否删除
                int Count = bll.GetRowCount("VUsed_WMS_BillMaster", string.Format("BillID='{0}'", hk.Text));
                if (Count > 0)
                {
                    JScript.Instance.ShowMessage(this.UpdatePanel1, hk.Text + "移库单号被其它单据使用,请调整后再删除!");
                    return;
                }

                strColorCode += "'" + hk.Text + "',";
            }
        }
        strColorCode += "'-1'";

        string[] comds = new string[2];
        comds[0] = "WMS.DeleteBillMaster";
        comds[1] = "WMS.DeleteBillDetail";
        List<DataParameter[]> paras = new List<DataParameter[]>();
        paras.Add(new DataParameter[] { new DataParameter("{0}", strColorCode) });
        paras.Add(new DataParameter[] { new DataParameter("{0}", string.Format("BillID in ({0})", strColorCode)) });
        bll.ExecTran(comds, paras);

        AddOperateLog("移库单", "删除单号:" + strColorCode.Replace("'-1',", "").Replace(",'-1'", ""));
        this.hdnRowIndex.Value = "0";
        dvscrollX.Value = "0";
        dvscrollY.Value = "0";

        DataTable dt = SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
        SetBindDataSub(dt);
    }
Exemple #36
0
    public ReturnData autoCode(string xmlpara)
    {
        ReturnData rr = new ReturnData();

        try
        {
            BLL.BLLBase bll = new BLL.BLLBase();

            DataTable dt      = Util.JsonHelper.Json2Dtb(xmlpara);
            string    PreName = dt.Rows[0]["PreName"].ToString();
            string    dtTime  = dt.Rows[0]["dtTime"].ToString();
            string    Filter  = dt.Rows[0]["Filter"].ToString();

            string strCode = bll.GetAutoCode(PreName, DateTime.Parse(dtTime), Filter);
            rr.data = strCode;
            rr.type = "" + strCode.GetType();
        }
        catch (Exception ex)
        {
        }

        return(rr);
    }
Exemple #37
0
    private bool LoadRpt()
    {
        try
        {
            GetStrWhere();
            string frx   = "MoldStrokeTotal.frx";
            string Comds = "WMS.SelectProductAllWeight";
            if (rpt2.Checked)
            {
                strWhere += "and tmp.quantity>=product.Weight ";
            }
            if (rpt3.Checked)
            {
                strWhere += "and isnull(tmp.quantity,0)<product.Weight";
            }
            WebReport1.Report = new Report();
            WebReport1.Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + @"RptFiles\" + frx);

            BLL.BLLBase bll = new BLL.BLLBase();

            DataTable dt = bll.FillDataTable(Comds, new DataParameter[] { new DataParameter("{0}", strWhere) });



            if (dt.Rows.Count == 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('您所选择的条件没有资料!');", true);
            }

            WebReport1.Report.RegisterData(dt, "StrokeTotal");
        }
        catch (Exception ex)
        {
        }
        return(true);
    }
Exemple #38
0
 /// <summary>
 /// 添加操作日志
 /// </summary>
 /// <param name="moduleName">操作模块</param>
 /// <param name="executeOperation">操作内容</param>
 protected void AddOperateLog(string moduleName, string executeOperation)
 {
     BLL.BLLBase bll = new BLL.BLLBase();
     bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[] { new DataParameter("@LoginUser", Session["G_user"].ToString()), new DataParameter("@LoginTime", DateTime.Now),
                                                                          new DataParameter("@LoginModule", moduleName), new DataParameter("@ExecuteOperator", executeOperation) });
 }
Exemple #39
0
    protected void Page_PreLoad(object sender, EventArgs e)
    {
        #region 权限控制
        try
        {
            if (Session["SubModuleCode"] != null)
            {
                string[] path = this.Page.Request.Path.Split('/');
                if (path.Length > 0)
                {
                    if (path[path.Length - 1].IndexOf(FormID + "s", 0) >= 0) //s
                    {
                        if ((Button)Page.FindControl("btnAdd") != null)
                        {
                            ((Button)Page.FindControl("btnAdd")).Enabled = false;
                        }

                        if ((Button)Page.FindControl("btnDelete") != null)
                        {
                            ((Button)Page.FindControl("btnDelete")).Enabled = false;
                        }

                        if ((Button)Page.FindControl("btnPrint") != null)
                        {
                            ((Button)Page.FindControl("btnPrint")).Enabled = false;
                        }
                    }
                    if (path[path.Length - 1].IndexOf(FormID + "View", 0) >= 0)
                    {
                        if ((Button)Page.FindControl("btnAdd") != null)
                        {
                            ((Button)Page.FindControl("btnAdd")).Enabled = false;
                        }

                        if ((Button)Page.FindControl("btnDelete") != null)
                        {
                            ((Button)Page.FindControl("btnDelete")).Enabled = false;
                        }
                        if ((Button)Page.FindControl("btnEdit") != null)
                        {
                            ((Button)Page.FindControl("btnEdit")).Enabled = false;
                        }

                        if ((Button)Page.FindControl("btnPrint") != null)
                        {
                            ((Button)Page.FindControl("btnPrint")).Enabled = false;
                        }
                    }
                }

                if (Session["DT_UserOperation"] == null)
                {
                    BLL.BLLBase bll      = new BLL.BLLBase();
                    int         iGroupID = int.Parse(Session["GroupID"].ToString());
                    DataTable   dt       = bll.FillDataTable("Security.SelectGroupRole", new DataParameter[] { new DataParameter("@GroupID", iGroupID), new DataParameter("@SystemName", "WMS") });
                    Session["DT_UserOperation"] = dt;
                }

                DataTable dtOP = (DataTable)(Session["DT_UserOperation"]);
                DataRow[] drs  = dtOP.Select(string.Format("SubModuleCode='{0}'", Session["SubModuleCode"].ToString()));


                foreach (DataRow dr in drs)
                {
                    Session["SubModuleTitle"] = drs[0]["MenuTitle"].ToString();
                    SubModuleTitle            = Session["SubModuleTitle"].ToString();
                    int op = int.Parse(dr["OperatorCode"].ToString());
                    switch (op)
                    {
                    case 0:
                        if ((Button)Page.FindControl("btnAdd") != null)
                        {
                            ((Button)Page.FindControl("btnAdd")).Enabled = true;
                        }
                        break;

                    case 1:
                        if ((Button)Page.FindControl("btnDelete") != null)
                        {
                            ((Button)Page.FindControl("btnDelete")).Enabled = true;
                        }
                        break;

                    case 2:     //修改
                        if ((HiddenField)Page.FindControl("hdnXGQX") != null)
                        {
                            ((HiddenField)Page.FindControl("hdnXGQX")).Value = "1";
                        }
                        if ((Button)Page.FindControl("btnEdit") != null)
                        {
                            ((Button)Page.FindControl("btnEdit")).Enabled = true;
                        }
                        break;


                    case 3:     //打印
                        if ((Button)Page.FindControl("btnPrint") != null)
                        {
                            ((Button)Page.FindControl("btnPrint")).Enabled = true;
                        }
                        break;

                    case 4:     //抛出
                        if ((Button)Page.FindControl("btnExport") != null)
                        {
                            ((Button)Page.FindControl("btnExport")).Enabled = true;
                        }
                        break;

                    case 5:     //审核
                        if ((Button)Page.FindControl("btnCheck") != null)
                        {
                            ((Button)Page.FindControl("btnCheck")).Enabled = true;
                        }
                        break;

                    case 6:     //二审
                        if ((Button)Page.FindControl("btnReCheck") != null)
                        {
                            ((Button)Page.FindControl("btnReCheck")).Enabled = true;
                        }
                        break;

                    case 7:     //关闭
                        if ((Button)Page.FindControl("btnClose") != null)
                        {
                            ((Button)Page.FindControl("btnClose")).Enabled = true;
                        }
                        break;

                    case 10:
                        if ((Button)Page.FindControl("btnUpdateClearing") != null)
                        {
                            ((Button)Page.FindControl("btnUpdateClearing")).Enabled = true;
                        }
                        break;

                    default: break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            JScript.Instance.ShowMessage(Page, ex.Message);
        }

        #endregion
    }
Exemple #40
0
 private void QuickDestopBind()
 {
     BLL.BLLBase bll = new BLL.BLLBase();
     DataTable dtOP = bll.FillDataTable("Security.SelectUserQuickDesktop", new DataParameter[] { new DataParameter("@UserID", Convert.ToInt32(Session["UserID"].ToString())) });
     foreach (TreeNode tnRoot in this.sTreeModule.Nodes)
     {
         bool IsAllSelected = false;
         foreach (TreeNode tnSub in tnRoot.ChildNodes)
         {
             tnSub.Checked = false;
             DataRow[] drs = dtOP.Select(string.Format("ModuleID={0}", tnSub.Value));
             if (drs.Length > 0)
             {
                 tnSub.Checked = true;
             }
             if (tnSub.Checked)
             {
                 IsAllSelected = true;
             }
         }
         if (IsAllSelected)
         {
             tnRoot.Checked = true;
         }
     }
 }
Exemple #41
0
    public ReturnData strBaseData(string xmlpara)
    {
        ReturnData rr = new ReturnData();

        DataTable dt = Util.JsonHelper.Json2Dtb(xmlpara);

        string strWhere = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["strWhere"].ToString());

        string strFieldName = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["strFieldName"].ToString());
        string TableName = Microsoft.JScript.GlobalObject.unescape(dt.Rows[0]["TableName"].ToString()); ;
        if (strFieldName == "")
            strFieldName = "*";

        BLL.BLLBase bll = new BLL.BLLBase();
        dt = bll.FillDataTable("Security.SelectFieldValue", new DataParameter[] { new DataParameter("{0}", TableName), new DataParameter("{1}", strFieldName), new DataParameter("{2}", strWhere) });

        rr.data = Util.JsonHelper.Dtb2Json(dt);
        rr.type = "" + dt.GetType();

        return rr;
    }
Exemple #42
0
 private void GetDestopItemByUserID(string UserID)
 {
     BLL.BLLBase bll = new BLL.BLLBase();
     dtDestopItem = bll.FillDataTable("Security.SelectUserQuickDesktop", new DataParameter[] { new DataParameter("@UserID", UserID) });
     iTableCount  = dtDestopItem.Rows.Count;
 }
Exemple #43
0
    //主表显示
    public DataTable SetBtnEnabled(int PageIndex, string SqlCmd, string Filter, int pageSize, GridView dgview, LinkButton btnFirst, LinkButton btnPre, LinkButton btnNext, LinkButton btnLast, LinkButton btnToPage, Label lblCurrentPage, UpdatePanel UpdatePanel1)
    {
        int pageCount = 0;
        int totalCount = 0;
        BLL.BLLBase bll = new BLL.BLLBase();
        DataTable dtView = bll.GetDataPage(SqlCmd, PageIndex, pageSize, out totalCount, out pageCount, new DataParameter[] { new DataParameter("{0}", Filter) });

        if (ViewState["CurrentPage"].ToString() == "0" || int.Parse(ViewState["CurrentPage"].ToString()) > pageCount)
            ViewState["CurrentPage"] = pageCount;

        if (dtView.Rows.Count == 0)
        {
            SetGridViewEmptyRow(dgview, dtView);

            btnFirst.Enabled = false;
            btnPre.Enabled = false;
            btnNext.Enabled = false;
            btnLast.Enabled = false;
            btnToPage.Enabled = false;
            lblCurrentPage.Visible = false;

        }
        else
        {
            dgview.DataSource = dtView;
            dgview.DataBind();

            btnLast.Enabled = true;
            btnFirst.Enabled = true;
            btnToPage.Enabled = true;

            if (int.Parse(ViewState["CurrentPage"].ToString()) > 1)
                btnPre.Enabled = true;
            else
                btnPre.Enabled = false;

            if (int.Parse(ViewState["CurrentPage"].ToString()) < pageCount)
                btnNext.Enabled = true;
            else
                btnNext.Enabled = false;

            lblCurrentPage.Visible = true;
            lblCurrentPage.Text = "共 [" + totalCount.ToString() + "] 笔记录  第 [" + ViewState["CurrentPage"] + "] 页  共 [" + pageCount.ToString() + "] 页";

        }
        ViewState[FormID + "_MainFormData"] = dtView;
        return dtView;
    }
Exemple #44
0
    public ReturnData GetCellInfo(string xmlpara)
    {
        ReturnData rr = new ReturnData();
        try
        {
            DataTable dt = Util.JsonHelper.Json2Dtb(xmlpara);
            string CellCode = dt.Rows[0]["CellCode"].ToString();

            BLL.BLLBase bll = new BLL.BLLBase();
            DataTable dtCell = bll.FillDataTable("CMD.SelectWareHouseCellInfoByCell", new DataParameter[] { new DataParameter("@CellCode", CellCode) });
            string str = Util.JsonHelper.Dtb2Json(dtCell);
            rr.data = str;
            rr.type = "" + dtCell.GetType();
        }
        catch (Exception ex)
        {

        }

        return rr;
    }
    private bool LoadRpt()
    {
        try
        {
            GetStrWhere();
            string frx = "ProductDetailQuery.frx";
            string Comds = "WMS.SelectProductDetailQuery";

            if (rpt2.Checked)
            {
                frx = "ProductTotalQuery.frx";
                Comds = "WMS.SelectProductTotalQuery";

            }
            WebReport1.Report = new Report();
            WebReport1.Report.Load(System.AppDomain.CurrentDomain.BaseDirectory + @"RptFiles\" + frx);

            BLL.BLLBase bll = new BLL.BLLBase();

            DataTable dt = bll.FillDataTable(Comds, new DataParameter[] { new DataParameter("{0}", strWhere) });

            if (dt.Rows.Count == 0)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('您所选择的条件没有资料!');", true);
            }

            WebReport1.Report.RegisterData(dt, "ProductQuery");
        }
        catch (Exception ex)
        {
        }
        return true;
    }
    //货架显示图;
    protected Table CreateShelfChart(string AreaCode, string shelfCode)
    {
        BLL.BLLBase bll = new BLL.BLLBase();

        string strWhere = "";
        if (AreaCode == "")
            strWhere = string.Format("ShelfCode='{0}'", shelfCode);
        else
            strWhere = string.Format("ShelfCode='{0}' and AreaCode='{1}'", shelfCode, AreaCode);

        DataTable ShelfCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByShelf", new DataParameter[] { new DataParameter("{0}", strWhere) });

        int Rows = int.Parse(ShelfCell.Rows[0]["Rows"].ToString());
        int Columns = 45;
        string Width = "2%";

        Table tb = new Table();
        string tbstyle = "width:100%";
        tb.Attributes.Add("style", tbstyle);
        //tb.Attributes.Add("display", "table-cell");
        for (int i = Rows; i >= 1; i--)
        {
            TableRow row = new TableRow();
            for (int j = 1; j <=Columns; j++)
            {
                //if (j == 1)
                //{
                //    if (shelfCode == "001002" || shelfCode == "001003" || shelfCode == "001004" || shelfCode == "001006" || shelfCode == "001007" || shelfCode == "001010" || shelfCode == "001011")
                //    {
                //        TableCell cellAdd = new TableCell();
                //        cellAdd.Attributes.Add("style", "height:25px;width:" + Width + ";border:0px solid #008B8B");
                //        row.Cells.Add(cellAdd);
                //    }
                //}

                if (AreaCode == "")
                    strWhere = string.Format("CellRow={0} and CellColumn={1}", i, j);
                else
                    strWhere = string.Format("CellRow={0} and CellColumn={1} and AreaCode='{2}'", i, j, AreaCode);

                DataRow[] drs = ShelfCell.Select(strWhere, "");
                if (drs.Length > 0)
                {
                    TableCell cell = new TableCell();
                    cell.ID = drs[0]["CellCode"].ToString();

                    string style = "height:25px;width:" + Width + ";border:2px solid #008B8B;";
                    string backColor = ReturnColorFlag(drs[0]["ProductCode"].ToString(), drs[0]["IsActive"].ToString(), drs[0]["IsLock"].ToString(), drs[0]["ErrorFlag"].ToString(), ToYMD(drs[0]["InDate"]));
                    if (drs[0]["ProductCode"].ToString() != "")
                    {
                        style += "background-color:" + backColor + ";";
                    }

                    cell.Attributes.Add("style", style);
                    cell.Attributes.Add("onclick", "ShowCellInfo('" + cell.ID + "');");
                    row.Cells.Add(cell);
                }
                else
                {
                    TableCell cell = new TableCell();
                    string style = "height:25px;width:" + Width + ";border:0px solid #008B8B";

                    cell.Attributes.Add("style", style);

                    row.Cells.Add(cell);
                }
                if (j == Columns)
                {
                    //if (shelfCode == "001002" || shelfCode == "001003" || shelfCode == "001004" || shelfCode =="001006"||shelfCode == "001007"||shelfCode == "001010" ||shelfCode == "001011")
                    //{
                    //    TableCell cellAdd = new TableCell();
                    //    cellAdd.Attributes.Add("style", "height:25px;width:" + Width + ";border:0px solid #008B8B");
                    //    row.Cells.Add(cellAdd);
                    //}
                    TableCell cellTag = new TableCell();
                    cellTag.Attributes.Add("style", "height:25px;border:0px solid #008B8B");
                    cellTag.Attributes.Add("align", "right");
                    cellTag.Text = "<font color=\"#008B8B\"> 第" + int.Parse(shelfCode.Substring(3, 3)).ToString() + "排第" + i.ToString() + "层</font>";
                    row.Cells.Add(cellTag);
                }

            }
            tb.Rows.Add(row);

            if (i == 1)
            {
                TableRow rowNum = new TableRow();
                for (int j = 1; j <= Columns; j++)
                {
                    string K = j.ToString();
                    if (j == 1 )
                    {
                        if (shelfCode == "001002" || shelfCode == "001003"  || shelfCode == "001006" || shelfCode == "001007" || shelfCode == "001010" || shelfCode == "001011")
                        {

                            TableCell cellNum1 = new TableCell();
                            cellNum1.Attributes.Add("style", "height:40px;width:" + Width.ToString() + "px;border:0px solid #008B8B");
                            cellNum1.Attributes.Add("align", "center");
                            cellNum1.Attributes.Add("Valign", "top");
                            rowNum.Cells.Add(cellNum1);

                            continue;
                        }
                    }

                    TableCell cellNum = new TableCell();
                    cellNum.Attributes.Add("style", "height:40px;width:" + Width.ToString() + "px;border:0px solid #008B8B");
                    cellNum.Attributes.Add("align", "center");
                    cellNum.Attributes.Add("Valign", "top");
                    cellNum.Text = "<font color=\"#008B8B\">" + K  + "</font>";

                    rowNum.Cells.Add(cellNum);

                    //if (j == Columns)
                    //{
                    //    if (shelfCode == "001002" || shelfCode == "001003" || shelfCode == "001004" || shelfCode == "001006" || shelfCode == "001007" || shelfCode == "001010" || shelfCode == "001011")
                    //    {

                    //        TableCell cellNum1 = new TableCell();
                    //        cellNum1.Attributes.Add("style", "height:40px;width:" + Width.ToString() + "px;border:0px solid #008B8B");
                    //        cellNum1.Attributes.Add("align", "center");
                    //        cellNum1.Attributes.Add("Valign", "top");
                    //        rowNum.Cells.Add(cellNum1);
                    //    }

                    //}

                }
                tb.Rows.Add(rowNum);

            }

        }
        return tb;
    }
Exemple #47
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        //测试
        Request.Cookies.Clear();
        if (txtUserName.Text.Trim() != "")
        {
            try
            {
                string key = txtUserName.Text.ToLower();
                string UserCache = Convert.ToString(Cache[key]);

                UserBll userBll = new UserBll();

                DataTable dtUserList = userBll.GetUserInfo(txtUserName.Text.Trim());
                if (dtUserList != null && dtUserList.Rows.Count > 0)
                {
                    if (dtUserList.Rows[0]["UserPassword"].ToString().Trim() == txtPassWord.Text.Trim())
                    {
                        FormsAuthentication.SetAuthCookie(this.txtUserName.Text, false);

                        Session["UserID"] = dtUserList.Rows[0]["UserID"].ToString();
                        Session["GroupID"] = dtUserList.Rows[0]["GroupID"].ToString();
                        Session["G_user"] = dtUserList.Rows[0]["UserName"].ToString();

                        string EmployeeCode = dtUserList.Rows[0]["EmployeeCode"].ToString();

                        Session["EmployeeCode"] = dtUserList.Rows[0]["EmployeeCode"].ToString();
                        #region 添加登录日志

                        BLL.BLLBase bll = new BLL.BLLBase();
                        bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[]{new DataParameter("@LoginUser", Session["G_user"].ToString()),new DataParameter("@LoginTime",DateTime.Now),
                                                         new DataParameter("@LoginModule","登录系统"),new DataParameter("@ExecuteOperator","用户登录")});

                        #endregion
                        TimeSpan stLogin = new TimeSpan(0, 0, System.Web.HttpContext.Current.Session.Timeout, 0, 0);
                        HttpContext.Current.Cache.Insert(key, Page.Request.UserHostAddress, null, DateTime.MaxValue, stLogin, System.Web.Caching.CacheItemPriority.NotRemovable, null);

                        Response.Redirect("Default.aspx", false);
                    }
                    else
                    {
                        BLL.BLLBase bll = new BLL.BLLBase();
                        bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[]{new DataParameter("@LoginUser",this.txtUserName.Text.Trim()),new DataParameter("@LoginTime",DateTime.Now),
                                                         new DataParameter("@LoginModule","登录页面"),new DataParameter("@ExecuteOperator","登录(用户密码有误)")});
                        ltlMessage.Text = "对不起,您输入的密码有误!";
                    }
                }
                else
                {
                    ltlMessage.Text = "对不起,您输入的用户名不存在!";
                }

            }
            catch (Exception exp)
            {
                ltlMessage.Text = exp.Message;
            }
        }
        else
        {
            ltlMessage.Text = "请输入用户名!";
        }
    }
Exemple #48
0
    protected void Page_PreLoad(object sender, EventArgs e)
    {
        #region 权限控制
        try
        {
            if (Session["SubModuleCode"] != null)
            {
                string[] path = this.Page.Request.Path.Split('/');
                if (path.Length > 0)
                {
                    if (path[path.Length - 1].IndexOf(FormID + "s", 0) >= 0) //s
                    {
                        if ((Button)Page.FindControl("btnAdd") != null)
                            ((Button)Page.FindControl("btnAdd")).Enabled = false;

                        if ((Button)Page.FindControl("btnDelete") != null)
                            ((Button)Page.FindControl("btnDelete")).Enabled = false;

                        if ((Button)Page.FindControl("btnPrint") != null)
                            ((Button)Page.FindControl("btnPrint")).Enabled = false;

                    }
                    if (path[path.Length - 1].IndexOf(FormID + "View", 0) >= 0)
                    {
                        if ((Button)Page.FindControl("btnAdd") != null)
                            ((Button)Page.FindControl("btnAdd")).Enabled = false;

                        if ((Button)Page.FindControl("btnDelete") != null)
                            ((Button)Page.FindControl("btnDelete")).Enabled = false;
                        if ((Button)Page.FindControl("btnEdit") != null)
                            ((Button)Page.FindControl("btnEdit")).Enabled = false;

                        if ((Button)Page.FindControl("btnPrint") != null)
                            ((Button)Page.FindControl("btnPrint")).Enabled = false;

                    }
                }

                if (Session["DT_UserOperation"] == null)
                {
                    BLL.BLLBase bll = new BLL.BLLBase();
                    int iGroupID = int.Parse(Session["GroupID"].ToString());
                    DataTable dt = bll.FillDataTable("Security.SelectGroupRole", new DataParameter[] { new DataParameter("@GroupID", iGroupID), new DataParameter("@SystemName", "WMS") });
                    Session["DT_UserOperation"] = dt;
                }

                DataTable dtOP = (DataTable)(Session["DT_UserOperation"]);
                DataRow[] drs = dtOP.Select(string.Format("SubModuleCode='{0}'", Session["SubModuleCode"].ToString()));

                foreach (DataRow dr in drs)
                {
                    Session["SubModuleTitle"] = drs[0]["MenuTitle"].ToString();
                    SubModuleTitle = Session["SubModuleTitle"].ToString();
                    int op = int.Parse(dr["OperatorCode"].ToString());
                    switch (op)
                    {
                        case 0:
                            if ((Button)Page.FindControl("btnAdd") != null)
                            {
                                ((Button)Page.FindControl("btnAdd")).Enabled = true;
                            }
                            break;
                        case 1:
                            if ((Button)Page.FindControl("btnDelete") != null)
                            {
                                ((Button)Page.FindControl("btnDelete")).Enabled = true;
                            }
                            break;
                        case 2: //修改
                            if ((HiddenField)Page.FindControl("hdnXGQX") != null)
                            {
                                ((HiddenField)Page.FindControl("hdnXGQX")).Value = "1";
                            }
                            if ((Button)Page.FindControl("btnEdit") != null)
                            {
                                ((Button)Page.FindControl("btnEdit")).Enabled = true;
                            }
                            break;

                        case 3: //打印
                            if ((Button)Page.FindControl("btnPrint") != null)
                            {
                                ((Button)Page.FindControl("btnPrint")).Enabled = true;
                            } break;
                        case 4: //抛出
                            if ((Button)Page.FindControl("btnExport") != null)
                            {
                                ((Button)Page.FindControl("btnExport")).Enabled = true;
                            } break;
                        case 5: //审核
                            if ((Button)Page.FindControl("btnCheck") != null)
                            {
                                ((Button)Page.FindControl("btnCheck")).Enabled = true;
                            }
                            break;
                        case 6: //二审
                            if ((Button)Page.FindControl("btnReCheck") != null)
                            {
                                ((Button)Page.FindControl("btnReCheck")).Enabled = true;
                            } break;
                        case 7: //关闭
                            if ((Button)Page.FindControl("btnClose") != null)
                            {
                                ((Button)Page.FindControl("btnClose")).Enabled = true;
                            } break;
                        case 10:
                            if ((Button)Page.FindControl("btnUpdateClearing") != null)
                            {
                                ((Button)Page.FindControl("btnUpdateClearing")).Enabled = true;
                            } break;
                        default: break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            JScript.Instance.ShowMessage(Page, ex.Message);
        }

        #endregion
    }
Exemple #49
0
 /// <summary>
 /// 添加操作日志
 /// </summary>
 /// <param name="moduleName">操作模块</param>
 /// <param name="executeOperation">操作内容</param>
 protected void AddOperateLog(string moduleName, string executeOperation)
 {
     BLL.BLLBase bll = new BLL.BLLBase();
     bll.ExecNonQuery("Security.InsertOperatorLog", new DataParameter[]{new DataParameter("@LoginUser",Session["G_user"].ToString()),new DataParameter("@LoginTime",DateTime.Now),
                                                      new DataParameter("@LoginModule",moduleName),new DataParameter("@ExecuteOperator",executeOperation)});
 }
Exemple #50
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (Session["IsFirstLogin"] != null)
        //{
        //    if (Session["IsFirstLogin"].ToString() == "1")
        //    {
        //    }
        //    else
        //    {
        if (!IsPostBack)
        {
            GC.Collect();
            Response.ExpiresAbsolute = DateTime.Now;
            try
            {
                //string str = "<script> " +
                //             "try " +
                //             "{ " +
                //             " var nav=window.parent.frames.Navigation.document.getElementById('labNavigation');" +
                //             " nav.innerText='快速通道';" +
                //             "} " +
                //             "catch(e) " +
                //             "{ " +
                //             "} " +
                //             "</script>";
                //this.ClientScript.RegisterClientScriptBlock(this.GetType(), DateTime.Now.ToLongTimeString(), str);

                if (Session["UserID"] != null)
                {
                    GetDestopItemByUserID(Session["UserID"].ToString());
                }
                else
                {
                    Response.Write("<script language=javascript>parent.parent.parent.location.href='../../WebUI/Start/SessionTimeOut.aspx';</script>");
                    Response.End();
                    return;

                    //Response.Redirect("../../WebUI/Start/SessionTimeOut.aspx");
                }
                CreatePage();


                #region 提醒
                BLL.BLLBase bll    = new BLL.BLLBase();
                DataTable   dt     = bll.FillDataTable("WMS.SelectProductOutWeight");
                string      strMsg = "";
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    strMsg += Environment.NewLine + "模具编号:" + dt.Rows[i]["ProductCode"].ToString() + " 标准冲程:" + dt.Rows[i]["Weight"].ToString() + " 总冲程数:" + dt.Rows[i]["quantity"].ToString();
                }
                if (strMsg.Length > 0)
                {
                    string str = "以下模具总冲程数超过标准冲程:" + strMsg;
                    hdnMsg.Value = str.TrimEnd();
                    //JScript.ShowMessage(this, str);
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "showMsg", "ShowFormMsg('hdnMsg');", true);
                    // ScriptManager.RegisterStartupScript(this, this.GetType(), "showMsg", "alert('" + str + "')", true);
                }
                #endregion
            }
            catch (Exception ex)
            {
                //Session["ModuleName"] = "MainPage.aspx";
                //Session["FunctionName"] = "Page_Load事件";
                //Session["ExceptionalType"] = ex.GetType().FullName;
                //Session["ExceptionalDescription"] = ex.Message;
                //Response.Redirect("Common/MistakesPage.aspx");
            }
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            var id  = Request.QueryString["CID"];
            var sid = Request.QueryString["SID"];
            var pid = Request.QueryString["Pid"];

            if (id == null)
            {
                Response.Redirect("/Default.aspx");
                return;
            }

            var ctx = new DataContext();
            var bll = new BLL.BLLBase();

            Config = bll.Select(ctx, new GlobeConfig()
            {
                Code = "SiteName"
            }).ToList <Model.GlobeConfig>()[0];

            var channelTB = bll.Select(ctx, new Model.Channel()
            {
                ID = Convert.ToInt32(id), State = 0
            });

            if (channelTB != null && channelTB.Rows.Count > 0)
            {
                channel = channelTB.ToList <Model.Channel>()[0];
            }
            subChannels =
                bll.Select(ctx, new Model.Channel()
            {
                ParentId = Convert.ToInt16(id), State = 0
            })
                .ToList <Model.Channel>()
                .OrderBy(c => c.Sort)
                .ToList();

            subChannels = subChannels ?? new List <Model.Channel>();

            if (pid != null) //单独网页
            {
                var tb = bll.Select(ctx, new Model.Content()
                {
                    ID = Convert.ToInt32(pid), State = 0
                });
                if (tb != null && tb.Rows.Count > 0)
                {
                    Contents = tb.ToList <Model.Content>();
                }
            }
            else if (sid != null) //单独栏目
            {
                var channel = subChannels.Find(ch => ch.ID == Convert.ToInt32(sid));
                if (channel != null)
                {
                    //0--单独内容页,1--内容列表页
                    if (channel.Type == 0)
                    {
                        var tb =
                            ctx.ExecuteDataTable(
                                "Select top 1 * From Content where State!=255 and ChannelID=" + channel.ID
                                + " Order by ID desc");

                        if (tb != null)
                        {
                            Contents = tb.ToList <Model.Content>();
                        }
                    }
                    else
                    {
                        //内容列表页
                        Contents = new List <Model.Content>();
                        var models = new BLL.Content().GetChannelContentList(ctx, channel.ID);
                        if (models != null && models.Count > 0)
                        {
                            Contents.AddRange(models);
                        }
                    }
                }
            }
            else //顶级栏目
            {
                //若为独立页面栏目
                if (channel.Type == 0)
                {
                    var content = new BLL.Content().GetSinplePageChannelContent(ctx, channel.ID);

                    if (content != null)
                    {
                        Contents = new List <Model.Content> {
                            content
                        };
                    }
                }
                else //内容列表栏目或栏目列表页
                {
                    //默认取第一栏目的内容
                    if (subChannels.Count > 0)
                    {
                        var subChannel = subChannels[0];

                        if (subChannel.Type == 0) //内容页
                        {
                            var content = new BLL.Content().GetSinplePageChannelContent(ctx, subChannel.ID);

                            if (content != null)
                            {
                                Contents = new List <Model.Content> {
                                    content
                                };
                            }
                        }
                        else //内容列表页
                        {
                            Contents = new List <Model.Content>();
                            var models = new BLL.Content().GetChannelContentList(ctx, subChannel.ID);
                            if (models != null && models.Count > 0)
                            {
                                Contents.AddRange(models);
                            }
                        }
                    }
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     string WareHouse = Request.QueryString["WareHouse"].ToString();
     string ShelfCode = Request.QueryString["ShelfCode"].ToString();
     string AreaCode = Request.QueryString["AreaCode"].ToString();
     BLL.BLLBase bll = new BLL.BLLBase();
     writeJsvar("", "", "");
     DataTable tableCell;
     if (WareHouse != "" && AreaCode == "")
     {
         tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByWareHouse", new DataParameter[] { new DataParameter("@WareHouse", WareHouse) });
         ShowWareHouseChart(tableCell);
     }
     else if (AreaCode != "" && ShelfCode == "")
     {
         tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByArea", new DataParameter[] { new DataParameter("@AreaCode", AreaCode) });
         ShowCellChart(tableCell);
     }
     else
     {
         tableCell = bll.FillDataTable("CMD.SelectWareHouseCellQueryByShelf", new DataParameter[] { new DataParameter("{0}", string.Format("ShelfCode='{0}' and AreaCode='{1}'", ShelfCode, AreaCode)) });
         ShowCellChart(tableCell);
     }
     ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Resize", "resize();", true);
 }