Пример #1
0
 /// <summary>
 /// 加载数据表格
 /// </summary>
 private void LoadDataGrid()
 {
     DAL.ZSql sql2 = new DAL.ZSql();
     sql2.Open("select * from T_Speed where CmdNum > 0");
     dataGrid1.ItemsSource = sql2.m_table.DefaultView;
     sql2.Close();
 }
Пример #2
0
 /// <summary>
 /// 加载表格设置
 /// </summary>
 private void LoadDataGrid()
 {
     DAL.ZSql sql2 = new DAL.ZSql();
     sql2.Open("select * from T_Custom where CustomType=" + iCustomType.ToString() + " and CmdNum>0 order by CmdNum");
     dataGrid1.ItemsSource = sql2.m_table.DefaultView;
     sql2.Close();
 }
Пример #3
0
 /// <summary>
 /// 加载表格数据
 /// </summary>
 private void LoadDataGrid()
 {
     DAL.ZSql sql2 = new DAL.ZSql();
     sql2.Open("select * from T_UserInfo");
     dataGrid1.ItemsSource = sql2.m_table.DefaultView;
     sql2.Close();
 }
Пример #4
0
 private void LoadDataGrid()
 {
     //表格初始化
     DAL.ZSql sqlGrid = new DAL.ZSql();
     sqlGrid.Open("SELECT * FROM T_CallSetting ORDER BY StationNum,MaterialNum");
     dataGrid1.ItemsSource = sqlGrid.m_table.DefaultView;
     sqlGrid.Close();
     //工位号下列框初始化
     DAL.ZSql sqlSN = new DAL.ZSql();
     sqlSN.Open("SELECT DISTINCT StationNum FROM T_CallSetting ORDER BY StationNum");
     cbStation.ItemsSource       = sqlSN.m_table.DefaultView;
     cbStation.DisplayMemberPath = "StationNum";
     cbStation.SelectedValuePath = "StationNum";
     cbStation.SelectedIndex     = 0;
     sqlSN.Close();
     //物料编号下列框初始化
     DAL.ZSql sqlMN = new DAL.ZSql();
     sqlMN.Open("SELECT DISTINCT MaterialNum FROM T_CallSetting ORDER BY MaterialNum");
     cbMaterialNum.ItemsSource       = sqlMN.m_table.DefaultView;
     cbMaterialNum.DisplayMemberPath = "MaterialNum";
     cbMaterialNum.SelectedValuePath = "MaterialNum";
     cbMaterialNum.SelectedIndex     = 0;
     sqlMN.Close();
     //线路加载初始化
     DAL.ZSql sqlRoute = new DAL.ZSql();
     sqlRoute.Open("SELECT DISTINCT LineNum FROM T_Line ORDER BY LineNum");
     cbRoute.ItemsSource       = sqlRoute.m_table.DefaultView;
     cbRoute.DisplayMemberPath = "LineNum";
     cbRoute.SelectedValuePath = "LineNum";
     cbRoute.SelectedIndex     = 0;
     sqlRoute.Close();
 }
Пример #5
0
 /// <summary>
 /// 加载表格设置
 /// </summary>
 private void LoadDataGrid()
 {
     DAL.ZSql sql2 = new DAL.ZSql();
     sql2.Open("select * from T_Custom where CustomType=" + iCustomType.ToString() + " and CmdNum>0 order by CmdNum");
     dataGrid1.ItemsSource = sql2.m_table.DefaultView;
     sql2.Close();
 }
Пример #6
0
        protected bool LineInit(int docknum)
        {
            bool flag = false;

            DAL.ZSql lineSql = new DAL.ZSql();
            if (docknum > 0)
            {
                lineSql.Open("Select RouteNum from T_ChargeSetting where ChargeNum=" + docknum + "Order by RouteNum");//升序
                if (lineSql.rowcount > 0)
                {
                    dockCount = lineSql.rowcount;   //确定停车位总数
                    dockLine  = new int[dockCount]; //确定停靠区每个车位的线路
                    for (int i = 0; i < lineSql.rowcount; i++)
                    {
                        if (!string.IsNullOrEmpty(lineSql.Rows[i]["RouteNum"].ToString()))
                        {
                            dockLine[i] = Convert.ToInt32(lineSql.Rows[i]["RouteNum"]);
                        }
                    }
                    flag = true;
                }
                lineSql.Close();
                lineSql.Dispose();
            }
            return(flag);
        }
Пример #7
0
 /// <summary>
 /// 加载数据表格
 /// </summary>
 private void LoadDataGrid()
 {
     DAL.ZSql sql2 = new DAL.ZSql();
     sql2.Open("select * from T_Speed where CmdNum > 0");
     dataGrid1.ItemsSource = sql2.m_table.DefaultView;
     sql2.Close();
 }
