Example #1
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         BLL.BLLBase bll = new BLL.BLLBase();
         if (drGroup != null)
         {
             int Count = bll.GetRowCount("sys_GroupList", string.Format("GroupID<>{0} and GroupName='{1}'", drGroup["GroupID"].ToString(), this.txtGroupName.Text.Trim()));
             if (Count > 0)
             {
                 MessageBox.Show("該用戶組名稱已經存在!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
             bll.ExecNonQuery("Security.UpdateGroupInfo", new DataParameter[] { new DataParameter("@GroupName", this.txtGroupName.Text.Trim()), new DataParameter("@Memo", this.txtMemo.Text.Trim()), new DataParameter("@GroupID", drGroup["GroupID"].ToString()) });
         }
         else
         {
             int Count = bll.GetRowCount("sys_GroupList", string.Format("GroupName='{0}'", this.txtGroupName.Text.Trim()));
             if (Count > 0)
             {
                 MessageBox.Show("該用戶組名稱已經存在!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 return;
             }
             bll.ExecNonQuery("Security.InsertGroup", new DataParameter[] { new DataParameter("@GroupName", this.txtGroupName.Text.Trim()), new DataParameter("@Memo", this.txtMemo.Text.Trim()), new DataParameter("@State", 1) });
         }
         this.DialogResult = DialogResult.OK;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Example #2
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;
        }
Example #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) });

            Session[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;
        }
Example #4
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_BillType", string.Format("BillTypeCode='{0}'", hk.Text));
                    if (Count > 0)
                    {
                        WMS.App_Code.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);
        }
Example #5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.txtUser.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入用户!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.txtPWD.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }


            BLL.BLLBase bll = new BLL.BLLBase();
            DataTable   dt  = bll.FillDataTable("WCS.SelectUser", new DataParameter[] { new DataParameter("{0}", this.txtUser.Text.Trim()), new DataParameter("{1}", this.txtPWD.Text.Trim()) });

            if (dt.Rows.Count > 0)
            {
                UserID            = this.txtUser.Text.Trim();
                this.DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("用户名或密码不正确!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #6
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)
                    {
                        WMS.App_Code.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'", ""));
            DataTable dt = SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, GridView1, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
            SetBindDataSub(dt);
        }
Example #7
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();

            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);
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    string strModuleName, strFunctionName, strExceptionalType, strExceptionalDescription;
                    strModuleName             = Session["ModuleName"].ToString();
                    strFunctionName           = Session["FunctionName"].ToString();
                    strExceptionalType        = Session["ExceptionalType"].ToString();
                    strExceptionalDescription = Session["ExceptionalDescription"].ToString();

                    labModuleName.Text             = strModuleName;
                    labFunctionName.Text           = strFunctionName;
                    labExceptionalType.Text        = strExceptionalType;
                    labExceptionalDescription.Text = strExceptionalDescription;

                    BLL.BLLBase bll = new BLL.BLLBase();
                    bll.ExecNonQuery("Security.InsertExceptionalLog", new DataParameter[] { new DataParameter("@CatchTime", System.DateTime.Now), new DataParameter("@ModuleName", strModuleName),
                                                                                            new DataParameter("@FunctionName", strFunctionName), new DataParameter("@ExceptionalType", strExceptionalType), new DataParameter("@ExceptionalDescription", strExceptionalDescription) });
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Example #9
0
        public string transSRMTaskAisle(string wcsProductObject)
        {
            BLL.BLLBase bll = new BLL.BLLBase();
            DataTable   dt  = Util.JsonHelper.Json2Dtb(wcsProductObject);
            string      json;

            if (dt.Rows.Count == 0)
            {
                return(json = "[{\"id\":" + dt.Rows[0]["id"] + ",\"returnCode\":001" + ",\"message\":\"失败\"" + ",\"finishDate\":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + "}]");
            }

            bll.BatchInsertTable(dt, "WCS_AisleTemp");

            string Aisle    = "";
            string AreaCode = "002";
            //获取有空货位的货架
            //select ShelfCode,COUNT(*) from CMD_Cell where PalletBarCode='' and AreaCode='001'
            //group by ShelfCode
            //order by ShelfCode
            DataTable dtSelectAisle = bll.FillDataTable("Cmd.SelectDevice", new DataParameter("{0}", AreaCode));

            if (dtSelectAisle.Rows.Count != 0)
            {
                Aisle = dtSelectAisle.Rows[0]["AisleNo"].ToString();
            }
            else
            {
                DataTable AisleDt = bll.FillDataTable("Wcs.SelectTestAisle", new DataParameter("@AreaCode", AreaCode));
                Aisle = AisleDt.Rows[0]["AisleNo"].ToString();
            }
            json = "[{\"id\":" + dt.Rows[0]["id"] + "\"taskNo\":" + dt.Rows[0]["taskNo"] + "\"aisleNo\":" + Aisle.ToString() + "\"finishDate\":" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss fff") + "}]";

            return(json);
        }
Example #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);
        }
Example #11
0
        private void ToolStripMenuItemReassign_Click(object sender, EventArgs e)
        {
            if (this.dgvMain.CurrentCell != null)
            {
                BLL.BLLBase bll      = new BLL.BLLBase();
                string      TaskNo   = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();
                string      TaskType = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells["colTaskType"].Value.ToString();

                if (TaskType == "11")
                {
                    bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", 2), new DataParameter("@TaskNo", TaskNo) });
                }
                else if (TaskType == "12" || TaskType == "13")
                {
                    bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", 0), new DataParameter("@TaskNo", TaskNo) });
                }
                else if (TaskType == "14")
                {
                    frmTaskOption f = new frmTaskOption();
                    if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        if (f.option == 0)
                        {
                            bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", 2), new DataParameter("@TaskNo", TaskNo) });
                        }
                        else
                        {
                            bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", 5), new DataParameter("@TaskNo", TaskNo) });
                        }
                    }
                }
                this.BindData();
            }
        }
Example #12
0
        /// <summary>
        /// 状态切换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string ItemName = ((ToolStripMenuItem)sender).Name;
            string State    = ItemName.Replace("ToolStripMenuItem", "");

            if (this.dgvMain.CurrentCell != null)
            {
                BLL.BLLBase bll    = new BLL.BLLBase();
                string      TaskNo = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();

                DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo), new DataParameter("@State", State) };
                bll.ExecNonQueryTran("WCS.Sp_UpdateTaskState", param);

                BindData();

                try
                {
                    App.Dispatching.Process.Report report = new Dispatching.Process.Report();
                    if (State == "7")
                    {
                        report.Send2MES(TaskNo);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error("切换状态,上报MES时发生错误:" + ex.Message);
                }
            }
        }
