Ejemplo n.º 1
0
        public static bool CrtRgvCmd(object sCmdSno, object sMode, object sEqu,
                                     int sSrc, int sDes, object strPri)
        {
            int     nStn = 0;
            MakeSql mSql = new MakeSql("EquCmd", SqlType.Insert);

            nStn = int.Parse(sCmdSno.ToString());
            mSql.SetStrValue("CmdSno", nStn.ToString("00000"));
            mSql.SetStrValue("EquNo", sEqu.ToString());
            mSql.SetStrValue("CmdMode", sMode.ToString());
            mSql.SetStrValue("CmdSts", "0");
            mSql.SetStrValue("Source", sSrc.ToString());
            mSql.SetStrValue("Destination", sDes.ToString());
            mSql.SetStrValue("LocSize", "0");
            mSql.SetStrValue("Priority", strPri.ToString());
            mSql.SetNumValue("RcvDT", Globals.sEquDt);

            if (dbConn.ExecSql(mSql.GetSql()))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public static bool CrtSlvCmd(object sCmdSno, object sEqu, object sPalletNo,
                                     int sSrc, int sDes, object strPri)
        {
            int     nStn = 0;
            MakeSql mSql = new MakeSql("Slv_Cmd", SqlType.Insert);

            nStn = int.Parse(sCmdSno.ToString());
            mSql.SetStrValue("PalletNo", sPalletNo.ToString());
            mSql.SetStrValue("CmdSno", nStn.ToString("00000"));
            mSql.SetStrValue("EquNo", sEqu.ToString());
            mSql.SetStrValue("CmdSts", "0");
            mSql.SetStrValue("Fr_Stn", sSrc.ToString());
            mSql.SetStrValue("To_Stn", sDes.ToString());
            mSql.SetNumValue("CarNo", "0");
            mSql.SetNumValue("CreateDate", Globals.sEquDt);

            if (dbConn.ExecSql(mSql.GetSql()))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        private void modCmdBtn_Click(object sender, EventArgs e)
        {
            DataRow drCmd = null;

            //if (!Globals.bLogin) { MsgBox.Warning("请先到用户登录模块登录,谢谢!"); return; }
            if (!Globals.CtlValidate(cStnNoCtl, cTraceCtl, cPriCtl, cmbCSts))
            {
                MsgBox.Warning(StrTables.MSG_NOT_FULL);
                return;
            }
            if (MsgBox.Question("是否确认执行?") == DialogResult.No)
            {
                return;
            }

            try
            {
                string sSql = string.Format("select * from Cmd_Mst where Cmd_Sno='{0}'", GCtrl.C5Sno(cmbCmdSno.Text));
                if (!Globals.DB.ExecGetRow(sSql, ref drCmd) || drCmd == null)
                {
                    MsgBox.Warning("查无记录!");
                    return;
                }

                MakeSql mSql = new MakeSql("Cmd_Mst", SqlType.Update);
                mSql.AddStrWhere(drCmd, "Cmd_Sno");
                mSql.SetStrValue("Cmd_Sts", cmbCSts.Text.Split("-".ToCharArray())[0]);
                mSql.SetStrValue("Stn_No", cStnNoCtl.Text.Trim());
                mSql.SetStrValue("Trace", cTraceCtl.Text.Trim());
                mSql.SetStrValue("Prty", cPriCtl.Text.Trim());
                sSql = mSql.GetSql();

                if (Globals.DB.ExecSql(sSql))
                {
                    MsgBox.Information("操作成功!");
                }
            }
            catch (Exception ex)
            {
                Log.WriteLog(ex);
            }
            finally
            {
                flushCmdBtn_Click(null, null);
            }
        }
Ejemplo n.º 4
0
        public static void MoveCmd()
        {
            try
            {
                string    strSql = string.Empty;
                DataTable dtSlv  = new DataTable();
                DataRow   drEqu  = null;

                #region Move EquCmd

                strSql = string.Format(@"select top(1) * from EquCmd where CmdSts>'1' and ReNewFlag='F' and EquNo='R1'");
                if (dbConn.ExecGetRow(strSql, ref drEqu) && drEqu != null)
                {
                    dbConn.BeginTran(true);
                    MakeSql mSql = new MakeSql("EquCmdHis", SqlType.Insert);
                    mSql.SetStrValue(drEqu, "CmdSno", "CmdSts", "CmdMode", "EquNo", "Source", "Destination", "LocSize",
                                     "Priority", "RcvDT", "ActDT", "EndDT", "CompleteCode", "CompleteIndex", "CarNo", "ReNewFlag");
                    mSql.SetNumValue("HISDT", Globals.sEquDt);
                    strSql = mSql.GetSql();

                    if (!dbConn.ExecSql(strSql))
                    {
                        throw new Exception(dbConn.ErrorInfo);
                    }
                    strSql = string.Format(@"delete from EquCmd where CmdSno='{0}' and EquNo='R1'", drEqu["CmdSno"]);
                    if (!dbConn.ExecSql(strSql))
                    {
                        throw new Exception(dbConn.ErrorInfo);
                    }
                    dbConn.CommitTran();
                }

                # endregion
            }
            catch (Exception ex)
            {
                dbConn.RollbackTran();
                Log.WriteLog(ex);
            }
        }
Ejemplo n.º 5
0
        public static bool CrtEquCmd(object sCmdSno, object sMode, object sEqu,
                                     object sSrc, object sDes, object strPri)
        {
            MakeSql mSql = new MakeSql("EquCmd", SqlType.Insert);

            mSql.SetStrValue("CmdSno", sCmdSno.ToString());
            mSql.SetStrValue("EquNo", sEqu.ToString());
            mSql.SetStrValue("CmdMode", sMode.ToString());
            mSql.SetStrValue("CmdSts", "0");
            string sSr = string.Empty;

            switch (sMode.ToString())
            {
            case cCmdMode.In:
                mSql.SetStrValue("Source", sSrc.ToString());
                sSr = GetCrnLoc(sDes);
                //sSr = sSr.Insert(2, "0");
                mSql.SetStrValue("Destination", sSr);
                break;

            case cCmdMode.Out:
                sSr = GetCrnLoc(sSrc);
                //sSr = sSr.Insert(2, "0");
                mSql.SetStrValue("Source", sSr);
                mSql.SetStrValue("Destination", sDes.ToString());
                break;

            case cCmdMode.S2S:
                mSql.SetStrValue("Source", sSrc.ToString());
                mSql.SetStrValue("Destination", sDes.ToString());
                break;

            case cCmdMode.L2L:
                sSr = GetCrnLoc(sSrc);
                //sSr = sSr.Insert(2, "0");
                mSql.SetStrValue("Source", sSr);

                sSr = GetCrnLoc(sDes);
                //sSr = sSr.Insert(2, "0");
                mSql.SetStrValue("Destination", sSr);
                break;

            case cCmdMode.Move:
                mSql.SetStrValue("Source", "1");
                sSr = GetCrnLoc(sDes);
                mSql.SetStrValue("Destination", sSr);
                break;

            case cCmdMode.Pick:
                sSr = GetCrnLoc(sSrc);
                //sSr = sSr.Insert(2, "0");
                mSql.SetStrValue("Source", sSr);
                mSql.SetStrValue("Destination", "1");
                break;

            case cCmdMode.Put:
                mSql.SetStrValue("Source", "1");
                sSr = GetCrnLoc(sDes);
                //sSr = sSr.Insert(2, "0");
                mSql.SetStrValue("Destination", sSr);
                break;

            default:
                return(false);
            }
            mSql.SetStrValue("LocSize", "0");
            mSql.SetStrValue("Priority", strPri.ToString());
            mSql.SetNumValue("RcvDT", Globals.sEquDt);

            if (dbConn.ExecSql(mSql.GetSql()))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }