Exemple #1
0
 /// <summary>
 /// 保存呼叫任务信息
 /// </summary>
 /// <param name="taskInfo"></param>
 /// <returns></returns>
 public static OperateReturnInfo SaveTask(DispatchTaskInfo taskInfo)
 {
     try
     {
         string TaskSQL = "";
         TaskSQL = "insert into tbDispatchTaskInfo( \r\n" +
                   "dispatchNo,stationNo,taskType,BuildTime,CallLand) values ( \r\n" +
                   "'" + taskInfo.dispatchNo + "'," + taskInfo.stationNo.ToString() + ",0,'" + DateTime.Now.ToString("yyyyMMddHHmmss") + "','" + taskInfo.CallLand + "') \r\n";
         foreach (DispatchTaskDetail item in taskInfo.TaskDetail)
         {
             TaskSQL += "insert into tbDispatchTaskDetail ( \r\n" +
                        "dispatchNo,DetailID,LandCode,OperType,PutType,IsAllowExcute) values ( \r\n" +
                        "'" + taskInfo.dispatchNo + "'," + item.DetailID.ToString() + ",'" + item.LandCode + "'," + item.OperType + "," + item.PutType + "," +
                        item.IsAllowExcute.ToString() /*(TempLand == ArmLand4 ? "0" : "1")*/ + ") \r\n";
         }
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable hs = new Hashtable();
             hs["sql"] = TaskSQL;
             dbOperator.SetDatas("SaveTask", hs);
             scope.Complete();
         }
         return(new OperateReturnInfo(OperateCodeEnum.Success));
     }
     catch (Exception ex)
     { return(new OperateReturnInfo(OperateCodeEnum.Failed, ex.Message)); }
 }
Exemple #2
0
 /// <summary>
 /// 更新任务状态
 /// </summary>
 /// <param name="dispathNo"></param>
 /// <param name="UpdateState"></param>
 public static void UpdateTaskState(string dispathNo, int UpdateState)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   hs         = new Hashtable();
         hs["dispathNo"]   = dispathNo;
         hs["UpdateState"] = UpdateState;
         if (UpdateState == 2)
         {
             hs["FinishTime"] = DateTime.Now.ToString("yyyyMMddHHmmss");
         }
         else
         {
             hs["FinishTime"] = "";
         }
         using (TransactionScope scope = new TransactionScope())
         {
             dbOperator.SetDatas("ModifyTaskStateByNo", hs);
             scope.Complete();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #3
0
 /// <summary>
 /// 更新任务明细被领用后信息
 /// </summary>
 public static void TaskHandle(string dispatchNo, int AGVID, int TaskState, string LandCode, int TaskDetialID)
 {
     try
     {
         //更新任务状态
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable dic = new Hashtable();
             dic["dispatchNo"]   = dispatchNo;
             dic["ExeAgvID"]     = AGVID;
             dic["TaskState"]    = TaskState;
             dic["LandCode"]     = LandCode;
             dic["TaskDetialID"] = TaskDetialID;
             if (TaskState == 2)
             {
                 dic["State"]      = TaskState;
                 dic["FinishTime"] = DateTime.Now.ToString("yyyyMMddHHmmss");
                 dbOperator.SetDatas("UpdateTaskInfo", dic);
             }
             else if (TaskState == 1)
             {
                 dic["ExeTime"] = DateTime.Now.ToString("yyyyMMddHHmmss");
                 dbOperator.SetDatas("UpdateTaskDetail", dic);
             }
             scope.Complete();
         }
     }
     catch (Exception ex)
     { LogHelper.WriteErrorLog(ex); }
 }
Exemple #4
0
 /// <summary>
 /// 界面手动更新任务明细
 /// </summary>
 public static void TaskHandle(string dispatchNo, int TaskDetailID, int TaskState)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable dic = new Hashtable();
             dic["State"]        = TaskState;
             dic["dispatchNo"]   = dispatchNo;
             dic["TaskDetailID"] = TaskDetailID;
             if (TaskState == 0)
             {
                 dic["FinishTime"] = "";
             }
             else
             {
                 dic["FinishTime"] = DateTime.Now.ToString("yyyyMMddHHmmss");
             }
             dbOperator.SetDatas("UpdateTaskState", dic);
             scope.Complete();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #5
0
        /// <summary>
        /// 更新储位备注
        /// </summary>
        /// <param name="SotreID"></param>
        /// <param name="remark"></param>
        public static void UpdteStorageRemark(int SotreID, string remark)
        {
            IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
            Hashtable   dic        = new Hashtable();

            dic["ID"]     = SotreID;
            dic["remark"] = remark;
            dbOperator.SetDatas("UpdteStorageRemark", dic);
        }