Example #13
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");
            }
        }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string strID = Request.QueryString["Where"] + "";
            BLL.BLLBase bll=new BLL.BLLBase();
            DataTable dtCell = bll.FillDataTable("CMD.SelectWareHouseCellInfoByCell", new DataParameter[] { new DataParameter("@CellCode", strID) });
            if (dtCell.Rows.Count > 0)
            {
                DataRow dr=dtCell.Rows[0];
                lblProductName.Text =dr["ProductName"].ToString();
                lblBarcode.Text = dr["PalletBarcode"].ToString();
                lblPalletCode.Text = dr["PalletCode"].ToString();
                lblBillNo.Text = dr["BillNo"].ToString();
                lblIndate.Text = ToYMDHM(dr["InDate"]);

                lblAreaName.Text = dr["AreaName"].ToString();
                lblShelfName.Text = dr["ShelfName"].ToString();
                lblCellColumn.Text = dr["CellColumn"].ToString();
                lblCellRow.Text = dr["CellRow"].ToString();

                if (dr["IsLock"].ToString() == "0")
                    lblState.Text = "正常";
                else
                    lblState.Text = "锁定";
                if (dr["ErrorFlag"].ToString() == "1")
                    lblState.Text = "异常";

            }
        }
Example #15
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.txtUser.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入用户!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (this.txtPWD.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入密码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            try
            {
                BLL.BLLBase bll = new BLL.BLLBase();
                DataTable   dt  = bll.FillDataTable("WCS.SelectUserByName", new DataParameter[] { new DataParameter("{0}", this.txtUser.Text.Trim()) });
                if (dt.Rows.Count > 0)
                {
                    MessageBox.Show("该用户已经存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                else
                {
                    bll.ExecNonQuery("WCS.InserUser", new DataParameter[] { new DataParameter("{0}", this.txtUser.Text.Trim()), new DataParameter("{1}", this.txtPWD.Text.Trim()) });
                    this.DialogResult = DialogResult.OK;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("请输入正确数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
Example #16
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;
                }
            }
        }
Example #17
0
        private void BindOther()
        {
            BLL.BLLBase bll = new BLL.BLLBase();
            DataTable ProductType = bll.FillDataTable("Cmd.SelectProductType", new DataParameter[] { new DataParameter("{0}", "ProductTypeCode<>'0001'") });
            DataRow dr = ProductType.NewRow();
            dr["ProductTypeCode"] = "";
            dr["ProductTypeName"] = "请选择";
            ProductType.Rows.InsertAt(dr, 0);
            ProductType.AcceptChanges();

            this.ddlProductType.DataValueField = "ProductTypeCode";
            this.ddlProductType.DataTextField = "ProductTypeName";
            this.ddlProductType.DataSource = ProductType;
            this.ddlProductType.DataBind();

            DataTable dtStateNo = bll.FillDataTable("Cmd.SelectProductState");
            dr = dtStateNo.NewRow();
            dr["StateNo"] = "";
            dr["StateName"] = "请选择";
            dtStateNo.Rows.InsertAt(dr, 0);
            dtStateNo.AcceptChanges();

            this.ddlStateNo.DataValueField = "StateNo";
            this.ddlStateNo.DataTextField = "StateName";
            this.ddlStateNo.DataSource = dtStateNo;
            this.ddlStateNo.DataBind();
        }
Example #18
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) });
            Session[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;
        }
Example #19
0
        public TaskRtn transWCSTask(List <Task> list)
        {
            lock (this)
            {
                string Json = List2Json(list);
                Log.WriteToLog("1", "transSRMTask--Rec", Json);
                string  rtnMessage = "";
                string  id         = "";
                TaskRtn taskRtn    = new TaskRtn();
                try
                {
                    DataTable dt = Util.JsonHelper.Json2Dtb(Json);
                    if (dt.Rows.Count > 0)
                    {
                        id = dt.Rows[0]["id"].ToString();
                    }
                    else
                    {
                        id = "";
                    }
                    BLL.BLLBase bll = new BLL.BLLBase();

                    bll.ExecNonQuery("WCS.DeleteWcsTemp");
                    bll.BatchInsertTable(dt, "WCS_TaskTemp");
                    DataTable dtTask = bll.FillDataTable("WCS.Sp_ImportWmsTask");

                    if (dtTask.Rows.Count > 0)
                    {
                        taskRtn.id         = id;
                        taskRtn.returnCode = "000";
                        taskRtn.message    = "成功";
                        taskRtn.finishDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
                        taskRtn.field1     = "null";

                        rtnMessage = "{\"id\":\"" + id + "\",\"returnCode\":\"000\"" + ",\"message\":\"成功\",\"finishDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\",\"field1\":\"null\"}";
                    }
                    else
                    {
                        taskRtn.id         = id;
                        taskRtn.returnCode = "001";
                        taskRtn.message    = "失败";
                        taskRtn.finishDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
                        taskRtn.field1     = "null";
                        rtnMessage         = "{\"id\":\"" + id + "\",\"returnCode\":\"001\"" + ",\"message\":\"" + taskRtn.message + "\"" + ",\"finishDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\",\"field1\":\"null\"}";
                    }
                }
                catch (Exception ex)
                {
                    taskRtn.id         = id;
                    taskRtn.returnCode = "001";
                    taskRtn.message    = ex.Message;
                    taskRtn.finishDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
                    taskRtn.field1     = "null";
                    rtnMessage         = "{\"id\":\"" + id + "\",\"returnCode\":\"001\"" + ",\"message\":\"" + ex.Message + "\"" + ",\"finishDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\",\"field1\":\"" + ex.Message + "\"}";
                }
                Log.WriteToLog("1", "transSRMTask-Rtn", rtnMessage);
                return(taskRtn);
                //return rtnMessage;
            }
        }
Example #20
0
        private void Send2PLCAGV(DataRow dr)
        {
            string TaskNo = dr["TaskNo"].ToString();

            BLL.BLLBase bllAGV    = new BLL.BLLBase("AGVDB");
            DataTable   dt        = bllAGV.FillDataTable("WCS.SelectAGVTask", new DataParameter[] { new DataParameter("{0}", string.Format("call_from='{0}'", TaskNo)) }); //将A改成 中间库的实际表明
            bool        blnInsert = false;

            if (dt.Rows.Count == 0)
            {
                blnInsert = true;
            }
            if (dt.Rows.Count > 0)
            {
                DataRow[] drs = dt.Select("Status in (0,1,5)");
                if (drs.Length == 0)
                {
                    blnInsert = true;
                }
            }
            if (blnInsert)
            {
                bllAGV.ExecNonQuery("WCS.InsertAGVTask", new DataParameter[] { new DataParameter("@from_station", ""),
                                                                               new DataParameter("@to_station", ""),
                                                                               new DataParameter("@TaskNo", TaskNo) });

                Logger.Info("重新下发AGV任务,任务号:" + TaskNo);
            }
        }
Example #21
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 && cb.Enabled)
                {
                    HyperLink hk = (HyperLink)(this.GridView1.Rows[i].FindControl("HyperLink1"));
                    //判断能否删除
                    int Count = bll.GetRowCount("VUsed_CMD_ProductType", string.Format("ProductTypeCode='{0}'", hk.Text));
                    if (Count > 0)
                    {
                        WMS.App_Code.JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "产品类别被其它单据使用,请调整后再删除!");
                        return;
                    }

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

            bll.ExecNonQuery("Cmd.DeleteProductType", 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);
        }
