Beispiel #1
0
 private void frmUserList_Load(object sender, EventArgs e)
 {
     bll.ExecNonQuery("Security.InsertGroupOperationList");
     colbtn.Name = "Detail";
     colbtn.DefaultCellStyle.NullValue = "删除用户";
     InitSmartTree();
 }
Beispiel #2
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;
     }
 }
Beispiel #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (this.txtWHID.Text.Trim().Length == 0)//新增
            {
                int count = bll.GetRowCount("CMD_WAREHOUSE", string.Format("WarehouseCode='{0}'", this.txtWhCode.Text));
                if (count > 0)
                {
                    WMS.App_Code.JScript.Instance.ShowMessage(this, "此仓库编码已存在,不能新增!");
                    return;
                }
                //新增
                bll.ExecNonQuery("Cmd.InsertWarehouse", new DataParameter[] { new DataParameter("@WarehouseCode", this.txtWhCode.Text), new DataParameter("@WarehouseName", this.txtWhName.Text.Trim().Replace("\'", "\''")), new DataParameter("@MEMO", this.txtMemo.Text.Trim()) });
                WMS.App_Code.JScript.Instance.RegisterScript(this, "ReloadParent();");
                AddOperateLog("仓库管理", "添加仓库信息");
            }
            else
            {
                //更新
                bll.ExecNonQuery("Cmd.UpdateWarehouse", new DataParameter[] { new DataParameter("@WarehouseCode", this.txtWhCode.Text), new DataParameter("@WarehouseName", this.txtWhName.Text.Trim().Replace("\'", "\''")),
                                                                              new DataParameter("@MEMO", this.txtMemo.Text.Trim()), new DataParameter("{0}", this.txtWhCode.Text) });

                WMS.App_Code.JScript.Instance.RegisterScript(this, "UpdateParent();");
                AddOperateLog("仓库管理", "修改仓库信息");
            }

            WMS.App_Code.JScript.Instance.RegisterScript(this, "window.close();");
        }
Beispiel #4
0
        protected void btnDeleteUser_Click(object sender, EventArgs e)
        {
            bll.ExecNonQuery("Security.UpdateUserGroup", new DataParameter[] { new DataParameter("@GroupID", 0), new DataParameter("{0}", ((Button)sender).CommandArgument) });


            BindDataSub(this.hdnRowValue.Value);
        }