Пример #8
0
 /// <summary>
 /// 加载表格数据
 /// </summary>
 private void LoadDataGrid()
 {
     DAL.ZSql sql2 = new DAL.ZSql();
     sql2.Open("select * from T_UserInfo");
     dataGrid1.ItemsSource = sql2.m_table.DefaultView;
     sql2.Close();
 }
Пример #9
0
 /// <summary>
 /// 交通管制区号绑定
 /// </summary>
 private void BindLineCombox()
 {
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT TrafficNum from T_Traffic order by TrafficNum");
     cbTraffic.ItemsSource       = sql1.m_table.DefaultView;
     cbTraffic.DisplayMemberPath = "TrafficNum";
     cbTraffic.SelectedValuePath = "TrafficNum";
     sql1.Close();
 }
Пример #10
0
 //修改日期:2013-12-1
 /// <summary>
 /// 生产区下拉框绑定
 /// </summary>
 private void BindWorkLineCombox()
 {
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("Select DISTINCT WorkLine from T_Mark");
     cbWorkLine.ItemsSource       = sql1.m_table.DefaultView;
     cbWorkLine.DisplayMemberPath = "WorkLine";
     cbWorkLine.SelectedValuePath = "WorkLine";
     sql1.Close();
 }
Пример #11
0
 /// <summary>
 /// 停靠区编号绑定
 /// </summary>
 private void InitDockNum()
 {
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT DockNum from T_DockArea order by DockNum");
     cbDockNum.ItemsSource       = sql1.m_table.DefaultView;
     cbDockNum.DisplayMemberPath = "DockNum";
     cbDockNum.SelectedValuePath = "DockNum";
     sql1.Close();
 }
Пример #12
0
 /// <summary>
 /// 全部删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDeleteAll_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show("确认要删除此全部记录?", "警告", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
     {
         DAL.ZSql sql1 = new DAL.ZSql();
         sql1.Open("delete from T_Ex where CarID=" + carid.ToString() + " and ExTimer like '" + strdate + "%'");
         sql1.Close();
         LoadDataGrid(carid, strdate);
     }
 }
Пример #13
0
 /// <summary>
 /// 加载数据表格
 /// </summary>
 /// <param name="paracarid"></param>
 /// <param name="strdate"></param>
 private void LoadDataGrid(int paracarid, string strdate)
 {
     if (paracarid > 0)
     {
         DAL.ZSql sql2 = new DAL.ZSql();
         sql2.Open("select * from T_Ex where CarID=" + paracarid.ToString() + " and ExTimer like '" + strdate + "%' order by ExTimer");
         dataGrid1.ItemsSource = sql2.m_table.DefaultView;
         sql2.Close();
     }
 }
Пример #14
0
 /// <summary>
 /// 路线下拉列表绑定
 /// </summary>
 private void BindRouteComboBox()
 {
     //线路加载初始化
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT LineNum from T_Line order by LineNum");
     cbRouteNum.ItemsSource       = sql1.m_table.DefaultView;
     cbRouteNum.DisplayMemberPath = "LineNum";
     cbRouteNum.SelectedValuePath = "LineNum";
     sql1.Close();
 }
Пример #15
0
 /// <summary>
 /// 全部删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDeleteAll_Click(object sender, RoutedEventArgs e)
 {
     if (MessageBox.Show("确认要删除此全部记录?", "警告", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
     {
         DAL.ZSql sql1 = new DAL.ZSql();
         sql1.Open("delete from T_Ex where CarID=" + carid.ToString() + " and ExTimer like '" + strdate + "%'");
         sql1.Close();
         LoadDataGrid(carid, strdate);
     }
 }
Пример #16
0
 /// <summary>
 /// 路线下拉列表绑定
 /// </summary>
 private void BindRouteComboBox()
 {
     //线路加载初始化
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT LineNum from T_Line order by LineNum");
     cbRouteNum.ItemsSource = sql1.m_table.DefaultView;
     cbRouteNum.DisplayMemberPath = "LineNum";
     cbRouteNum.SelectedValuePath = "LineNum";
     sql1.Close();
 }
Пример #17
0
 /// <summary>
 /// 停车位下拉列表绑定
 /// </summary>
 private void BindParkingNumComboBox(int docknum)
 {
     //停车位编号加载初始化
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT ParkingNum from T_DockSetting Where DockNum=@docknum order by ParkingNum",
               new SqlParameter[] { new SqlParameter("@docknum", docknum) });
     cbParkingNum.ItemsSource       = sql1.m_table.DefaultView;
     cbParkingNum.DisplayMemberPath = "ParkingNum";
     cbParkingNum.SelectedValuePath = "ParkingNum";
     sql1.Close();
 }
Пример #18
0
 /// <summary>
 /// 停车位下拉列表绑定
 /// </summary>
 private void BindParkingNumComboBox(int docknum)
 {
     //停车位编号加载初始化
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT ParkingNum from T_DockSetting Where DockNum=@docknum order by ParkingNum",
         new SqlParameter[] { new SqlParameter("@docknum", docknum) });
     cbParkingNum.ItemsSource = sql1.m_table.DefaultView;
     cbParkingNum.DisplayMemberPath = "ParkingNum";
     cbParkingNum.SelectedValuePath = "ParkingNum";
     sql1.Close();
 }
Пример #19
0
 /// <summary>
 /// 下拉框绑定
 /// </summary>
 private void BindCombox()
 {
     //绑定AGV小车编号
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT CarID from T_Ex order by CarID");
     cbCarid.ItemsSource = sql1.m_table.DefaultView;
     cbCarid.DisplayMemberPath = "CarID";
     cbCarid.SelectedValuePath = "CarID";
     sql1.Close();
     //日期绑定到今天的
     cbYear.Text = DateTime.Now.Year.ToString();        //获取年份
 }
Пример #20
0
 /// <summary>
 /// 下拉框绑定
 /// </summary>
 private void BindCombox()
 {
     //绑定AGV小车编号
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT CarID from T_Ex order by CarID");
     cbCarid.ItemsSource       = sql1.m_table.DefaultView;
     cbCarid.DisplayMemberPath = "CarID";
     cbCarid.SelectedValuePath = "CarID";
     sql1.Close();
     //日期绑定到今天的
     cbYear.Text = DateTime.Now.Year.ToString();        //获取年份
 }
Пример #21
0
 /// <summary>
 /// 生产区下拉列表绑定
 /// </summary>
 private void BindWorkLineComboBox()
 {
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("Select DISTINCT WorkLine from T_Mark");
     cbSWorkLine.ItemsSource = sql1.m_table.DefaultView;
     cbSWorkLine.DisplayMemberPath = "WorkLine";
     cbSWorkLine.SelectedValuePath = "WorkLine";
     cbEWorkLine.ItemsSource = sql1.m_table.DefaultView;
     cbEWorkLine.DisplayMemberPath = "WorkLine";
     cbEWorkLine.SelectedValuePath = "WorkLine";
     sql1.Close();
 }
Пример #22
0
        /// <summary>
        /// 获取充电路线
        /// </summary>
        /// <param name="oldline">充电前的路线</param>
        /// <returns>充电路线</returns>
        public byte GetChargeLine(byte oldline)
        {
            byte retLine = 0;

            if (oldline > 0)
            {
                DAL.ZSql chargelineSql = new DAL.ZSql();
                chargelineSql.Open("Select ChargeLine from T_LineSet Where LineNum = " + oldline.ToString());
                if (chargelineSql.rowcount > 0)
                {
                    retLine = Convert.ToByte(chargelineSql.Rows[0]["ChargeLine"]);
                }
            }
            return(retLine);
        }
Пример #23
0
 private void BindComboBox()
 {
     //修改日期:2013-12-1        
     for (int i = 0; i < AGVNUM_MAX; i++)
     {
         tbCarID.Items.Add((i+1).ToString());
     }
     //修改日期:2013-12-1
     DAL.ZSql sql2 = new DAL.ZSql();
     sql2.Open("Select DISTINCT WorkLine from T_Mark");
     tbWorkline.ItemsSource = sql2.m_table.DefaultView;
     tbWorkline.DisplayMemberPath = "WorkLine";
     tbWorkline.SelectedValuePath = "WorkLine";
     sql2.Close();
 }
Пример #24
0
 private void BindComboBox()
 {
     //修改日期:2013-12-1
     for (int i = 0; i < AGVNUM_MAX; i++)
     {
         tbCarID.Items.Add((i + 1).ToString());
     }
     //修改日期:2013-12-1
     DAL.ZSql sql2 = new DAL.ZSql();
     sql2.Open("Select DISTINCT WorkLine from T_Mark");
     tbWorkline.ItemsSource       = sql2.m_table.DefaultView;
     tbWorkline.DisplayMemberPath = "WorkLine";
     tbWorkline.SelectedValuePath = "WorkLine";
     sql2.Close();
 }
Пример #25
0
 /// <summary>
 /// 加载表格
 /// </summary>
 /// <param name="paradocknum">停靠区编号</param>
 private void LoadDataGrid(int paradocknum)
 {
     if (paradocknum > 0)
     {
         DAL.ZSql sql1 = new DAL.ZSql();
         sql1.Open("select * from T_DockSetting where DockNum=" + Convert.ToString(paradocknum) + " order by ParkingNum");
         dataGrid1.ItemsSource = sql1.m_table.DefaultView;
         sql1.Close();
         DAL.ZSql sql2 = new DAL.ZSql();
         sql2.Open("select * from T_DockArea where DockNum=" + Convert.ToString(paradocknum));
         dataGrid2.ItemsSource = sql2.m_table.DefaultView;
         sql2.Close();
         docknum = paradocknum;
     }
     else
     {
         dataGrid1.ItemsSource = null;
         dataGrid2.ItemsSource = null;
     }
 }
Пример #26
0
        private void Loginbutton_Click(object sender, RoutedEventArgs e)
        {
            string UserName = this.UserNametextBox.Text.ToLower().Trim();
            string PassWord = this.passwordBox.Password.ToLower().Trim();

            DAL.ZSql sql = new DAL.ZSql();
            int      i   = sql.Open("select * from T_UserInfo where UserName=@username and Pwd=@password", new SqlParameter[] { new SqlParameter("username", UserName), new SqlParameter("password", PassWord) });

            if (i < 0)
            {
                sql.Close();
                return;
            }
            if (sql.Rows.Count > 0)
            {
                if (sql.Rows[0]["IsManager"].ToString() == "True")
                {
                    GlobalPara.IsManager = true;
                }
                else
                {
                    GlobalPara.IsManager = false;
                }
                GlobalPara.strName = UserName;
                GlobalPara.userid  = sql.Rows[0]["ID"].ToString();
                sql.Close();
                MainWindow mn = new MainWindow();
                mn.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("用户名或密码错误,请检查", "警告");
                this.UserNametextBox.Clear();
                this.passwordBox.Clear();
                this.UserNametextBox.Focus();
            }
            sql.Close();
        }
Пример #27
0
        /// <summary>
        /// 加载地标
        /// </summary>
        private void LoadAllMark()
        {
            DAL.ZSql sql1 = new DAL.ZSql();
            sql1.Open("select * from T_Mark Order by WorkLine,Mark");
            //加载地图中地标
            canvas.Children.Clear();
            double x = 0, y = 0;

            for (int i = 0; i < sql1.Rows.Count; i++)
            {
                x = Convert.ToDouble(sql1.Rows[i]["XPos"]);
                y = Convert.ToDouble(sql1.Rows[i]["YPos"]);
                Ellipse markellipse = new Ellipse();
                markellipse.Height  = MarkDiameter;
                markellipse.Width   = MarkDiameter;
                markellipse.ToolTip = sql1.Rows[i]["ID"].ToString() + "\r\nWorkLine:" + sql1.Rows[i]["WorkLine"].ToString() + "  Mark:" + sql1.Rows[i]["Mark"];
                Canvas.SetLeft(markellipse, x - MarkDiameter / 2);
                Canvas.SetTop(markellipse, y - MarkDiameter / 2);
                //设置虚拟点颜色
                if (Convert.ToBoolean(sql1.Rows[i]["VirtualMark"]))
                {
                    markellipse.Fill = IsVirtualMark;
                }
                else
                {
                    markellipse.Fill = NotVirtualMark;
                    Label marklable = new Label();
                    marklable.FontSize   = 10;
                    marklable.Foreground = Brushes.Black;
                    marklable.Content    = sql1.Rows[i]["ID"].ToString();
                    Canvas.SetLeft(marklable, x - 14);
                    Canvas.SetTop(marklable, y - 20);
                    canvas.Children.Add(marklable);
                }
                canvas.Children.Add(markellipse);
            }
            sql1.Close();
        }
Пример #28
0
        //private delegate void AddCallMemberEvent(AGV_CALLMember si);
        //private delegate void DeleteCallMemberEvent(AGV_CALLMember si);

        public bool Add(int stationnum, int materialnum)
        {
            bool flag = false;

            if (stationnum > 0 && materialnum > 0)
            {
                DAL.ZSql callSql = new DAL.ZSql();
                bool     bFind   = memberData.Any <AGV_CALLMember>(p => p.iStationNum == stationnum && p.iMaterialNum == materialnum);
                if (!bFind)
                {
                    AGV_CALLMember DisMember = new AGV_CALLMember();
                    DisMember.iNO          = memberData.Count + 1;
                    DisMember.dtTime       = new DateTime();
                    DisMember.iStationNum  = stationnum;
                    DisMember.iMaterialNum = materialnum;
                    callSql.Open("Select * from T_CallSetting where StationNum=" + stationnum.ToString() + " and MaterialNum=" + materialnum);
                    if (callSql.rowcount > 0)
                    {
                        DisMember.sMaterialName = callSql.Rows[0]["MaterialName"].ToString();
                        DisMember.iLineNum      = Convert.ToInt16(callSql.Rows[0]["LineNum"]);
                        lineNum.Add(DisMember.iLineNum);
                        flag = true;
                    }
                    callSql.Close();

                    /*********************************
                     * http://blog.csdn.net/luminji/article/details/5353644
                     * 典型应用场景:WPF页面程序中,ListView的ItemsSource是一个ObservableCollection<StudentInfo>;
                     * 操作:另起一个线程,为ListView动态更新数据,也就是给ObservableCollection<StudentInfo>添加记录。
                     * 这类操作,就是跨线程访问线程安全的数据,如果不使用Dispatcher,就会导致出错“该类型的CollectionView
                     * 不支持从调度程序线程以外的线程对其SourceCollection”。
                     **********************************/
                    //Dispatcher.Invoke(new AddCallMemberEvent(this.AddCallMember), DisMember);
                    AddCallMember(DisMember);
                }
            }
            return(flag);
        }
Пример #29
0
        protected bool DockInit(int docknum)
        {
            bool flag = false;

            DAL.ZSql dockSql = new DAL.ZSql();
            if (docknum > 0)
            {
                dockSql.Open("Select * from T_DockArea where DockNum=" + docknum.ToString());
                if (dockSql.rowcount > 0)
                {
                    dockNum            = docknum;
                    dockName           = dockSql.Rows[0]["DockName"].ToString();
                    dockStartStop.Num  = Convert.ToInt32(dockSql.Rows[0]["DockSSNum"]);
                    dockEndStop.Num    = Convert.ToInt32(dockSql.Rows[0]["DockESNum"]);
                    dockStartStop.Line = Convert.ToInt32(dockSql.Rows[0]["DockSSLine"]);
                    dockEndStop.Line   = Convert.ToInt32(dockSql.Rows[0]["DockESLine"]);
                    flag = true;
                }
                dockSql.Close();
                dockSql.Dispose();
            }
            return(flag);
        }
Пример #30
0
 private void Loginbutton_Click(object sender, RoutedEventArgs e)
 {
     string UserName = this.UserNametextBox.Text.ToLower().Trim();
     string PassWord = this.passwordBox.Password.ToLower().Trim();
     DAL.ZSql sql = new DAL.ZSql();
     int i = sql.Open("select * from T_UserInfo where UserName=@username and Pwd=@password", new SqlParameter[] { new SqlParameter("username", UserName), new SqlParameter("password", PassWord) });
     if (i < 0)
     {
         sql.Close();
         return;
     }
     if (sql.Rows.Count > 0)
     {
         if (sql.Rows[0]["IsManager"].ToString() == "True")
         {
             GlobalPara.IsManager = true;
         }
         else
         {
             GlobalPara.IsManager = false;
         }
         GlobalPara.strName = UserName;
         GlobalPara.userid = sql.Rows[0]["ID"].ToString();
         sql.Close();
         MainWindow mn = new MainWindow();
         mn.Show();
         this.Close();
     }
     else
     {
         MessageBox.Show("用户名或密码错误,请检查", "警告");
         this.UserNametextBox.Clear();
         this.passwordBox.Clear();
         this.UserNametextBox.Focus();
     }
     sql.Close();
 }
Пример #31
0
        //private delegate void AddCallMemberEvent(AGV_CALLMember si);
        //private delegate void DeleteCallMemberEvent(AGV_CALLMember si);

        public bool Add(int stationnum, int materialnum)
        {
            bool flag = false;
            if (stationnum > 0 && materialnum > 0)
            {
                DAL.ZSql callSql = new DAL.ZSql();
                bool bFind = memberData.Any<AGV_CALLMember>(p => p.iStationNum == stationnum && p.iMaterialNum == materialnum);
                if (!bFind)
                {
                    AGV_CALLMember DisMember = new AGV_CALLMember();
                    DisMember.iNO = memberData.Count + 1;
                    DisMember.dtTime = new DateTime();
                    DisMember.iStationNum = stationnum;
                    DisMember.iMaterialNum = materialnum;
                    callSql.Open("Select * from T_CallSetting where StationNum=" + stationnum.ToString() + " and MaterialNum=" + materialnum);
                    if (callSql.rowcount > 0)
                    {
                        DisMember.sMaterialName = callSql.Rows[0]["MaterialName"].ToString();
                        DisMember.iLineNum = Convert.ToInt16(callSql.Rows[0]["LineNum"]);
                        lineNum.Add(DisMember.iLineNum);
                        flag = true;
                    }
                    callSql.Close();
                    /*********************************
                     http://blog.csdn.net/luminji/article/details/5353644
                    典型应用场景:WPF页面程序中,ListView的ItemsSource是一个ObservableCollection<StudentInfo>;
                    操作:另起一个线程,为ListView动态更新数据,也就是给ObservableCollection<StudentInfo>添加记录。
                    这类操作,就是跨线程访问线程安全的数据,如果不使用Dispatcher,就会导致出错“该类型的CollectionView
                    不支持从调度程序线程以外的线程对其SourceCollection”。
                    **********************************/
                    //Dispatcher.Invoke(new AddCallMemberEvent(this.AddCallMember), DisMember);
                    AddCallMember(DisMember);
                }
            }
            return flag;
        }