Exemple #6
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                this.label1.Focus();
                if (Valide())
                {
                    using (DevExpress.Utils.WaitDialogForm dialog = new DevExpress.Utils.WaitDialogForm("正在测试数据库连接,请稍后...", "提示"))
                    {
                        if (TestdataBaseInfo == null)
                        {
                            TestdataBaseInfo = new DataBaseInfo();
                        }
                        TestdataBaseInfo.DataBaseName = this.txtDBName.Text.Trim();
                        TestdataBaseInfo.DbSource     = this.txtIP.Text.Trim();
                        TestdataBaseInfo.Pwd          = this.txtPass.Text.Trim();
                        TestdataBaseInfo.Uid          = this.txtUser.Text.Trim();

                        IDbOperator dbTesthqOperator = CreateDbOperator.DbOperatorInstance(TestdataBaseInfo);
                        //测试数据库
                        if (dbTesthqOperator.ServerIsThrough())
                        {
                        }
                        else
                        {
                            MsgBox.ShowError("数据库地址不正确!");
                            return;
                        }
                    }
                    DataTable dt = ConnectConfigTool.GetDataTableStruct();
                    DataRow   dr = dt.NewRow();
                    dr["DBIP"]       = this.txtIP.Text.Trim();
                    dr["DBName"]     = this.txtDBName.Text.Trim();
                    dr["DBUser"]     = this.txtUser.Text.Trim();
                    dr["DBPass"]     = this.txtPass.Text.Trim();
                    dr["ServerIP"]   = this.txtServeIP.Text.Trim();
                    dr["ServerPort"] = this.txtServePort.Text.Trim();
                    dt.Rows.Add(dr);
                    DtToTxt(dt);
                    ConnectConfigTool.setDBase();
                    MsgBox.ShowWarn("保存成功!");
                    if (MsgBox.ShowQuestion("是否重新加载地图?") == DialogResult.Yes)
                    {
                        this.DialogResult = DialogResult.OK;
                    }
                    else
                    {
                        this.DialogResult = DialogResult.Cancel;
                    }
                    this.Close();
                    return;
                }
            }
            catch (Exception ex)
            { MsgBox.ShowError(ex.Message); }
        }
Exemple #7
0
 /// <summary>
 /// 创建任务
 /// </summary>
 public static void CreatTaskInfo(DispatchTaskInfo TaskInfo, bool IsUserStoreState)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable hs = new Hashtable();
             hs["dispatchNo"] = TaskInfo.dispatchNo;
             hs["stationNo"]  = TaskInfo.stationNo;
             hs["BuildTime"]  = DateTime.Now.ToString("yyyyMMddHHmmss");
             hs["TaskState"]  = TaskInfo.TaskState;
             hs["CallLand"]   = TaskInfo.CallLand;
             hs["CallID"]     = TaskInfo.CallID;
             hs["taskType"]   = TaskInfo.taskType;
             hs["GoodsInfo"]  = TaskInfo.GoodsInfo;
             hs["OwerArea"]   = TaskInfo.OwerArea;
             //保存任务主表
             dbOperator.SetDatas("InsertTaskInfo", hs);
             //保存任务明细信息
             foreach (DispatchTaskDetail detail in TaskInfo.TaskDetail)
             {
                 hs["DetailID"]       = detail.DetailID;
                 hs["LandCode"]       = detail.LandCode;
                 hs["OperType"]       = detail.OperType;
                 hs["IsAllowExcute"]  = detail.IsAllowExcute;
                 hs["PassType"]       = detail.PassType;
                 hs["State"]          = detail.State;
                 hs["PutType"]        = detail.PutType;
                 hs["IsSensorStop"]   = detail.IsSensorStop;
                 hs["PassTye"]        = detail.PassType;
                 hs["IsNeedCallBack"] = detail.IsNeedCallBack;
                 hs["IsCallGoods"]    = detail.IsCallGoods;
                 hs["StorageID"]      = detail.StorageID;
                 dbOperator.SetDatas("InsertTaskDetail", hs);
                 //处理储位占用
                 if (IsUserStoreState)
                 {
                     StorageInfo CurrentTaskUseStore = CoreData.StorageList.FirstOrDefault(p => p.ID == detail.StorageID);
                     if (CurrentTaskUseStore != null)
                     {
                         hs["storeState"] = CurrentTaskUseStore.StorageState;
                         hs["LockState"]  = 1;
                         hs["ID"]         = CurrentTaskUseStore.ID;
                         dbOperator.SetDatas("UpdateStorageState", hs);
                         CurrentTaskUseStore.LockState = 1;
                     }
                 }
             }
             scope.Complete();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #8