Beispiel #5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            DataTable dt = bll.FillDataTable("Cmd.SelectCell", new DataParameter[] { new DataParameter("{0}", string.Format("CellName='{0}'", this.txtNewCellCode.Text)) });

            if (dt.Rows.Count > 0)
            {
                string AreaCode = dt.Rows[0]["AreaCode"].ToString();
                string AisleNo  = dt.Rows[0]["AisleNo"].ToString();
                string CellCode = dt.Rows[0]["CellCode"].ToString();
                if (txtAreaCode.Text != AreaCode)
                {
                    MessageBox.Show("指定的貨位與原有貨位庫區不一致,無法重新分配貨位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (txtAisleNo.Text != AisleNo)
                {
                    MessageBox.Show("指定的貨位與原有貨位巷道不一致,無法重新分配貨位!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (OptionCode == 0)
                {
                    bll.ExecNonQuery("WCS.UpdateTaskFromCellCode", new DataParameter[] { new DataParameter("@NewCellCode", CellCode), new DataParameter("@NewCellName", this.txtNewCellCode.Text), new DataParameter("@TaskNo", this.txtTaskNo.Text) });
                }
                else
                {
                    bll.ExecNonQuery("WCS.UpdateTaskToCellCode", new DataParameter[] { new DataParameter("@NewCellCode", CellCode), new DataParameter("@NewCellName", this.txtNewCellCode.Text), new DataParameter("@TaskNo", this.txtTaskNo.Text) });
                }
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                MessageBox.Show("指定的貨位不存在,請確認!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
Beispiel #6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (strID == "") //新增
            {
                int Count = bll.GetRowCount("CMD_BillType", string.Format("BillTypeCode='{0}'", this.txtID.Text));
                if (Count > 0)
                {
                    WMS.App_Code.JScript.Instance.ShowMessage(this.Page, "该类型编码已经存在!");
                    return;
                }

                bll.ExecNonQuery("Cmd.InsertBillType", new DataParameter[] {
                    new DataParameter("@BillTypeCode", this.txtID.Text.Trim()),
                    new DataParameter("@BillTypeName", this.txtBillTypeName.Text.Trim()),
                    new DataParameter("@Flag", "1"),
                    new DataParameter("@TaskType", "11"),
                    new DataParameter("@TaskLevel", 1),
                    new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                    new DataParameter("@Creator", Session["EmployeeCode"].ToString()),
                    new DataParameter("@Updater", Session["EmployeeCode"].ToString())
                });
            }
            else //修改
            {
                bll.ExecNonQuery("Cmd.UpdateTrainType", new DataParameter[] { new DataParameter("@BillTypeName", this.txtBillTypeName.Text.Trim()),
                                                                              new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                                                                              new DataParameter("@Updater", Session["EmployeeCode"].ToString()),
                                                                              new DataParameter("@BillTypeCode", this.txtID.Text.Trim()) });
            }

            Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
        }
Beispiel #7
0
        private void toolStripButton_Del_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定要删除数据吗?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                string strCode = "'-1',";
                for (int i = 0; i < dgvMain.RowCount; i++)
                {
                    if (dgvMain.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
                    {
                        DataRow dr = ((DataRowView)dgvMain.Rows[i].DataBoundItem).Row;

                        DataTable dt = bll.FillDataTable("WMS.SelectOutStock", new DataParameter[] { new DataParameter("{0}", "BillID='" + dr["BillID"].ToString() + "'") });
                        if (int.Parse(dt.Rows[0]["State"].ToString()) > 0)
                        {
                            Logger.Info("出库单号 " + dr["BillID"].ToString() + " 已经" + dt.Rows[0]["StateDesc"].ToString() + ",不能修改!");
                            return;
                        }
                        if (dr["SourceBillID"].ToString().Length != 0)
                        {
                            Logger.Info("MES上传单据,不能修改!");
                            return;
                        }
                        strCode += "'" + dr["BillID"].ToString() + "',";
                    }
                }

                strCode += "'-1'";
                bll.ExecNonQuery("WMS.DeleteOutStock", new DataParameter[] { new DataParameter("{0}", strCode) });
                Logger.Info("删除出库单号:" + strCode.Replace("'-1',", "").Replace(",'-1'", "").Replace("'", ""));
                this.BindData();
            }
        }
Beispiel #8
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();
            }
        }
Beispiel #9
0
        private void frmUserList_Load(object sender, EventArgs e)
        {
            bll.ExecNonQuery("Security.InsertGroupOperationList");
            colbtn.Name = "Detail";
            colbtn.DefaultCellStyle.NullValue = "删除用户";
            InitSmartTree();

            DataTable dt = Program.dtUserPermission;
            //用户资料
            string filter = "SubModuleCode='MNU_W00C_00E' and OperatorCode='2'";

            DataRow[] drs = dt.Select(filter);
            if (drs.Length <= 0)
            {
                this.toolStripButton_AddUser.Visible = false;
            }
            else
            {
                this.toolStripButton_AddUser.Visible = true;
            }
            filter = "SubModuleCode='MNU_W00C_00E' and OperatorCode='3'";
            drs    = dt.Select(filter);
            if (drs.Length <= 0)
            {
                this.dgvGroupUser.Columns[2].Visible = false;
            }
            else
            {
                this.dgvGroupUser.Columns[2].Visible = true;
            }
        }
Beispiel #10
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (this.txtAreaID.Text.Trim().Length == 0)//新增
            {
                int count = bll.GetRowCount(TableName, string.Format("AreaCode='{0}'", this.txtAreaCode.Text));
                if (count > 0)
                {
                    WMS.App_Code.JScript.Instance.ShowMessage(this, "此库区编码已存在,不能新增!");
                    return;
                }

                bll.ExecNonQuery("Cmd.InsertArea", new DataParameter[] {
                    new DataParameter("@AreaCode", this.txtAreaCode.Text),
                    new DataParameter("@AreaName", this.txtAreaName.Text.Trim().Replace("\'", "\''")),
                    new DataParameter("@WarehouseCode", this.txtWHID.Text),
                    new DataParameter("@Memo", this.txtMemo.Text.Trim())
                });

                WMS.App_Code.JScript.Instance.RegisterScript(this, "ReloadParent();");
                AddOperateLog("库区管理", "添加库区信息");
            }
            else
            {
                bll.ExecNonQuery("Cmd.UpdateArea", new DataParameter[] {
                    new DataParameter("@AreaName", this.txtAreaName.Text.Trim().Replace("\'", "\''")),
                    new DataParameter("@MEMO", this.txtMemo.Text.Trim()),
                    new DataParameter("{0}", this.txtAreaID.Text)
                });


                WMS.App_Code.JScript.Instance.RegisterScript(this, "UpdateParent();");
                AddOperateLog("库区管理", "修改库区信息");
            }
        }
Beispiel #11
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (strID == "") //新增
            {
                int Count = bll.GetRowCount("CMD_Car", string.Format("CarNo='{0}'", this.txtID.Text));
                if (Count > 0)
                {
                    WMS.App_Code.JScript.Instance.ShowMessage(this.Page, "该小车编码已经存在!");
                    return;
                }

                bll.ExecNonQuery("Cmd.InsertCar", new DataParameter[] {
                    new DataParameter("@CarNo", this.txtID.Text.Trim()),
                    new DataParameter("@CarName", this.txtTypeName.Text.Trim()),
                    new DataParameter("@State", this.ddlActive.SelectedValue),
                    new DataParameter("@Memo", this.txtMemo.Text.Trim())
                });
            }
            else //修改
            {
                bll.ExecNonQuery("Cmd.UpdateCar", new DataParameter[] { new DataParameter("@CarName", this.txtTypeName.Text.Trim()),
                                                                        new DataParameter("@State", this.ddlActive.SelectedValue),
                                                                        new DataParameter("@Memo", this.txtMemo.Text.Trim()),

                                                                        new DataParameter("@CarNo", this.txtID.Text.Trim()) });
            }

            Response.Redirect(FormID + "View.aspx?SubModuleCode=" + SubModuleCode + "&FormID=" + Server.UrlEncode(FormID) + "&SqlCmd=" + SqlCmd + "&ID=" + Server.UrlEncode(this.txtID.Text));
        }