Пример #32
0
        /// <summary>
        /// 加载数据表格
        /// </summary>
        /// <param name="paratrafficnum">交通管制编号</param>
        private void LoadDataGrid(string paratrafficnum)
        {
            DAL.ZSql sql2 = new DAL.ZSql();
            sql2.Open("select T_Traffic.ID,T_Traffic.TrafficNum,T_Traffic.MarkID,T_Mark.XPos,T_Mark.YPos,T_Mark.ID,T_Mark.WorkLine,T_Mark.Mark from T_Traffic left join T_Mark on T_Mark.ID=T_Traffic.MarkID where TrafficNum=" + paratrafficnum);
            canvas.Children.Clear();
            LoadAllMark();
            double x, y;

            for (int i = 0; i < sql2.Rows.Count; i++)
            {
                if (!string.IsNullOrEmpty(sql2.Rows[i]["MarkID"].ToString()) && !string.IsNullOrEmpty(sql2.Rows[i]["XPos"].ToString()) && !string.IsNullOrEmpty(sql2.Rows[i]["YPos"].ToString()))
                {
                    x = Convert.ToDouble(sql2.Rows[i]["XPos"]);
                    y = Convert.ToDouble(sql2.Rows[i]["YPos"]);
                    Ellipse markellipse = new Ellipse();
                    markellipse.Height  = MarkDiameter + 2;
                    markellipse.Width   = MarkDiameter + 2;
                    markellipse.Fill    = TrafficColor;
                    markellipse.ToolTip = "MarkID:" + sql2.Rows[i]["MarkID"].ToString() + "\r\nWorkLine:" + sql2.Rows[i]["WorkLine"].ToString() + "  Mark:" + sql2.Rows[i]["Mark"];
                    Canvas.SetLeft(markellipse, x - MarkDiameter / 2);
                    Canvas.SetTop(markellipse, y - MarkDiameter / 2);

                    Label marklable = new Label();
                    marklable.FontSize   = 10;
                    marklable.Foreground = TrafficColor;
                    marklable.Content    = sql2.Rows[i]["MarkID"].ToString();
                    Canvas.SetLeft(marklable, x - 14);
                    Canvas.SetTop(marklable, y - 20);

                    canvas.Children.Add(markellipse);
                    canvas.Children.Add(marklable);
                }
            }
            dataGrid1.ItemsSource = sql2.m_table.DefaultView;
            sql2.Close();
        }
Пример #33
0
 protected bool DockInit(int docknum)
 {
     bool flag = false;
     DAL.ZSql dockSql = new DAL.ZSql();
     if (docknum > 0)
     {
         dockSql.Open("Select * from T_DockArea where DockNum=" + docknum.ToString());
         if (dockSql.rowcount > 0)
         {
             dockNum = docknum;
             dockName = dockSql.Rows[0]["DockName"].ToString();
             dockStartStop.Num = Convert.ToInt32(dockSql.Rows[0]["DockSSNum"]);
             dockEndStop.Num = Convert.ToInt32(dockSql.Rows[0]["DockESNum"]);
             dockStartStop.Line = Convert.ToInt32(dockSql.Rows[0]["DockSSLine"]);
             dockEndStop.Line = Convert.ToInt32(dockSql.Rows[0]["DockESLine"]);
             flag = true;
         }
         dockSql.Close();
         dockSql.Dispose();
     }
     return flag;
 }
Пример #34
0
 /// <summary>
 /// 交通管制区号绑定
 /// </summary>
 private void BindLineCombox()
 {
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT TrafficNum from T_Traffic order by TrafficNum");
     cbTraffic.ItemsSource = sql1.m_table.DefaultView;
     cbTraffic.DisplayMemberPath = "TrafficNum";
     cbTraffic.SelectedValuePath = "TrafficNum";
     sql1.Close();
 }