Example #22
0
        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string ItemName = ((ToolStripMenuItem)sender).Name;
            string State    = ItemName.Substring(ItemName.Length - 1, 1);

            if (this.dgvMain.CurrentCell != null)
            {
                BLL.BLLBase bll    = new BLL.BLLBase();
                string      TaskNo = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();

                DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo), new DataParameter("@State", State) };
                bll.ExecNonQueryTran("WCS.Sp_UpdateTaskState", param);

                //bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", State), new DataParameter("@TaskNo", TaskNo) });

                ////堆垛机完成执行
                //if (State == "7")
                //{
                //    DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo) };
                //    bll.ExecNonQueryTran("WCS.Sp_TaskProcess", param);
                //}
                BindData();
                MCP.Logger.Info("任务号:" + TaskNo + "手动更新为:" + State);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var id = Request.QueryString["id"];

                var bll = new BLL.BLLBase();
                var tb  = bll.Select(ctx, new Model.Config()
                {
                    ID = Convert.ToInt32(id), State = 0
                });

                if (tb != null && tb.Rows.Count > 0)
                {
                    config = tb.ToList <Model.Config>()[0];
                }

                if (config == null)
                {
                    config = new Model.Config();
                }

                img_1.ImgUrls = config.Url;
            }
        }
Example #24
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);
        }
Example #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {

                    string strModuleName, strFunctionName, strExceptionalType, strExceptionalDescription;
                    strModuleName = Session["ModuleName"].ToString();
                    strFunctionName = Session["FunctionName"].ToString();
                    strExceptionalType = Session["ExceptionalType"].ToString();
                    strExceptionalDescription = Session["ExceptionalDescription"].ToString();

                    labModuleName.Text = strModuleName;
                    labFunctionName.Text = strFunctionName;
                    labExceptionalType.Text = strExceptionalType;
                    labExceptionalDescription.Text = strExceptionalDescription;

                    BLL.BLLBase bll = new BLL.BLLBase();
                    bll.ExecNonQuery("Security.InsertExceptionalLog", new DataParameter[] { new DataParameter("@CatchTime", System.DateTime.Now), new DataParameter("@ModuleName", strModuleName),
                                                                      new DataParameter("@FunctionName", strFunctionName), new DataParameter("@ExceptionalType", strExceptionalType), new DataParameter("@ExceptionalDescription", strExceptionalDescription) });
                }

            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Example #26
0
        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string ItemName = ((ToolStripMenuItem)sender).Name;
            string State    = ItemName.Replace("ToolStripMenuItem1", "");

            if (this.dgvMain.CurrentCell != null)
            {
                DataRow     dataRow  = (this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].DataBoundItem as DataRowView).Row;
                BLL.BLLBase bll      = new BLL.BLLBase();
                string      TaskNo   = dataRow["TaskNo"].ToString();
                string      AreaCode = dataRow["AreaCode"].ToString();
                string      TaskType = dataRow["TaskType"].ToString();

                DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo), new DataParameter("@State", State) };
                bll.ExecNonQueryTran("WCS.Sp_UpdateTaskState", param);
                BLL.BLLBase bllMiddle = new BLL.BLLBase("MiddleDB");
                Logger.Info("手動修改任务號:" + TaskNo + ",状态為" + State);
                if (State == "7") //手動執行后,修改中間表
                {
                    string TaskID     = dataRow["TaskID"].ToString();
                    string SubTaskID  = dataRow["SubTaskID"].ToString();
                    string PalletCode = dataRow["PalletCode"].ToString();
                    if (AreaCode == "UL" && TaskType == "12")
                    {
                        if (bll.GetRowCount("WCS_Task", string.Format("TaskID={0} and Palletcode='{1}' and SubTaskID!={2} and AreaCode='{3}' and State in (0,1,10) ", TaskID, PalletCode, SubTaskID, "UL")) == 0)
                        {
                            DataTable dtMiddle = bllMiddle.FillDataTable("Middle.SelectConveyMoveTask", new DataParameter[] { new DataParameter("@Device", "UL"), new DataParameter("{0}", string.Format("main.task_id={0} and hu_id='{1}' and subtask_id!={2} ", TaskID, PalletCode, SubTaskID)) });
                            if (dtMiddle.Rows.Count > 0)
                            {
                                dtMiddle.Rows[0]["location_id"] = dataRow["ToStation"].ToString();
                                BLL.Server.InsertTaskToWcs(dtMiddle, false);
                            }
                            else
                            {
                                Logger.Error("ConveyPickProcess中找不到托盤號:" + PalletCode + " 的後續處理方式!");
                            }
                        }
                    }
                    //List<DataParameter[]> paras = new List<DataParameter[]>();
                    //List<string> Comds = new List<string>();
                    //Comds.Add("Middle.UpdateAsrsTaskRTN");
                    //Comds.Add("Middle.UpdateAsrsSubTaskRTN");
                    //paras.Add(new DataParameter[] { new DataParameter("@TaskID", TaskID) });
                    //paras.Add(new DataParameter[] { new DataParameter("@SubTaskID", SubTaskID) });
                    //bllMiddle.ExecTran(Comds.ToArray(), paras);

                    bllMiddle.ExecNonQuery("Middle.UpdateAsrsTaskRTN", new DataParameter[] { new DataParameter("@TaskID", TaskID) });
                    bllMiddle.ExecNonQuery("Middle.UpdateAsrsSubTaskRTN", new DataParameter[] { new DataParameter("@SubTaskID", SubTaskID) });

                    if (bllMiddle.GetRowCount("si_asrs_task_Detail", string.Format("task_id={0} and status in ('ADD','ISS','ACK') and subtask_id<>{1}", TaskID, SubTaskID)) == 0)
                    {
                        bll.ExecNonQuery("WCS.sp_FinshedTaskToBak", new DataParameter[] { new DataParameter("@TaskID", TaskID) });
                    }
                }
                else if (State == "9")
                {
                }
                BindData();
            }
        }
Example #27
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (this.txtPalletCode.Text.Trim().Length == 0)
            {
                MessageBox.Show("请输入条码!");
                return;
            }
            BLL.BLLBase bll    = new BLL.BLLBase();
            DataTable   dtTask = bll.FillDataTable("WCS.SelectWMSTask", new DataParameter[] { new DataParameter("{0}", string.Format("TASKSTATUS in ('0','3') AND TASKTYPE='IB' AND PALLETID='{0}' ", this.txtPalletCode.Text.Trim())) });

            if (dtTask.Rows.Count > 0)
            {
                if (dtTask.Rows[0]["ASRSID"].ToString() == CraneNo.ToString())
                {
                    TaskNo            = dtTask.Rows[0]["TASKID"].ToString();
                    TaskStatus        = dtTask.Rows[0]["TASKSTATUS"].ToString();
                    PalletCode        = this.txtPalletCode.Text.Trim();
                    LedNo             = dtTask.Rows[0]["LEDNO"].ToString();
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("巷道不符!");
                    return;
                }
            }
            else
            {
                MessageBox.Show("无入库任务!");
                return;
            }
        }
Example #28
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);
        }