Beispiel #12
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();
            }
        }
Beispiel #13
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            int Pallets = 0;

            if (this.txtProductCode.Text.Trim().Length <= 0)
            {
                MessageBox.Show("产品编号不能为空,请选取!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.btnProductCode.Focus();
                return;
            }
            if (this.txtBillID.Text.Trim().Length <= 0)
            {
                MessageBox.Show("单号不能为空,请输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtBillID.Focus();
                return;
            }
            int.TryParse(this.txtPallets.Text.Trim(), out Pallets);
            if (Pallets <= 0)
            {
                MessageBox.Show("计划盘数不正确,请重输!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtPallets.Focus();
                return;
            }



            if (BillID.Length <= 0) //新增
            {
                int Count = bll.GetRowCount("WCS_ProducePlan", string.Format("BillID='{0}'", this.txtBillID.Text.Trim()));
                if (Count > 0)
                {
                    this.txtBillID.Text = bll.GetAutoCode("PP", this.dtpBillDate.Value, "1=1");
                }

                bll.ExecNonQuery("WCS.InsertProducePlan", new DataParameter[] {
                    new DataParameter("@BillDate", this.dtpBillDate.Value),
                    new DataParameter("@BillID", this.txtBillID.Text),
                    new DataParameter("@ProductCode", this.txtProductCode.Text.Trim()),
                    new DataParameter("@Pallets", Pallets),
                    new DataParameter("@AdjustedPallets", Pallets),
                    new DataParameter("@State", "0"),
                    new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                    new DataParameter("@Creator", "admin"),
                    new DataParameter("@Adjuster", "admin")
                });
            }
            else
            {
                bll.ExecNonQuery("WCS.UpdateProducePlan", new DataParameter[] {
                    new DataParameter("@BillID", this.txtBillID.Text),
                    new DataParameter("@AdjustedPallets", Pallets),
                    new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                    new DataParameter("@Adjuster", "admin")
                });
            }
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Beispiel #14
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.txtDeviceNo.Text.Trim().Length <= 0)
            {
                MessageBox.Show("设备编号不能为空,请输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtDeviceNo.Focus();
                return;
            }
            if (this.txtDeviceName.Text.Trim().Length <= 0)
            {
                MessageBox.Show("设备名称不能为空,请输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtDeviceName.Focus();
                return;
            }

            if (DeviceNo.Length <= 0) //新增
            {
                int Count = bll.GetRowCount("CMD_Device", string.Format("DeviceNo='{0}'", this.txtDeviceNo.Text.Trim()));
                if (Count > 0)
                {
                    MessageBox.Show("该设备编号已经存在,请确认!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtDeviceNo.Focus();
                    return;
                }

                bll.ExecNonQuery("Cmd.InsertDevice", new DataParameter[] {
                    new DataParameter("@Flag", dr["Flag"]),
                    new DataParameter("@DeviceType", dr["DeviceType"]),
                    new DataParameter("@DeviceNo", this.txtDeviceNo.Text.Trim()),
                    new DataParameter("@DeviceNo2", this.txtDeviceNo2.Text.Trim()),
                    new DataParameter("@DeviceName", this.txtDeviceName.Text),
                    new DataParameter("@State", this.cmbState.SelectedIndex),
                    new DataParameter("@AlarmCode", this.txtAlarmCode.Text),
                    new DataParameter("@ServiceName", this.txtServiceName.Text),
                    new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                    new DataParameter("@Creator", "admin"),
                    new DataParameter("@Updater", "admin")
                });
            }
            else //修改
            {
                bll.ExecNonQuery("Cmd.UpdateDevice", new DataParameter[] {
                    new DataParameter("@Flag", this.txtFlag.Text),
                    new DataParameter("@DeviceType", this.txtDeviceType.Text),
                    new DataParameter("@DeviceNo", this.txtDeviceNo.Text.Trim()),
                    new DataParameter("@DeviceNo2", this.txtDeviceNo2.Text.Trim()),
                    new DataParameter("@DeviceName", this.txtDeviceName.Text),
                    new DataParameter("@State", this.cmbState.SelectedIndex),
                    new DataParameter("@AlarmCode", this.txtAlarmCode.Text),
                    new DataParameter("@ServiceName", this.txtServiceName.Text),
                    new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                    new DataParameter("@Updater", "admin")
                });
            }
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Beispiel #15
0
        private void Send2PLC(string serviceName, DataRow dr, string carNo)
        {
            string TaskNo    = dr["TaskNo"].ToString();
            string BillID    = dr["BillID"].ToString();
            string TaskType  = dr["TaskType"].ToString();
            string state     = dr["State"].ToString();
            int    taskType  = 10;
            string NextState = "3";

            if (state == "0")
            {
                if (TaskType == "13")
                {
                    taskType  = 9;
                    NextState = "4";
                }
                else
                {
                    taskType  = 11;
                    NextState = "4";
                }
            }

            string fromStation = dr["FromStation"].ToString();
            string toStation   = dr["ToStation"].ToString();

            int[] cellAddr = new int[10];

            cellAddr[0] = 0;
            cellAddr[1] = 0;
            cellAddr[2] = 0;

            cellAddr[3] = byte.Parse(fromStation.Substring(0, 3));
            cellAddr[4] = byte.Parse(fromStation.Substring(3, 3));
            cellAddr[5] = byte.Parse(fromStation.Substring(6, 3));
            cellAddr[6] = byte.Parse(toStation.Substring(0, 3));
            cellAddr[7] = byte.Parse(toStation.Substring(3, 3));
            cellAddr[8] = byte.Parse(toStation.Substring(6, 3));
            cellAddr[9] = taskType;

            int taskNo = int.Parse(TaskNo);

            Context.ProcessDispatcher.WriteToService(serviceName, "TaskAddress", cellAddr);
            Context.ProcessDispatcher.WriteToService(serviceName, "TaskNo", taskNo);
            if (WriteToService(serviceName, "WriteFinished", 1))
            {
                bll.ExecNonQuery("WCS.UpdateTaskTimeByTaskNo", new DataParameter[] { new DataParameter("@State", NextState), new DataParameter("@CarNo", carNo), new DataParameter("@TaskNo", TaskNo) });
                bll.ExecNonQuery("WCS.UpdateBillStateByBillID", new DataParameter[] { new DataParameter("@State", 3), new DataParameter("@BillID", BillID) });
            }
            Logger.Info("任务:" + dr["TaskNo"].ToString() + "已下发给" + carNo + "穿梭车;起始地址:" + fromStation + ",目标地址:" + toStation);
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.txtShelfID.Text.Trim().Length == 0)
                {
                    int count = bll.GetRowCount("CMD_WH_SHELF", string.Format("ShelfCode='{0}'", this.txtShelfCode.Text));
                    if (count > 0)
                    {
                        WMS.App_Code.JScript.Instance.ShowMessage(this, "此货架编码已存在,不能新增!");
                        return;
                    }

                    bll.ExecNonQuery("Cmd.InsertShelf", new DataParameter[] {
                        new DataParameter("@WarehouseCode", this.txtWHID.Text),
                        new DataParameter("@AreaCode", this.txtAreaID.Text.Trim()),
                        new DataParameter("@ShelfCode", this.txtShelfCode.Text),
                        new DataParameter("@ShelfName", this.txtShelfName.Text.Trim()),
                        new DataParameter("@Rows", this.txtCellRows.Text),
                        new DataParameter("@Columns", this.txtCellCols.Text.Trim()),
                        new DataParameter("@IsActive", this.ddlActive.SelectedValue),
                        new DataParameter("@Memo", this.txtMemo.Text.Trim())
                    });
                    //this.btnContinue.Enabled = true;
                    //this.btnSave.Enabled = false;
                    WMS.App_Code.JScript.Instance.RegisterScript(this, "ReloadParent();");
                    AddOperateLog("货贺管理", "添加货贺信息");
                }
                else
                {
                    bll.ExecNonQuery("Cmd.UpdateShelf", new DataParameter[] { new DataParameter("@WarehouseCode", this.txtWHID.Text),
                                                                              new DataParameter("@AreaCode", this.txtAreaID.Text.Trim()),
                                                                              new DataParameter("@ShelfName", this.txtShelfName.Text.Trim()),
                                                                              new DataParameter("@Rows", this.txtCellRows.Text),
                                                                              new DataParameter("@Columns", this.txtCellCols.Text.Trim()),
                                                                              new DataParameter("@IsActive", this.ddlActive.SelectedValue),
                                                                              new DataParameter("@Memo", this.txtMemo.Text.Trim()),
                                                                              new DataParameter("{0}", this.txtShelfID.Text) });


                    WMS.App_Code.JScript.Instance.RegisterScript(this, "UpdateParent();");
                    AddOperateLog("货贺管理", "修改货贺信息");
                }
            }
            catch (Exception exp)
            {
                WMS.App_Code.JScript.Instance.ShowMessage(this, exp.Message);
            }
            //JScript.Instance.RegisterScript(this, "window.close();");
        }
Beispiel #17
0
 private void dgvGroupUser_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == 2)
     {
         if ((this.dgvGroupUser.Rows[e.RowIndex].DataBoundItem as DataRowView).Row["UserName"].ToString() != "admin")
         {
             bll.ExecNonQuery("Security.UpdateUserGroup", new DataParameter[] { new DataParameter("@GroupID", 0), new DataParameter("{0}", (this.dgvGroupUser.Rows[e.RowIndex].DataBoundItem as DataRowView).Row["UserID"].ToString()) });
             BindDataSub();
         }
         else
         {
             Logger.Info("用户组不能删除管理员账号!");
         }
     }
 }
Beispiel #18
0
        void Logger_OnLog(MCP.LogEventArgs args)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new LogEventHandler(Logger_OnLog), args);
            }
            else
            {
                lock (lbLog)
                {
                    string msg1 = string.Format("[{0}]", args.LogLevel);
                    string msg2 = string.Format(" {0}", DateTime.Now);
                    string msg3 = string.Format(" {0}", args.Message);
                    if (args.LogLevel != LogLevel.DEBUG)
                    {
                        this.lbLog.BeginUpdate();
                        ListViewItem item = new ListViewItem(new string[] { msg1, msg2, msg3 });

                        if (msg1.Contains("[ERROR]"))
                        {
                            //item.ForeColor = Color.Red;
                            item.BackColor = Color.Red;
                        }
                        lbLog.Items.Insert(0, item);
                        this.lbLog.EndUpdate();
                    }
                    WriteLoggerFile(msg1 + msg2 + msg3);
                    if (!msg1.Contains("[DEBUG]"))
                    {
                        bll.ExecNonQuery("WCS.InsertLog", new DataParameter[] { new DataParameter("@LogDate", DateTime.Now), new DataParameter("@LogType", args.LogLevel.ToString()), new DataParameter("@Info", args.Message.ToString()) });
                    }
                }
            }
        }