Пример #35
0
 protected bool LineInit(int docknum)
 {
     bool flag = false;
     DAL.ZSql lineSql = new DAL.ZSql();
     if (docknum > 0)
     {
         lineSql.Open("Select RouteNum from T_DockSetting where DockNum=" + docknum + "Order by RouteNum");//升序
         if (lineSql.rowcount > 0)
         {
             dockCount = lineSql.rowcount;//确定停车位总数
             dockLine = new int[dockCount];//确定停靠区每个车位的线路
             outDockLine = new int[dockCount];
             for (int i = 0; i < lineSql.rowcount; i++)
             {
                 if (!string.IsNullOrEmpty(lineSql.Rows[i]["RouteNum"].ToString()))
                 {
                     dockLine[i] = Convert.ToInt32(lineSql.Rows[i]["RouteNum"]);
                 }
             }
             flag = true;
         }
         lineSql.Close();
         lineSql.Dispose();
     }
     return flag;
 }
Пример #36
0
 /// <summary>
 /// 加载地标
 /// </summary>
 private void LoadAllMark()
 {
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select * from T_Mark Order by WorkLine,Mark");
     //加载地图中地标
     canvas.Children.Clear();
     double x = 0, y = 0;
     for (int i = 0; i < sql1.Rows.Count; i++)
     {
         x = Convert.ToDouble(sql1.Rows[i]["XPos"]);
         y = Convert.ToDouble(sql1.Rows[i]["YPos"]);
         Ellipse markellipse = new Ellipse();
         markellipse.Height = MarkDiameter;
         markellipse.Width = MarkDiameter;
         markellipse.ToolTip = sql1.Rows[i]["ID"].ToString() + "\r\nWorkLine:" + sql1.Rows[i]["WorkLine"].ToString() + "  Mark:" + sql1.Rows[i]["Mark"];
         Canvas.SetLeft(markellipse, x - MarkDiameter/2);
         Canvas.SetTop(markellipse, y - MarkDiameter/2);
         //设置虚拟点颜色
         if (Convert.ToBoolean(sql1.Rows[i]["VirtualMark"]))
         {
             markellipse.Fill = IsVirtualMark;
         }
         else
         {
             markellipse.Fill = NotVirtualMark;
             Label marklable = new Label();
             marklable.FontSize = 10;
             marklable.Foreground = Brushes.Black;
             marklable.Content = sql1.Rows[i]["ID"].ToString();
             Canvas.SetLeft(marklable, x - 14);
             Canvas.SetTop(marklable, y - 20);
             canvas.Children.Add(marklable);
         }
         canvas.Children.Add(markellipse);
     }
      sql1.Close();
 }
Пример #37
0
        /// <summary>
        /// 加载数据表格
        /// </summary>
        /// <param name="paratrafficnum">交通管制编号</param>
        private void LoadDataGrid(string paratrafficnum)
        {
            DAL.ZSql sql2 = new DAL.ZSql();
            sql2.Open("select T_Traffic.ID,T_Traffic.TrafficNum,T_Traffic.MarkID,T_Mark.XPos,T_Mark.YPos,T_Mark.ID,T_Mark.WorkLine,T_Mark.Mark from T_Traffic left join T_Mark on T_Mark.ID=T_Traffic.MarkID where TrafficNum=" + paratrafficnum);
            canvas.Children.Clear();
            LoadAllMark();
            double x, y;
            for (int i = 0; i < sql2.Rows.Count; i++)
            {
                if (!string.IsNullOrEmpty(sql2.Rows[i]["MarkID"].ToString()) && !string.IsNullOrEmpty(sql2.Rows[i]["XPos"].ToString()) && !string.IsNullOrEmpty(sql2.Rows[i]["YPos"].ToString()))
                {
                    x = Convert.ToDouble(sql2.Rows[i]["XPos"]);
                    y = Convert.ToDouble(sql2.Rows[i]["YPos"]);
                    Ellipse markellipse = new Ellipse();
                    markellipse.Height = MarkDiameter + 2;
                    markellipse.Width = MarkDiameter + 2;
                    markellipse.Fill = TrafficColor;
                    markellipse.ToolTip = "MarkID:" + sql2.Rows[i]["MarkID"].ToString() + "\r\nWorkLine:" + sql2.Rows[i]["WorkLine"].ToString() + "  Mark:" + sql2.Rows[i]["Mark"];
                    Canvas.SetLeft(markellipse, x - MarkDiameter/2);
                    Canvas.SetTop(markellipse, y - MarkDiameter/2);

                    Label marklable = new Label();
                    marklable.FontSize = 10;
                    marklable.Foreground = TrafficColor;
                    marklable.Content = sql2.Rows[i]["MarkID"].ToString();
                    Canvas.SetLeft(marklable, x - 14);
                    Canvas.SetTop(marklable, y - 20);

                    canvas.Children.Add(markellipse);
                    canvas.Children.Add(marklable);
                }
            }
            dataGrid1.ItemsSource = sql2.m_table.DefaultView;
            sql2.Close();
        }