Example #29
0
        private void frmSelect_Load(object sender, EventArgs e)
        {
            bll = new BLL.BLLBase();
            BindComboBox();

            htFields = new Hashtable();
            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(AppDomain.CurrentDomain.BaseDirectory + string.Format("\\TableXML\\{0}.xml", XmltableName));
            StringBuilder fieldList = new StringBuilder();
            XmlNode       nodeTable = xmlDoc.SelectSingleNode("TABLE");

            PrimaryKey = nodeTable.Attributes["PrimaryKey"].InnerText;
            orderBy    = nodeTable.Attributes["OrderBy"].InnerText;
            if (nodeTable.Attributes["ViewName"] != null && nodeTable.Attributes["ViewName"].InnerText != "")
            {
                TableView = nodeTable.Attributes["ViewName"].InnerText;
            }

            foreach (XmlNode node in nodeTable.ChildNodes)
            {
                fieldList.Append(node.ChildNodes[0].InnerText + ",");
                htFields.Add(node.ChildNodes[0].InnerText, node.ChildNodes[1].InnerText);
            }
            fieldList.Remove(fieldList.Length - 1, 1);
            queryFields = fieldList.ToString();

            SetBtnEnabled("");
            SetColumn();
        }
Example #30
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");

            }
        }
Example #31
0
        protected override void StateChanged(StateItem stateItem, IProcessDispatcher dispatcher)
        {
            try
            {
                Dictionary<string, string> msg = (Dictionary<string, string>)stateItem.State;
                object o = WriteToService("StockPLC", "PLCFree");
                switch (stateItem.ItemName)
                {

                    case "ARQ": //入库申请
                        if (o.ToString() == "1")
                        {
                            //入库写入
                            BLL.BLLBase bll = new BLL.BLLBase();
                            DataTable dtTask = bll.FillDataTable("WCS.SelectTask", new DataParameter[] { new DataParameter("@TaskNo", msg["TaskNo"]) });

                            int TaskType = int.Parse(dtTask.Rows[0]["TaskType"].ToString());
                            string TaskNo = msg["TaskNo"];
                            string CellCode = dtTask.Rows[0]["CellCode"].ToString();

                            //写入任务号
                            WriteToService("StockPLC", "TaskNo1", int.Parse(TaskNo.Substring(0, 4)));
                            WriteToService("StockPLC", "TaskNo2", int.Parse(TaskNo.Substring(4, 4)));
                            WriteToService("StockPLC", "TaskNo3", int.Parse(TaskNo.Substring(8)));
                            //写入起始位,结束位
                            if (TaskType == 3)
                            {
                                WriteToService("StockPLC", "FromStation1", 0);
                                WriteToService("StockPLC", "FromStation2", 0);
                                WriteToService("StockPLC", "FromStation3", 0);
                            }
                            else
                            {
                                WriteToService("StockPLC", "FromStation1", int.Parse(CellCode.Substring(0, 3)));
                                WriteToService("StockPLC", "FromStation2", int.Parse(CellCode.Substring(0, 3)));
                                WriteToService("StockPLC", "FromStation3", 68);
                            }

                            WriteToService("StockPLC", "ToStation1", int.Parse(CellCode.Substring(0, 3)));
                            WriteToService("StockPLC", "ToStation2", int.Parse(CellCode.Substring(3, 3)));
                            WriteToService("StockPLC", "ToStation3", int.Parse(CellCode.Substring(6)));
                            //写入标识
                            WriteToService("StockPLC", "WriteFinished", 1);

                            WriteToService("PDATcp", "msg", "1");
                        }
                        else
                        {
                            WriteToService("PDATcp", "msg", "0");
                        }
                        break;

                }
            }
            catch (Exception ex)
            {

            }
        }
Example #32
0
        protected override void StateChanged(StateItem stateItem, IProcessDispatcher dispatcher)
        {
            try
            {
                string cmd = stateItem.ItemName;
                Dictionary <string, string> obj = (Dictionary <string, string>)stateItem.State;
                string IsUpErp = "1";
                string ErpMsg  = obj["MSG"];
                if (obj["Result"].ToUpper() == "N")
                {
                    IsUpErp = "0";
                }
                string strTaskType = "";
                string Where       = string.Format("WCS_Task.Barcode like '%{0}%'", obj["BillNo"]);

                if (cmd.Trim() == "")
                {
                    Logger.Error("Erp回传内容为空!");
                    return;
                }
                switch (cmd)
                {
                case "InStock":
                    strTaskType = "入库";
                    Where       = string.Format(" billid in (  select billid from wcs_task where taskid in (select taskid  from WCS_TASK where barcode like '%{0}%' and tasktype='11')) ", obj["BillNo"]);
                    break;

                case "OutStock":
                    strTaskType = "出库";
                    Where       = string.Format("  billid in ( select BillID  from WCS_TASK where barcode like '%{0}%' and tasktype='12') ", obj["BillNo"]);
                    break;

                case "CheckStock":
                    Where       = string.Format("BillID='{0}'", obj["BillNo"]);
                    strTaskType = "盘点";
                    Where      += " and TaskType=14 ";
                    break;
                }

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


                bll.ExecNonQuery("WCS.UpdateBillUpErp", new DataParameter[] { new DataParameter("@IsUpERP", IsUpErp), new DataParameter("@ErpMSG", ErpMsg), new DataParameter("{0}", Where) });
                string InfoMesg = strTaskType + "熔次卷号:" + obj["BillNo"] + "返回值为:" + obj["Result"] + "," + obj["MSG"];
                if (IsUpErp == "0")
                {
                    Logger.Error(InfoMesg);
                }
                else
                {
                    Logger.Info(InfoMesg);
                }
            }
            catch (Exception ex)
            {
                Logger.Error("ErpProcess出错:" + ex.Message);
            }
        }