Beispiel #19
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);
            }
        }
Beispiel #20
0
        private void toolStripButton_Delete_Click(object sender, EventArgs e)
        {
            if (this.dgvMain.CurrentRow == null)
            {
                return;
            }
            if (this.dgvMain.CurrentRow.Index >= 0)
            {
                string ProductCode = this.dgvMain.SelectedRows[0].Cells[0].Value.ToString();

                if (this.dgvMain.SelectedRows[0].Cells["colFixed"].Value.ToString() == "0")
                {
                    //删除产品,先判断此产品是否被用到
                    //判断能否删除
                    int Count = bll.GetRowCount("VUsed_CMD_Product", string.Format("ProductCode='{0}'", ProductCode));
                    if (Count > 0)
                    {
                        MessageBox.Show("此产品已被单据使用,不可删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    if (MessageBox.Show("您确定要删除此产品吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    {
                        bll.ExecNonQuery("Cmd.DeleteProduct", new DataParameter[] { new DataParameter("{0}", ProductCode) });
                        this.BindData();
                    }
                }
                else
                {
                    MessageBox.Show("此产品为系统内定,不可删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            }
        }
Beispiel #21
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");
            }
        }
Beispiel #22
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            try
            {
                string strUserID = "-1,";
                for (int i = 0; i < gvMain.Rows.Count; i++)
                {
                    CheckBox chk = (CheckBox)gvMain.Rows[i].Cells[0].Controls[0];
                    if (gvMain.Rows[i].Cells[1].Text == "admin" && chk.Checked)
                    {
                        WMS.App_Code.JScript.Instance.ShowMessage(this.UpdatePanel1, "管理员帐号不能删除!");
                        continue;
                    }
                    if (chk.Enabled && chk.Checked)
                    {
                        strUserID += dtUser.Rows[i]["UserID"].ToString() + ",";
                    }
                }
                strUserID += "-1";


                bll.ExecNonQuery("Security.DeleteUser", new DataParameter[] { new DataParameter("{0}", strUserID) });
                AddOperateLog("用户管理", "删除用户信息");
                SetBtnEnabled(int.Parse(ViewState["CurrentPage"].ToString()), SqlCmd, ViewState["filter"].ToString(), pageSize, gvMain, btnFirst, btnPre, btnNext, btnLast, btnToPage, lblCurrentPage, this.UpdatePanel1);
            }
            catch (Exception exp)
            {
                WMS.App_Code.JScript.Instance.ShowMessage(this.UpdatePanel1, exp.Message);
            }
        }
Beispiel #23
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;
            }
        }
