Exemple #1
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);
            }
        }
Exemple #2
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);
            }
        }
Exemple #3
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);
            }
        }
Exemple #4
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);
            }
        }