Example #33
0
        protected override void StateChanged(StateItem stateItem, IProcessDispatcher dispatcher)
        {
            object obj = ObjectUtil.GetObject(stateItem.State);

            if (obj == null)
            {
                return;
            }

            BLL.BLLBase bll     = new BLL.BLLBase();
            string      Request = obj.ToString();

            if (Request.Equals("True") || Request.Equals("1"))
            {
                try
                {
                    string taskNo = Util.ConvertStringChar.BytesToString(ObjectUtil.GetObjects(WriteToService(stateItem.Name, "Barcode")));
                    if (taskNo.Trim().Length > 0)
                    {
                        string Barcode = taskNo.PadRight(20, ' ').Substring(10, 10).Trim();

                        DataTable dt = bll.FillDataTable("WCS.SelectReadTaskByPallet", new DataParameter[] { new DataParameter("@PalletCode", Barcode) });
                        if (dt.Rows.Count > 0)
                        {
                            string TaskType = dt.Rows[0]["TaskType"].ToString();
                            string TaskNo   = dt.Rows[0]["TaskNo"].ToString();
                            if (TaskType == "12" || TaskType == "15" || TaskType == "14") //出库,托盘出库,盘点
                            {
                                DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo) };
                                bll.ExecNonQueryTran("WCS.Sp_TaskProcess", param);
                                Logger.Info("出库任务完成,任务号:" + TaskNo + " 条码号:" + Barcode);


                                string   strValue = "";
                                string[] str      = new string[3];
                                if (TaskType == "12" || TaskType == "14")//显示拣货信息.
                                {
                                    str[0] = "1";
                                    if (TaskType == "14")
                                    {
                                        str[0] = "2";
                                    }

                                    while ((strValue = FormDialog.ShowDialog(str, dt)) != "")
                                    {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error("到达出库口,错误讯息:" + ex.Message);
                }
            }
        }
Example #34
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                rptview.Visible = false;
                BLL.BLLBase bll    = new BLL.BLLBase();
                DataTable   dtArea = bll.FillDataTable("CMD.SelectAreaSation", null);
                DataRow     dr     = dtArea.NewRow();
                dr[0] = "请选择";
                dtArea.Rows.InsertAt(dr, 0);
                dtArea.AcceptChanges();
                this.ddlAreaSation.DataValueField = "areasation";
                this.ddlAreaSation.DataTextField  = "areasation";
                this.ddlAreaSation.DataSource     = dtArea;
                this.ddlAreaSation.DataBind();
            }
            else
            {
                string hdnwh = HdnWH.Value;
                int    W     = int.Parse(hdnwh.Split('#')[0]);
                int    H     = int.Parse(hdnwh.Split('#')[1]);
                WebReport1.Width  = W - 60;
                WebReport1.Height = H - 100;

                if (this.HdnProduct.Value.Length > 0)
                {
                    this.btnProduct.Text = "取消指定";
                }
                else
                {
                    this.btnProduct.Text = "指定";
                }


                if (this.hdnColor.Value.Length > 0)
                {
                    this.btnColor.Text = "取消指定";
                }
                else
                {
                    this.btnColor.Text = "指定";
                }
                if (this.hdnFact.Value.Length > 0)
                {
                    this.btnFact.Text = "取消指定";
                }
                else
                {
                    this.btnFact.Text = "指定";
                }


                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "BindEvent();", true);
            }

            SetTextReadOnly(this.txtColor, this.txtProductModule, this.txtFact);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     var bll = new BLL.BLLBase();
     var tb = bll.Select(new DataContext(), new Model.GlobeConfig());
     if (tb.Rows != null && tb.Rows.Count > 0)
     {
         PubFunc.BindControl(rptList, tb);
     }
 }
Example #36
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)) });
     Session[FormID + "_S_GridView2"] = dtSub;
     this.GridView2.DataSource = dtSub;
     this.GridView2.DataBind();
     MovePage("S", this.GridView2, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1);
 }
Example #37
0
 private void ToolStripMenuItem_ClearCell_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("此功能会把所有货位信息全部清空", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
     {
         BLL.BLLBase bll = new BLL.BLLBase();
         bll.ExecNonQuery("WCS.ClearCellInfo");
         MessageBox.Show("清理完成", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Example #38
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = null;

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

                dt = bll.FillDataTable("Security.SelectSoftWareInfo", null);
            }
            catch (Exception exp)
            {
                Session["ModuleName"]             = "关于模块";
                Session["FunctionName"]           = "Page_Load";
                Session["ExceptionalType"]        = exp.GetType().FullName;
                Session["ExceptionalDescription"] = exp.Message;
                Response.Redirect("MistakesPage.aspx");
            }

            LabVersion.Font.Size          = FontUnit.Smaller;
            labCompany.Font.Size          = FontUnit.Smaller;
            labCopyrigth.Font.Size        = FontUnit.Smaller;
            labCompanyTelephone.Font.Size = FontUnit.Smaller;
            labCompanyFax.Font.Size       = FontUnit.Smaller;
            labCompanyAddress.Font.Size   = FontUnit.Smaller;

            labCompanyWeb.Font.Size  = FontUnit.Smaller;
            lbtnCompanyWeb.Font.Size = FontUnit.Smaller;
            lbtnQuit.Font.Size       = FontUnit.Smaller;

            if (dt.Rows.Count > 0)
            {
                // LabSoftWareName.Text = dt.Rows[0][0].ToString();
                //LabSoftWareName.Font.Size = FontUnit.Smaller;
                LabVersion.Text                = "软件版本:" + dt.Rows[0]["Version"].ToString();
                LabVersion.Font.Size           = FontUnit.Smaller;
                this.lblSoftwareName.Text      = "软件名称:" + dt.Rows[0]["SoftwareName"].ToString();
                this.lblSoftwareName.Font.Size = FontUnit.Smaller;

                labCompany.Text               = "公司名称:" + dt.Rows[0]["Company"].ToString();
                labCompany.Font.Size          = FontUnit.Smaller;
                labCopyrigth.Text             = dt.Rows[0]["Copyrigth"].ToString();
                labCopyrigth.Font.Size        = FontUnit.Smaller;
                labCompanyTelephone.Text      = "公司电话:" + dt.Rows[0]["CompanyTelephone"].ToString();
                labCompanyTelephone.Font.Size = FontUnit.Smaller;
                labCompanyFax.Text            = "公司传真:" + dt.Rows[0]["CompanyFax"].ToString();
                labCompanyFax.Font.Size       = FontUnit.Smaller;
                labCompanyAddress.Text        = "公司地址:" + dt.Rows[0]["CompanyAddress"].ToString();
                labCompanyAddress.Font.Size   = FontUnit.Smaller;

                labCompanyWeb.Text       = "公司网址:";
                labCompanyWeb.Font.Size  = FontUnit.Smaller;
                lbtnCompanyWeb.Text      = dt.Rows[0]["CompanyWeb"].ToString();
                lbtnCompanyWeb.Font.Size = FontUnit.Smaller;
            }
        }
Example #39
0
        //总控WCS入库巷道请求
        public TaskAisleRtn transWCSTaskAisle(List <TaskAisle> list)
        {
            string Json = List2Json(list);

            Log.WriteToLog("1", "transSRMTaskAisle-Rec", Json);

            string       rtnMessage    = "";
            string       id            = "";
            string       taskNo        = "";
            string       Aisle         = "";
            string       WarehouseCode = "";
            TaskAisleRtn taskAisleRtn  = new TaskAisleRtn();

            try
            {
                BLL.BLLBase bll = new BLL.BLLBase();
                DataTable   dt  = Util.JsonHelper.Json2Dtb(Json);

                if (dt.Rows.Count > 0)
                {
                    id            = dt.Rows[0]["id"].ToString();
                    taskNo        = dt.Rows[0]["taskNo"].ToString();
                    WarehouseCode = dt.Rows[0]["warehouseCode"].ToString();
                }
                else
                {
                    id            = "";
                    taskNo        = "";
                    WarehouseCode = "";
                }
                bll.BatchInsertTable(dt, "WCS_AisleTemp");


                DataTable dtSelectAisle = bll.FillDataTable("Cmd.AisleRequest", new DataParameter("{0}", string.Format("WarehouseCode='{0}'", WarehouseCode)));
                //DataTable dtSelectAisle = bll.FillDataTable("Cmd.AisleRequest");
                if (dtSelectAisle.Rows.Count > 0)
                {
                    Aisle = dtSelectAisle.Rows[0]["AisleNo"].ToString();
                }

                taskAisleRtn.id         = id;
                taskAisleRtn.taskNo     = taskNo;
                taskAisleRtn.aisleNo    = Aisle;
                taskAisleRtn.finishDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
                taskAisleRtn.field1     = "null";

                rtnMessage = "{\"id\":\"" + id + "\",\"taskNo\":\"" + taskNo + "\",\"aisleNo\":\"" + Aisle + "\",\"finishDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\",\"field1\":\"null\"}";
            }
            catch (Exception ex)
            {
                rtnMessage = "{\"id\":\"" + id + "\",\"taskNo\":\"" + taskNo + "\",\"aisleNo\":\"" + Aisle + "\",\"finishDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\",\"field1\":\"" + ex.Message + "\"}";
            }
            Log.WriteToLog("1", "transSRMTaskAisle-Rtn", rtnMessage);
            return(taskAisleRtn);
            //return rtnMessage;
        }
Example #40
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = null;
            try
            {
                BLL.BLLBase bll = new BLL.BLLBase();

                dt = bll.FillDataTable("Security.SelectSoftWareInfo", null);
            }
            catch (Exception exp)
            {
                Session["ModuleName"] = "关于模块";
                Session["FunctionName"] = "Page_Load";
                Session["ExceptionalType"] = exp.GetType().FullName;
                Session["ExceptionalDescription"] = exp.Message;
                Response.Redirect("MistakesPage.aspx");
            }

            LabVersion.Font.Size = FontUnit.Smaller;
            labCompany.Font.Size = FontUnit.Smaller;
            labCopyrigth.Font.Size = FontUnit.Smaller;
            labCompanyTelephone.Font.Size = FontUnit.Smaller;
            labCompanyFax.Font.Size = FontUnit.Smaller;
            labCompanyAddress.Font.Size = FontUnit.Smaller;

            labCompanyWeb.Font.Size = FontUnit.Smaller;
            lbtnCompanyWeb.Font.Size = FontUnit.Smaller;
            lbtnQuit.Font.Size = FontUnit.Smaller;

            if (dt.Rows.Count > 0)
            {
                // LabSoftWareName.Text = dt.Rows[0][0].ToString();
                //LabSoftWareName.Font.Size = FontUnit.Smaller;
                LabVersion.Text = "软件版本:" + dt.Rows[0]["Version"].ToString();
                LabVersion.Font.Size = FontUnit.Smaller;
                this.lblSoftwareName.Text = "软件名称:" + dt.Rows[0]["SoftwareName"].ToString();
                this.lblSoftwareName.Font.Size = FontUnit.Smaller;

                labCompany.Text = "公司名称:" + dt.Rows[0]["Company"].ToString();
                labCompany.Font.Size = FontUnit.Smaller;
                labCopyrigth.Text = dt.Rows[0]["Copyrigth"].ToString();
                labCopyrigth.Font.Size = FontUnit.Smaller;
                labCompanyTelephone.Text = "公司电话:" + dt.Rows[0]["CompanyTelephone"].ToString();
                labCompanyTelephone.Font.Size = FontUnit.Smaller;
                labCompanyFax.Text = "公司传真:" + dt.Rows[0]["CompanyFax"].ToString();
                labCompanyFax.Font.Size = FontUnit.Smaller;
                labCompanyAddress.Text = "公司地址:" + dt.Rows[0]["CompanyAddress"].ToString();
                labCompanyAddress.Font.Size = FontUnit.Smaller;

                labCompanyWeb.Text = "公司网址:";
                labCompanyWeb.Font.Size = FontUnit.Smaller;
                lbtnCompanyWeb.Text = dt.Rows[0]["CompanyWeb"].ToString();
                lbtnCompanyWeb.Font.Size = FontUnit.Smaller;

            }
        }