Beispiel #24
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");

            }
        }
Beispiel #25
0
        public string ImportWCSTask(string taskData)
        {
            Log.WriteToLog("1", "transSRMTask-Rec", taskData);
            string json  = "";
            string id    = "";
            string state = "";
            string State = "";

            try
            {
                DataTable dt = Util.JsonHelper.Json2Dtb(taskData);
                if (dt.Rows.Count > 0)
                {
                    id = dt.Rows[0]["id"].ToString();
                }
                else
                {
                    id = "";
                }

                bll.ExecNonQuery("WCS.DeleteWcsTemp");
                bll.BatchInsertTable(dt, "WCS_TaskTemp");
                bll.ExecNonQueryTran("WCS.Sp_ImportWmsTask");

                json = "{\"id\":\"" + id + "\",\"returnCode\":\"000\"" + ",\"message\":\"成功\",\"finishDate\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\",\"field1\":\"null\"}";
            }
            catch (Exception ex)
            {
                json = "{\"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", json);
            return(json);
        }
Beispiel #26
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);
        }
Beispiel #27
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);
            }
        }
Beispiel #28
0
        private void toolStripButton_Del_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定要删除数据吗?", "询问", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                string strCode = "'-1',";
                for (int i = 0; i < dgvMain.RowCount; i++)
                {
                    if (dgvMain.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
                    {
                        DataRow dr = ((DataRowView)dgvMain.Rows[i].DataBoundItem).Row;

                        if (bll.GetRowCount("VUsed_CMD_ProductCategory", "CategoryCode='" + dr["CategoryCode"].ToString() + "'") > 0)
                        {
                            Logger.Info("产品类别编号 " + dr["CategoryCode"].ToString() + " 已经被其它单据使用,无法删除!");
                            return;
                        }
                        strCode += "'" + dr["CategoryCode"].ToString() + "',";
                    }
                }

                strCode += "'-1'";
                bll.ExecNonQuery("Cmd.DeleteProductCategory", new DataParameter[] { new DataParameter("{0}", strCode) });
                Logger.Info("删除产品类别编号:" + strCode.Replace("'-1',", "").Replace(",'-1'", "").Replace("'", ""));
                this.BindData("1=1");
            }
        }