Пример #38
0
 /// <summary>
 /// 停靠区编号绑定
 /// </summary>
 private void InitDockNum()
 {
     DAL.ZSql sql1 = new DAL.ZSql();
     sql1.Open("select DISTINCT DockNum from T_DockArea order by DockNum");
     cbDockNum.ItemsSource = sql1.m_table.DefaultView;
     cbDockNum.DisplayMemberPath = "DockNum";
     cbDockNum.SelectedValuePath = "DockNum";
     sql1.Close();
 }
Пример #39
0
 /// <summary>
 /// 获取充电路线
 /// </summary>
 /// <param name="oldline">充电前的路线</param>
 /// <returns>充电路线</returns>
 public byte GetChargeLine(byte oldline)
 {
     byte retLine = 0;
     if (oldline > 0)
     {
         DAL.ZSql chargelineSql = new DAL.ZSql();
         chargelineSql.Open("Select ChargeLine from T_LineSet Where LineNum = " + oldline.ToString());
         if (chargelineSql.rowcount > 0)
         {
             retLine = Convert.ToByte(chargelineSql.Rows[0]["ChargeLine"]);
         }
     }
     return retLine;
 }
Пример #40
0
 private void LoadDataGrid()
 {
     //表格初始化
     DAL.ZSql sqlGrid = new DAL.ZSql();
     sqlGrid.Open("SELECT * FROM T_CallSetting ORDER BY StationNum,MaterialNum");
     dataGrid1.ItemsSource = sqlGrid.m_table.DefaultView;
     sqlGrid.Close();
     //工位号下列框初始化
     DAL.ZSql sqlSN = new DAL.ZSql();
     sqlSN.Open("SELECT DISTINCT StationNum FROM T_CallSetting ORDER BY StationNum");
     cbStation.ItemsSource = sqlSN.m_table.DefaultView;
     cbStation.DisplayMemberPath = "StationNum";
     cbStation.SelectedValuePath = "StationNum";
     cbStation.SelectedIndex = 0;
     sqlSN.Close();
     //物料编号下列框初始化
     DAL.ZSql sqlMN = new DAL.ZSql();
     sqlMN.Open("SELECT DISTINCT MaterialNum FROM T_CallSetting ORDER BY MaterialNum");
     cbMaterialNum.ItemsSource = sqlMN.m_table.DefaultView;
     cbMaterialNum.DisplayMemberPath = "MaterialNum";
     cbMaterialNum.SelectedValuePath = "MaterialNum";
     cbMaterialNum.SelectedIndex = 0;
     sqlMN.Close();
     //线路加载初始化
     DAL.ZSql sqlRoute = new DAL.ZSql();
     sqlRoute.Open("SELECT DISTINCT LineNum FROM T_Line ORDER BY LineNum");
     cbRoute.ItemsSource = sqlRoute.m_table.DefaultView;
     cbRoute.DisplayMemberPath = "LineNum";
     cbRoute.SelectedValuePath = "LineNum";
     cbRoute.SelectedIndex = 0;
     sqlRoute.Close();
 }
Пример #41
0
 /// <summary>
 /// 加载数据表格
 /// </summary>
 /// <param name="paracarid"></param>
 /// <param name="strdate"></param>
 private void LoadDataGrid(int paracarid, string strdate)
 {
     if (paracarid > 0)
     {
         DAL.ZSql sql2 = new DAL.ZSql();
         sql2.Open("select * from T_Ex where CarID=" + paracarid.ToString() + " and ExTimer like '" + strdate + "%' order by ExTimer");
         dataGrid1.ItemsSource = sql2.m_table.DefaultView;
         sql2.Close();
     }
 }
Пример #42
0
 /// <summary>
 /// 加载表格
 /// </summary>
 /// <param name="paradocknum">停靠区编号</param>
 private void LoadDataGrid(int paradocknum)
 {
     if (paradocknum > 0)
     {
         DAL.ZSql sql1 = new DAL.ZSql();
         sql1.Open("select * from T_DockSetting where DockNum=" + Convert.ToString(paradocknum) + " order by ParkingNum");
         dataGrid1.ItemsSource = sql1.m_table.DefaultView;
         sql1.Close();
         DAL.ZSql sql2 = new DAL.ZSql();
         sql2.Open("select * from T_DockArea where DockNum=" + Convert.ToString(paradocknum));
         dataGrid2.ItemsSource = sql2.m_table.DefaultView;
         sql2.Close();
         docknum = paradocknum;
     }
     else
     {
         dataGrid1.ItemsSource = null; 
         dataGrid2.ItemsSource = null;
     }
 }