Example #41
0
File: Form1.cs Project: 0000duck/XN
        private void button2_Click(object sender, EventArgs e)
        {
            //WCSDataService.WCSDataService wcs = new WCSDataService.WCSDataService();
            BLL.BLLBase bll = new BLL.BLLBase();
            DataTable   Jdt = bll.FillDataTable("Wcs.SelectTaskWcsFinish", new DataParameter("{0}", "1701120037"));

            string Json       = Util.JsonHelper.Dtb2Json(Jdt, "yyyy-MM-dd HH:mm:ss.fff");
            string rtnMessage = send("transWCSTaskStatus", Json);
            //string m = "[{\"id\":\"" + id + "\",\"deviceNo\":\"" + deviceNo + "\",\"mode\":\"" + mode + "\",\"status\":\"" + status + "\",\"taskNo\":\"" + taskNo + "\",\"fork\":\"" + fork + "\",\"load\":\"" + load + "\",\"aisleNo\":\"" + aisleNo + "\",\"column\":\"" + column + "\",\"layer\":\"" + layer + "\",\"alarmCode\":\"" + alarmCode + "\",\"sendDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\",\"sender\":\"" + sender + "\",\"field1\":\"\",\"field2\":\"\",\"field3\":\"\"" + "}]";
        }
Example #42
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)) });

            Session[FormID + "_S_GridView2"] = dtSub;
            this.GridView2.DataSource        = dtSub;
            this.GridView2.DataBind();
            MovePage("S", this.GridView2, 0, btnFirstSub1, btnPreSub1, btnNextSub1, btnLastSub1, btnToPageSub1, lblCurrentPageSub1);
        }
Example #43
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)
                    {
                        WMS.App_Code.JScript.Instance.ShowMessage(this.UpdatePanel1, GridView1.Rows[i].Cells[2].Text + "单号还未审核不能作业,请审核后,再进行盘库作业。");
                        BindDataSub(this.hdnRowValue.Value);
                        return;
                    }
                    if (State > 1)
                    {
                        WMS.App_Code.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)
            {
                WMS.App_Code.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);
                WMS.App_Code.JScript.Instance.ShowMessage(this.UpdatePanel1, ex.Message);

            }
        }
Example #44
0
        protected void ddlAreaCode_SelectedIndexChanged(object sender, EventArgs e)
        {
            string AreaCode = ddlArea.SelectedValue;
            BLL.BLLBase bll = new BLL.BLLBase();
            DataTable ProductType = bll.FillDataTable("Cmd.SelectProductType", new DataParameter[] { new DataParameter("{0}", "cmd.AreaCode='" + AreaCode + "' and ProductTypeCode<>'0001'") });

            DataRow dr = ProductType.NewRow();
            dr["ProductTypeCode"] = "";
            dr["ProductTypeName"] = "请选择";
            ProductType.Rows.InsertAt(dr, 0);
            ProductType.AcceptChanges();

            this.ddlProductType.DataValueField = "ProductTypeCode";
            this.ddlProductType.DataTextField = "ProductTypeName";
            this.ddlProductType.DataSource = ProductType;
            this.ddlProductType.DataBind();
        }
Example #45
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");
            }
        }