Beispiel #29
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);
        }
Beispiel #30
0
        private void toolStripButton_Del_Click(object sender, EventArgs e)
        {
            if (this.dgvMain.CurrentRow == null)
            {
                return;
            }
            if (this.dgvMain.CurrentRow.Index >= 0)
            {
                if (this.dgvMain.CurrentRow.Cells["colGroupName"].Value.ToString() != "admin")
                {
                    if (DialogResult.Yes == MessageBox.Show("您确定要删除此用户组吗?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                    {
                        int membercount = (int)bll.ExecScalar("Security.SelectGroupMemberCount", new DataParameter[] { new DataParameter("@GroupID", Convert.ToInt32((this.dgvMain.CurrentRow.DataBoundItem as DataRowView).Row["GroupID"]).ToString()) });
                        if (membercount > 0)
                        {
                            Logger.Info("用户组还有用户存在,请调整后再删除!");
                            return;
                        }

                        bll.ExecNonQuery("Security.DeleteGroup", new DataParameter[] { new DataParameter("{0}", (this.dgvMain.CurrentRow.DataBoundItem as DataRowView).Row["GroupID"].ToString()) });
                        this.BindData();
                    }
                }
                else
                {
                    Logger.Info("管理用户组不能删除!");
                    return;
                }
            }
        }
Beispiel #31
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);
            }
        }