0
 /// <summary>
 /// 加载调度程序里配置信息
 /// </summary>
 /// <returns></returns>
 public static IList <DispatchAssembly> Load_DisptchAssembly()
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         DataTable   dtResult   = dbOperator.LoadDatas("Load_DisptchAssembly");
         IList <DispatchAssembly> DispatchAssems = ConnectConfigTool.TableToEntity <DispatchAssembly>(dtResult);
         return(DispatchAssems);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #9
0
 /// <summary>
 /// 加载所有指令档案
 /// </summary>
 /// <returns></returns>
 public static IList <CmdInfo> Load_Cmd()
 {
     try
     {
         IDbOperator     dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         DataTable       dtResult   = dbOperator.LoadDatas("Load_Cmd");
         IList <CmdInfo> CmdInfos   = ConnectConfigTool.TableToEntity <CmdInfo>(dtResult);
         return(CmdInfos);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #10
0
 /// <summary>
 /// 匹配线段配置
 /// </summary>
 /// <returns></returns>
 public static IList <RouteFragmentConfigInfo> Load_RouteFragment()
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   hs         = new Hashtable();
         DataTable   dtResult   = dbOperator.LoadDatas("Load_RouteFragment");
         IList <RouteFragmentConfigInfo> RouteFragmens = ConnectConfigTool.TableToEntity <RouteFragmentConfigInfo>(dtResult);
         return(RouteFragmens);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #11
0
 /// <summary>
 /// 接受按钮盒放行命令后处理任务明细
 /// </summary>
 public static void ReleaseCarByCallBox(string TaskNo, string LandCode)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   hs         = new Hashtable();
         hs["TaskNo"]   = TaskNo;
         hs["LandCode"] = LandCode;
         dbOperator.SetDatas("ReleaseCar", hs);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #12
0
 /// <summary>
 /// 加载用户可操作按钮
 /// </summary>
 public static IList <SysOprButtonToCategory> LoadUserOprBtn(string UserID)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   hs         = new Hashtable();
         hs["UserID"] = UserID;
         DataTable dt = dbOperator.LoadDatas("QueryUserOperButttons", hs);
         return(ConnectConfigTool.TableToEntity <SysOprButtonToCategory>(dt));
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #13
0
 /// <summary>
 /// 根据呼叫器ID加载呼叫器配置明细
 /// </summary>
 /// <param name="CallBoxID"></param>
 /// <returns></returns>
 public static IList <CallBoxDetail> LoadCallBoxDetails(int CallBoxID)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   dic        = new Hashtable();
         dic["CallBoxID"] = CallBoxID;
         DataTable dt = dbOperator.LoadDatas("LoadCallBoxDetails", dic);
         return(DataToObject.TableToEntity <CallBoxDetail>(dt));
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #14
0
 /// <summary>
 /// 加载所有的地标
 /// </summary>
 /// <returns></returns>
 public static IList <LandMarkShap> LoadLandShaps()
 {
     try
     {
         IDbOperator          dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable            hs         = new Hashtable();
         DataTable            dt         = dbOperator.LoadDatas("getLandMarks", hs);
         IList <LandMarkShap> lands      = ConnectConfigTool.TableToEntity <LandMarkShap>(dt);
         return(lands);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #15
0
 /// <summary>
 /// 加载所有的车辆信息
 /// </summary>
 /// <returns></returns>
 public static IList <CarInfo> LoadCarShap()
 {
     try
     {
         IDbOperator     dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable       hs         = new Hashtable();
         DataTable       dt         = dbOperator.LoadDatas("LoadAGVAchive", hs);
         IList <CarInfo> Cars       = ConnectConfigTool.TableToEntity <CarInfo>(dt);
         return(Cars);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #16
0
 /// <summary>
 /// 根据任务配置明细加载其必经地标档案
 /// </summary>
 /// <returns></returns>
 public static IList <TaskConfigMustPass> LoadTaskMustPass(string TaskConditonCode, int TaskConfigDetailID)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   dic        = new Hashtable();
         dic["TaskConditonCode"]   = TaskConditonCode;
         dic["TaskConfigDetailID"] = TaskConfigDetailID;
         DataTable dt = dbOperator.LoadDatas("LoadTaskMustPass", dic);
         return(ConnectConfigTool.TableToEntity <TaskConfigMustPass>(dt));
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #17
0
 /// <summary>
 /// 移动任务历史表
 /// </summary>
 public static void MoveTaskHistory()
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             dbOperator.SetDatas("MoveTaskHistory");
             scope.Complete();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #18
0
 public static IList <TraJunctionSegInfo> QueryJunctionSeg(int TraJunctionID)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   hs         = new Hashtable();
         hs["TraJunctionID"] = TraJunctionID;
         DataTable dt = dbOperator.LoadDatas("QueryJunctionSeg", hs);
         IList <TraJunctionSegInfo> segs = ConnectConfigTool.TableToEntity <TraJunctionSegInfo>(dt);
         return(segs);
     }
     catch (Exception e)
     { throw e; }
 }
Exemple #19
0
 //根据储位状态修改任务状态
 public static void UpdateTask()
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   hs         = new Hashtable();
         using (TransactionScope scope = new TransactionScope())
         {
             dbOperator.SetDatas("UpdateTask", hs);
             scope.Complete();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #20
0
 /// <summary>
 /// 根据任务明细查询相应必经地标的动作档案信息
 /// </summary>
 /// <returns></returns>
 public static IList <TaskConfigMustPass> LoadIOActiones(string TaskConditonCode, int TaskConfigDetailID)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   hs         = new Hashtable();
         hs["TaskConditonCode"]   = TaskConditonCode;
         hs["TaskConfigDetailID"] = TaskConfigDetailID;
         DataTable dtResult = dbOperator.LoadDatas("LoadMustPassbyConditonCode");
         IList <TaskConfigMustPass> TaskConfigMustPasses = ConnectConfigTool.TableToEntity <TaskConfigMustPass>(dtResult);
         return(TaskConfigMustPasses);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #21
0
 /// <summary>
 /// 更新PLC回写状态
 /// </summary>
 /// <param name="No"></param>
 /// <param name="DetailID"></param>
 public static void UpdateIsNeedCallBack(int AGVID)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable dic = new Hashtable();
             dic["AGVID"] = AGVID;
             dbOperator.SetDatas("UpdateIsNeedCallBack", dic);
             scope.Complete();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #22
0
 public static void DeleteCarRemeberRoute(int AGVID)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable hs = new Hashtable();
             hs["AGVID"] = AGVID;
             dbOperator.SetDatas("DeleteCarRemeberRoute", hs);
             scope.Complete();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #23
0
 /// <summary>
 /// 加载系统参数
 /// </summary>
 /// <returns></returns>
 public static IDictionary <string, string> LoadSystem()
 {
     try
     {
         IDbOperator dbOperator              = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         DataTable   dtSysparameter          = dbOperator.LoadDatas("LoadSystem");
         IDictionary <string, string> Result = new Dictionary <string, string>();
         foreach (DataRow row in dtSysparameter.Rows)
         {
             Result[row["ParameterCode"].ToString()] = row["ParameterValue"].ToString();
         }
         return(Result);
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #24
0
 public static void HandTaskzb(string DispatchNo)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable hs = new Hashtable();
             hs["dispatchNo"] = DispatchNo;
             dbOperator.SetDatas("UpdateTaskForFinish", hs);
             scope.Complete();
         }
     }
     catch (Exception ex)
     { LogHelper.WriteErrorLog(ex); }
 }
Exemple #25
0
 public static void DelUnUseTask()
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   hs         = new Hashtable();
         using (TransactionScope scope = new TransactionScope())
         {
             hs["date"] = DateTime.Now.AddDays(-3).ToString("yyyyMMdd");
             dbOperator.SetDatas("DelUnUseTask", hs);
             scope.Complete();
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #26
0
 /// <summary>
 /// 更新储位状态为空
 /// </summary>
 public void UnLockStorage(CarMonitor car, IList <StorageInfo> StorageList)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         Hashtable   dic        = new Hashtable();
         dic["lockcar"]      = car.AgvID;
         dic["landmarkcode"] = car.CurrSite.ToString();
         StorageInfo ToStorage = null;
         if (!string.IsNullOrEmpty(car.ArmLand) && car.CurrSite.ToString() == car.ArmLand)
         {
             ToStorage = StorageList.Where(p => p.LankMarkCode == car.CurrSite.ToString()).FirstOrDefault();
         }
         if (ToStorage != null)
         {
             if (car.OperType == 1)
             {
                 if (car.PutType == 0)
                 {
                     ToStorage.StorageState = 1;
                     ToStorage.LockCar      = 0;
                     ToStorage.LockState    = 0;
                 }
                 else
                 {
                     ToStorage.StorageState = 2;
                     ToStorage.LockCar      = 0;
                     ToStorage.LockState    = 0;
                 }
             }
             else
             {
                 ToStorage.StorageState = 0;
                 ToStorage.LockCar      = 0;
                 ToStorage.LockState    = 0;
             }
             dic["StorageState"] = ToStorage.StorageState;
             dbOperator.SetDatas("ReleaseStore", dic);
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteErrorLog(ex);
     }
 }
Exemple #27
0
        private void btnTest_Click(object sender, EventArgs e)
        {
            try
            {
                this.label1.Focus();
                if (Valide())
                {
                    if (TestdataBaseInfo == null)
                    {
                        TestdataBaseInfo = new DataBaseInfo();
                    }
                    TestdataBaseInfo.DataBaseName = this.txtDBName.Text.Trim();
                    TestdataBaseInfo.DbSource     = this.txtIP.Text.Trim();
                    TestdataBaseInfo.Pwd          = this.txtPass.Text.Trim();
                    TestdataBaseInfo.Uid          = this.txtUser.Text.Trim();

                    IDbOperator dbTesthqOperator = CreateDbOperator.DbOperatorInstance(TestdataBaseInfo);
                    try
                    {
                        //测试数据库
                        if (dbTesthqOperator.ServerIsThrough())
                        {
                        }
                        else
                        {
                            MsgBox.ShowError("数据库地址不正确!");
                            return;
                        }
                        serverconfig = new ClientConfig()
                        {
                            ServerIP = txtServeIP.Text.Trim(), Port = System.Convert.ToInt32(txtServePort.Text.Trim()), TimeOut = 5 * 1000, ReceiveBufferSize = 128
                        };
                        if (!clientserver.TestConnect(serverconfig))
                        {
                            MsgBox.ShowWarn("连接上位机失败!"); return;
                        }
                        MsgBox.ShowWarn("测试成功!");
                    }
                    catch (Exception ex)
                    { MsgBox.ShowError(ex.Message); }
                }
            }
            catch (Exception ex)
            { MsgBox.ShowError(ex.Message); }
        }
Exemple #28
0
 public static void HandTaskDetail(int ExeAgvID, string LandCode, string DispatchNo, int TaskDetailID)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable hs = new Hashtable();
             hs["ExeAgvID"]     = ExeAgvID;
             hs["LandCode"]     = LandCode;
             hs["dispatchNo"]   = DispatchNo;
             hs["TaskDetailID"] = TaskDetailID;
             dbOperator.SetDatas("UpdateTaskDetailForFinish", hs);
             scope.Complete();
         }
     }
     catch (Exception ex)
     { LogHelper.WriteErrorLog(ex); }
 }
Exemple #29
0
 /// <summary>
 /// 加载agv的当前路线
 /// </summary>
 public static List <LandmarkInfo> LoadCarRoute(CarInfo Car)
 {
     try
     {
         IDbOperator         dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         List <LandmarkInfo> route      = new List <LandmarkInfo>();
         Hashtable           dic        = new Hashtable();
         dic["AGVID"] = Car.AgvID;
         DataTable dt = dbOperator.LoadDatas("QueryAGVRoute", dic);
         if (dt != null && dt.Rows.Count > 0)
         {
             string RouteLandCodes = dt.Rows[0]["RouteLandCodes"].ToString();
             if (string.IsNullOrEmpty(RouteLandCodes))
             {
                 return(route);
             }
             else
             {
                 string[] LandCodes = RouteLandCodes.Split(',');
                 foreach (string item in LandCodes)
                 {
                     LandmarkInfo Land = CoreData.AllLands.FirstOrDefault(p => p.LandmarkCode == item);
                     if (Land == null)
                     {
                         continue;
                     }
                     else
                     {
                         route.Add(ConnectConfigTool.CreateDeepCopy <LandmarkInfo>(Land));
                     }
                 }
             }
             return(route);
         }
         else
         {
             return(route);
         }
     }
     catch (Exception ex)
     { throw ex; }
 }
Exemple #30
0
 /// <summary>
 /// 放行逻辑
 /// </summary>
 public static OperateReturnInfo ReleaseCar(string ExcuteTaksNo, string LandCode)
 {
     try
     {
         IDbOperator dbOperator = CreateDbOperator.DbOperatorInstance(ConnectConfigTool.DBase);
         using (TransactionScope scope = new TransactionScope())
         {
             Hashtable hs = new Hashtable();
             hs["TaskNo"]   = ExcuteTaksNo;
             hs["LandCode"] = LandCode;
             dbOperator.SetDatas("ReleaseCar", hs);
             scope.Complete();
         }
         return(new OperateReturnInfo(OperateCodeEnum.Success));
     }
     catch (Exception ex)
     {
         return(new OperateReturnInfo(OperateCodeEnum.Failed, ex.Message));
     }
 }