Example #46
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                rptview.Visible = false;
                BLL.BLLBase bll = new BLL.BLLBase();
                DataTable dtArea = bll.FillDataTable("CMD.SelectAreaSation", null);
                DataRow dr = dtArea.NewRow();
                dr[0] = "请选择";
                dtArea.Rows.InsertAt(dr, 0);
                dtArea.AcceptChanges();
                this.ddlAreaSation.DataValueField = "areasation";
                this.ddlAreaSation.DataTextField = "areasation";
                this.ddlAreaSation.DataSource = dtArea;
                this.ddlAreaSation.DataBind();
            }
            else
            {
                string hdnwh = HdnWH.Value;
                int W = int.Parse(hdnwh.Split('#')[0]);
                int H = int.Parse(hdnwh.Split('#')[1]);
                WebReport1.Width = W - 60;
                WebReport1.Height = H - 100;

                if (this.HdnProduct.Value.Length > 0)
                    this.btnProduct.Text = "取消指定";
                else
                    this.btnProduct.Text = "指定";

                if (this.hdnColor.Value.Length > 0)
                    this.btnColor.Text = "取消指定";
                else
                    this.btnColor.Text = "指定";
                if (this.hdnFact.Value.Length > 0)
                    this.btnFact.Text = "取消指定";
                else
                    this.btnFact.Text = "指定";

                ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "", "BindEvent();", true);
            }

            SetTextReadOnly(this.txtColor, this.txtProductModule, this.txtFact);
        }
Example #47
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) });
                    }
                }
            }

            WMS.App_Code.JScript.Instance.ShowMessage(this, "设置成功!");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var id = Request.QueryString["id"];

                var bll = new BLL.BLLBase();
                var tb = bll.Select(ctx, new Model.Config() { ID = Convert.ToInt32(id), State = 0 });

                if (tb != null && tb.Rows.Count > 0)
                {
                    config = tb.ToList<Model.Config>()[0];
                }

                if (config == null)
                {
                    config = new Model.Config();
                }

                img_1.ImgUrls = config.Url;
            }
        }
Example #49
0
        private bool LoadRpt()
        {
            try
            {
                GetStrWhere();
                string frx = "TaskQuery.frx";
                string Comds = "WMS.SelectTaskQuery";

                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, "TaskQuery");
            }
            catch (Exception ex)
            {
            }
            return true;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if(IsPostBack)
            {
                AjaxResult response = null;

                var txtLgName = Request.Form["txtLgName"];
                var txtPwd = Request.Form["txtPwd"];
                var txtName = Request.Form["txtName"];
                var txtEmail = Request.Form["txtMail"];
                var txtQQ = Request.Form["txtQQ"];
                var txtMob = Request.Form["txtMob"];
                var txtRemark = Request.Form["txtRemark"];

                if (string.IsNullOrEmpty(txtLgName))
                {
                    response = new AjaxResult() {Success = 0, Message = "登录名不能为空。"};
                    this.Response.Write(common.Common.GetJSMsgBox(response.Message));
                    return;
                }

                if (string.IsNullOrEmpty(txtPwd))
                {
                    response = new AjaxResult() { Success = 0, Message = "密码不能为空。" };
                    this.Response.Write(common.Common.GetJSMsgBox(response.Message));
                    return;
                }

                if (string.IsNullOrEmpty(txtName))
                {
                    response = new AjaxResult() { Success = 0, Message = "用户名不能为空。" };
                    this.Response.Write(common.Common.GetJSMsgBox(response.Message));
                    return;
                }

                var dt = new Model.Admin()
                             {
                                 CreateDate = DateTime.Now,
                                 Email = txtEmail,
                                 LoginName = txtLgName,
                                 ModifyDate = DateTime.Now,
                                 Name = txtName,
                                 Password = PubFunc.Md5(txtPwd),
                                 QQ = txtQQ,
                                 Mob = txtMob,
                                 Remark = txtRemark
                             };

                DataContext dc=new DataContext();

                dc.BeginTransaction();
                try
                {
                    var bll = new BLL.BLLBase();
                    var id = bll.Add(dc, dt);

                    dc.CommitTransaction();

                    response = new AjaxResult() {Success = 1, Message = "操作成功", Data = id};
                }
                catch(Exception exception)
                {
                    dc.RollBackTransaction();
                    response = new AjaxResult() { Success = 0, Message = "操作失败:"+exception.Message, Data = 0 };
                }
                finally
                {
                    dc.CloseConnection();
                }

                this.Response.Write(common.Common.GetJSMsgBox(response.Message));
            }
        }
Example #51
0
        private void ToolStripMenuItemCellCode_Click(object sender, EventArgs e)
        {
            if (this.dgvMain.CurrentCell != null)
            {
                BLL.BLLBase bll = new BLL.BLLBase();
                string TaskNo = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();
                string TaskType = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells["colTaskType"].Value.ToString();
                string ErrCode = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells["colErrCode"].ToString();

                if (TaskType=="11")
                {
                    DataGridViewSelectedRowCollection rowColl = dgvMain.SelectedRows;
                    if (rowColl == null)
                        return;
                    DataRow dr = (rowColl[0].DataBoundItem as DataRowView).Row;
                    frmReassignEmptyCell f = new frmReassignEmptyCell(dr);
                    if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        this.BindData();
                }
                else if (TaskType == "12" || TaskType == "14")
                {
                    DataGridViewSelectedRowCollection rowColl = dgvMain.SelectedRows;
                    if (rowColl == null)
                        return;
                    DataRow dr = (rowColl[0].DataBoundItem as DataRowView).Row;
                    frmReassign f = new frmReassign(dr);
                    if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        this.BindData();
                }
                else if (TaskType == "13")
                {
                    DataGridViewSelectedRowCollection rowColl = dgvMain.SelectedRows;
                    if (rowColl == null)
                        return;
                    DataRow dr = (rowColl[0].DataBoundItem as DataRowView).Row;

                    frmReassignOption fo = new frmReassignOption();
                    if (fo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        if (fo.option == 0)
                        {
                            frmReassign f = new frmReassign(dr);
                            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                                this.BindData();
                        }
                        else
                        {
                            frmReassignEmptyCell fe = new frmReassignEmptyCell(dr);
                            if (fe.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                                this.BindData();
                        }
                    }
                }
            }
        }
Example #52
0
        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string ItemName = ((ToolStripMenuItem)sender).Name;
            string State = ItemName.Substring(ItemName.Length-1, 1);

            if (this.dgvMain.CurrentCell != null)
            {
                BLL.BLLBase bll = new BLL.BLLBase();
                string TaskNo = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();

                DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo), new DataParameter("@State", State) };
                bll.ExecNonQueryTran("WCS.Sp_UpdateTaskState", param);

                //bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", State), new DataParameter("@TaskNo", TaskNo) });

                ////堆垛机完成执行
                //if (State == "7")
                //{
                //    DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo) };
                //    bll.ExecNonQueryTran("WCS.Sp_TaskProcess", param);
                //}
                BindData();
            }
        }