Beispiel #32
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                string users = "-1,";

                for (int i = 0; i < dgvMain.Rows.Count; i++)
                {
                    if (dgvMain.Rows[i].Cells[0].Value != null)
                    {
                        if (dgvMain.Rows[i].Cells[0].Value.ToString() == "True")
                        {
                            users += (dgvMain.Rows[i].DataBoundItem as DataRowView).Row["UserID"].ToString() + ",";
                        }
                    }
                }
                users += "-1";

                bll.ExecNonQuery("Security.UpdateUserGroup", new DataParameter[] { new DataParameter("@GroupID", GroupID), new DataParameter("{0}", users) });
                this.DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #33
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;
            }
        }
Beispiel #34
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, "设置成功!");
        }
Beispiel #35
0
        private void ToolStripMenuItemChangeCarNo_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();
                string CraneNo = this.dgvMain.Rows[this.dgvMain.CurrentCell.RowIndex].Cells["colCraneNo"].Value.ToString();
                frmTaskCarNo f = new frmTaskCarNo(CraneNo);

                if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    string CarNo = f.carNo;
                    bll.ExecNonQuery("WCS.UpdateTaskCarNoByTaskNo", new DataParameter[] { new DataParameter("@CarNo", CarNo), new DataParameter("@TaskNo", TaskNo) });
                }

                BindData();
            }
        }
Beispiel #36
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();
            }
        }
Beispiel #37
0
        protected override void StateChanged(StateItem stateItem, IProcessDispatcher dispatcher)
        {
            try
            {
                object obj = ObjectUtil.GetObject(stateItem.State);
                if (obj == null)
                    return;
                if (obj.ToString() == "48" || obj.ToString() == "0")
                    return;

                string carNo = stateItem.ItemName.Substring(0, 2);

                Logger.Info("小车" + carNo + "接到入库确认请求");
                string CraneNo = "01";
                if (carNo == "02")
                    CraneNo = "02";

                BLL.BLLBase bll = new BLL.BLLBase();
                //判断堆垛机状态是否可用

                //查找有无请求状态(state='1')的任务,如没有则认为是空托盘回库
                string filter = string.Format("WCS_Task.State='1' and WCS_TASK.TaskType='11' and WCS_TASK.CarNo='{0}'", carNo);
                DataParameter[] parameter = new DataParameter[] { new DataParameter("{0}", filter) };
                DataTable dt = bll.FillDataTable("WCS.SelectTask", parameter);

                int rows = 0;
                if (dt.Rows.Count > 0)
                {
                    rows = bll.ExecNonQuery("WCS.UpdateTaskState", new DataParameter[] { new DataParameter("@State", 2), new DataParameter("@CarNo", carNo) });
                    WriteToService("CarPLC", carNo + "_CarReply", 49);
                    Logger.Info("小车:" + carNo + "收到入库请求,更新任务状态,影响行数" + rows);
                }
                else
                {
                    //判断有无正在执行的任务,如有不做处理,如没有则产生一笔空盘回库任务
                    filter = string.Format("WCS_Task.State='3' and WCS_TASK.TaskType='11' and WCS_TASK.CarNo='{0}'", carNo);
                    parameter = new DataParameter[] { new DataParameter("{0}", filter) };
                    DataTable dting = bll.FillDataTable("WCS.SelectTask", parameter);

                    if (dting.Rows.Count > 0)
                    {
                        WriteToService("CarPLC", carNo + "_CarReply", 50);
                        return;
                    }
                    //有无盘点回库任务
                    filter = string.Format("WCS_Task.State='4' and WCS_TASK.TaskType='14' and WCS_TASK.CarNo='{0}'", carNo);
                    parameter = new DataParameter[] { new DataParameter("{0}", filter) };
                    dting = bll.FillDataTable("WCS.SelectTask", parameter);
                    if (dting.Rows.Count > 0)
                    {
                        //盘点任务改变状态为5,堆垛机调度回库
                        string TaskNo = dting.Rows[0]["TaskNo"].ToString();
                        bll.ExecNonQuery("WCS.UpdateTaskStateByTaskNo", new DataParameter[] { new DataParameter("@State", 5), new DataParameter("@TaskNo", TaskNo) });

                        WriteToService("CarPLC", carNo + "_CarReply", 49);
                        return;
                    }

                    //查找锁定货位,且产品是托盘的货位,如有判断为实托盘出库后,托盘回库
                    string ProductCode = "00" + CraneNo;
                    parameter = new DataParameter[]
                    {
                        new DataParameter("{0}", string.Format("CMD_Cell.ProductCode='{0}' and CMD_Cell.IsActive='1' and CMD_Cell.IsLock='1' and CMD_Cell.ErrorFlag!='1'",ProductCode)),
                        new DataParameter("{1}", carNo)
                    };
                    dt = bll.FillDataTable("CMD.SelectCellByCar", parameter);
                    if (dt.Rows.Count > 0)
                    {
                        //产生一笔空托盘入库任务
                        //锁定货位
                        parameter = new DataParameter[]
                        {
                            new DataParameter("@CarNo", carNo),
                            new DataParameter("@CraneNo", CraneNo),
                            new DataParameter("@CellCode", dt.Rows[0]["CellCode"].ToString())
                        };
                        bll.ExecNonQueryTran("WCS.Sp_RequestPalletInTask", parameter);
                        WriteToService("CarPLC", carNo + "_CarReply", 49);
                        Logger.Info("小车:" + carNo + "接到入库请求,产生一笔托盘回库任务");
                    }
                }
                WriteToService("CarPLC", carNo + "_CarReply", 50);
            }
            catch (Exception e)
            {
                Logger.Error("Dispatching.Process.CarProcess:" + e.Message);
            }
        }
Beispiel #38
0
 /// <summary>
 /// 添加操作日志
 /// </summary>
 /// <param name="moduleName">操作模块</param>
 /// <param name="executeOperation">操作内容</param>
 protected void AddOperateLog(string moduleName, string executeOperation)
 {
     BLL.BLLBase bll = new BLL.BLLBase();
     bll.ExecNonQuery("Security.InsertOperatorLog", new 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)});
 }
Beispiel #39
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();
            }
        }
Beispiel #40
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 = "请输入用户名!";
            }
        }