Example #53
0
        //protected void Page_Load(object sender, EventArgs e)
        //{
        //    if (Page.Request.Url.Query != "")
        //    {
        //        //ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Resize", "alert(\"对不起,操作时限已过,请重新登入!\");window.top.location =\"Login.aspx\";", true);
        //    }
        //}
        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();
                            App_Code.LoginUserInfo.UserName = dtUserList.Rows[0]["UserName"].ToString();
                            App_Code.LoginUserInfo.UserCode = EmployeeCode;

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

                            //Session["sys_PageCount"] = 15;

                            //Session["grid_ColumnTitleFont"] = "楷体_GB2312,Coral,10,加粗";
                            //Session["grid_ContentFont"] = "宋体,Black,10,正常";

                            //Session["grid_ColumnTextAlign"] = "1";
                            //Session["grid_ContentTextAlign"] = "1";
                            //Session["grid_NumberColumnAlign"] = "1";
                            //Session["grid_MoneyColumnAlign"] = "1";
                            //Session["grid_SelectMode"] = "0";
                            //Session["grid_IsRefreshBeforeAdd"] = "1";
                            //Session["grid_IsRefreshBeforeUpdate"] = "1";
                            //Session["grid_IsRefreshBeforeDelete"] = "1";

                            //Session["grid_OddRowColor"] = "White";
                            //Session["grid_EvenRowColor"] = "AliceBlue";

                            //Session.Timeout = int.Parse(ConfigurationManager.AppSettings["SessionTimeOut"]);
                            #region 添加登录日志

                            BLL.BLLBase bll = new BLL.BLLBase();
                            bll.ExecNonQuery("Security.InsertOperatorLog", new IDAL.DataParameter[]{new IDAL.DataParameter("@LoginUser",App_Code.LoginUserInfo.UserName),new IDAL.DataParameter("@LoginTime",DateTime.Now),
                                                         new IDAL.DataParameter("@LoginModule","登录系统"),new IDAL.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 IDAL.DataParameter[]{new IDAL.DataParameter("@LoginUser",this.txtUserName.Text.Trim()),new IDAL.DataParameter("@LoginTime",DateTime.Now),
                                                         new IDAL.DataParameter("@LoginModule","登录页面"),new IDAL.DataParameter("@ExecuteOperator","登录(用户密码有误)")});
                            ltlMessage.Text = "对不起,您输入的密码有误!";
                        }
                    }
                    else
                    {
                        ltlMessage.Text = "对不起,您输入的用户名不存在!";
                    }

                }
                catch (Exception exp)
                {
                    System.Diagnostics.StackFrame frame = new System.Diagnostics.StackFrame(0);
                    Session["ModuleName"] = this.Page.Title;
                    Session["FunctionName"] = frame.GetMethod().Name;
                    Session["ExceptionalType"] = exp.GetType().FullName;
                    Session["ExceptionalDescription"] = exp.Message;
                    Response.Redirect("Common/MistakesPage.aspx", false);
                }
            }
            else
            {
                ltlMessage.Text = "请输入用户名!";
            }
        }
Example #54
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 IDAL.DataParameter[]{new IDAL.DataParameter("@LoginUser",App_Code.LoginUserInfo.UserName),new IDAL.DataParameter("@LoginTime",DateTime.Now),
                                                  new IDAL.DataParameter("@LoginModule",moduleName),new IDAL.DataParameter("@ExecuteOperator",executeOperation)});
 }
Example #55
0
 private void toolStripMenuItem2_Click(object sender, EventArgs e)
 {
     if (this.dgvMain.CurrentCell != null)
     {
         BLL.BLLBase bll = new BLL.BLLBase();
         string TaskNo = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();
         DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo), new DataParameter("@State", 0) };
         bll.ExecNonQueryTran("WCS.Sp_UpdateTaskState", param);
         BindData();
         MCP.Logger.Info("任务号:" + TaskNo + "手动更新为:0");
     }
 }
Example #56
0
        //货架显示图;
        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 = int.Parse(ShelfCell.Rows[0]["Columns"].ToString());
            string Width = "15%";
            if (Columns > 6)
                Width = "8%";

            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 = Columns; j >= 1; j--)
                {
                    int k = j;
                    if (shelfCode == "001002" || shelfCode == "001004")  //特殊处理
                    {
                        k = j + 1;
                    }
                    if (shelfCode == "001005")
                    {
                        k = 12 - j;
                    }
                    if (shelfCode == "001006")
                    {
                        k = 13 - j;
                    }

                    if (AreaCode == "")
                        strWhere = string.Format("CellRow={0} and CellColumn={1}", i, k);
                    else
                        strWhere = string.Format("CellRow={0} and CellColumn={1} and AreaCode='{2}'", i, k, 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 == 1)
                    {
                        if (shelfCode == "001002" || shelfCode == "001005" || shelfCode == "001004")
                        {
                            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 = Columns; j >= 1; j--)
                    {

                        int k = j;
                        if (shelfCode == "001002" || shelfCode == "001004")  //特殊处理
                        {
                            k = j + 1;
                        }
                        if (shelfCode == "001005")
                        {
                            k = 12 - j;
                        }
                        if (shelfCode == "001006")
                        {
                            k = 13 - j;
                        }
                        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.ToString()+"</font>";

                        rowNum.Cells.Add(cellNum);

                    }
                    tb.Rows.Add(rowNum);

                }

            }
            return tb;
        }
Example #57
0
 private void UpdatedgvMainState(string State)
 {
     if (this.dgvMain.CurrentCell != null)
     {
         BLL.BLLBase bll = new BLL.BLLBase();
         string TaskNo = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();
         DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo), new DataParameter("@State", State) };
         bll.ExecNonQueryTran("WCS.Sp_UpdateTaskState", param);
         ////堆垛机完成执行
         //if (State == "7")
         //{
         //    DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo) };
         //    bll.ExecNonQueryTran("WCS.Sp_TaskProcess", param);
         //}
         BindData();
         MCP.Logger.Info("任务号:" + TaskNo + "手动更新为:" + State);
     }
 }
Example #58
0
        private void BindOther()
        {
            BLL.BLLBase bll = new BLL.BLLBase();
            DataTable ProductType = bll.FillDataTable("Cmd.SelectProductType", new DataParameter[] { new DataParameter("{0}", "cmd.AreaCode='001' and ProductTypeCode<>'0001'") });
            DataRow dr = ProductType.NewRow();
            dr["ProductTypeCode"] = "";
            dr["ProductTypeName"] = "请选择";
            ProductType.Rows.InsertAt(dr, 0);
            ProductType.AcceptChanges();

            this.ddlProductType.DataValueField = "ProductTypeCode";
            this.ddlProductType.DataTextField = "ProductTypeName";
            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();
        }
Example #59
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();

            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);
        }
Example #60
0
        private void UpdatedgvMainState(string State)
        {
            if (this.dgvMain.CurrentCell != null)
            {
                BLL.BLLBase bll = new BLL.BLLBase();
                string TaskNo = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells[0].Value.ToString();
                bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", State), new DataParameter("@TaskNo", TaskNo) });

                //堆垛机完成执行
                if (State == "7")
                {
                    DataParameter[] param = new DataParameter[] { new DataParameter("@TaskNo", TaskNo) };
                    bll.ExecNonQueryTran("WCS.Sp_TaskProcess", param);
                }
                BindData();
            }
        }