Пример #1
0
        private void aboutIssueSystemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            About ab = new About();

            Beautiful.AnimateWindow(ab.Handle, 2000, Beautiful.AW_BLEND);
            ab.ShowDialog();
        }
Пример #2
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     Beautiful.AnimateWindow(this.Handle, 2000, Beautiful.AW_SLIDE | Beautiful.AW_HIDE | Beautiful.AW_BLEND);  //渐渐消失的界面
 }
Пример #3
0
 private void Main_FormClosed(object sender, FormClosedEventArgs e)
 {
     Beautiful.AnimateWindow(this.Handle, 2000, Beautiful.AW_SLIDE | Beautiful.AW_HIDE | Beautiful.AW_BLEND);
     Application.Exit();
     System.Environment.Exit(0);
 }
Пример #4
0
        public void Check()
        {
            DataSet dss;
            //         string cmd = @"select ID,CarPark,Station,Issue,Status,Priority,Solution,Reportby,AttendBy,AttendBy2,AttendBy3,DoneBy,ReportTime,ActivatedTime,AttendedTime,DoneTime,RespondTime,DownTime from [carpark].[dbo].[IssueTable] where ReportTime>DATEADD(DAY, -7, GETDATE()) OR Status='Open' ORDER BY ReportTime DESC;
            //                        select ID,CarPark,Status,CptaStaff,SpccStaff,RO,Details,ReportToCPTA,TimeGiven,TimeOnSite,ROAcualTimeOnSite,TimeCompletion from [carpark].[dbo].[IllegalParkingTable] where TimeGiven>DATEADD(DAY, -7, GETDATE())  OR Status='Open' order by TimeGiven DESC;
            //                        select id,carpark,station,bo,followby,starttime,endtime,issue,solution,item,qty,otstarttime,otendtime,submitby,posttime,ot from [carpark].[dbo].SRtable where starttime>DATEADD(DAY, -7, GETDATE()) ORDER BY starttime DESC;";
            string cmd = @"select ID,CreateTime,CarPark,Station,Issue,Status,Priority,Reportby,CreatedBy,AttendBy from [carpark].[dbo].[IssueTable] where ReportTime>DATEADD(DAY, -2, GETDATE()) OR Status!='Closed' ORDER BY ReportTime DESC;
                           select ID,CarPark,Status,CptaStaff,SpccStaff,RO,Details,ReportToCPTA,TimeGiven,TimeOnSite,ROAcualTimeOnSite,TimeCompletion from [carpark].[dbo].[IllegalParkingTable] where TimeGiven>DATEADD(DAY, -2, GETDATE())  OR Status!='Closed' order by TimeGiven DESC;
                           select id as ID,linkid as CaseID,posttime as SubmitTime,carpark as CarPark,station as Station,bo as Bo,followby as FollowUp,starttime as StartTime,endtime as EndTime,issue as Issue,solution as Solution,item as Item,qty as Qty,otstarttime as OverTimeStart,otendtime as OverTimeEnd,submitby as SubmitBy,ot as OverTimeMins from [carpark].[dbo].SRtable where starttime>DATEADD(DAY, -2, GETDATE()) ORDER BY starttime DESC;";

            try
            {
                dss = SqlHelper.ExecuteDataset(constr, CommandType.Text, cmd);    //execute
                Shua(dss);
            }
            catch (SqlException e)
            {
                LogClass.WirteLine("Error when getting dataset for 3 dvg : " + e.ToString());
            }



            string  Attendcmd = @"SELECT AttendBy,ID,Carpark,Station,Issue,AttendedTime FROM [dbo].[IssueTable] where AttendStatus='1' and ActivatedTime BETWEEN dateadd(SECOND,-20,getdate()) and GETDATE();
                                 SELECT submitby,linkid,carpark,station,issue,followby FROM [dbo].[SRtable] where  posttime BETWEEN dateadd(SECOND,-20,getdate()) and GETDATE();";
            DataSet ds        = null;

            try
            {
                ds = SqlHelper.ExecuteDataset(constr, CommandType.Text, Attendcmd);    //execute
            }
            catch (SqlException e)
            {
                LogClass.WirteLine("AttendCheck error : " + e.ToString());
            }

            try
            {
                //if (ds.Tables[0].Rows.Count >= 1)
                //{
                //    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                //    {
                //        string submitby = ds.Tables[0].Rows[i][0].ToString();
                //        string linkid = ds.Tables[0].Rows[i][1].ToString();
                //        string carpark = ds.Tables[0].Rows[i][2].ToString();
                //        string station = ds.Tables[0].Rows[i][3].ToString();
                //        string issue = ds.Tables[0].Rows[i][4].ToString();
                //        string AttendedTime = ds.Tables[0].Rows[i][5].ToString().Substring(0, 19);
                //        Alert alert = new Alert();
                //        string cp = submitby + " attend a case on " + AttendedTime + "\r\n";
                //        cp = cp + "Car Park : " + carpark + "\r\n";
                //        cp = cp + "Station  : " + station + "\r\n";
                //        cp = cp + "Issue  : " + issue + "\r\n";
                //        cp = cp + "Issue id : " + linkid + "\r\n";
                //        alert.textBox1.Text = cp;
                //        LogClass.WirteLine(cp);
                //        Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - alert.Width, Screen.PrimaryScreen.WorkingArea.Height - alert.Height);
                //        alert.PointToScreen(p);
                //        alert.Location = p;
                //        Beautiful.AnimateWindow(alert.Handle, 1000, Beautiful.AW_BLEND);
                //        alert.Show();
                //        FirstFresh();
                //    }

                //}

                //Test commit
                if (ds.Tables[0].Rows.Count >= 1)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        string submitby     = ds.Tables[0].Rows[i][0].ToString();
                        string linkid       = ds.Tables[0].Rows[i][1].ToString();
                        string carpark      = ds.Tables[0].Rows[i][2].ToString();
                        string station      = ds.Tables[0].Rows[i][3].ToString();
                        string issue        = ds.Tables[0].Rows[i][4].ToString();
                        string AttendedTime = ds.Tables[0].Rows[i][5].ToString().Substring(0, 19);
                        Alert  alert        = new Alert();
                        string cp           = submitby + " attend a case on " + AttendedTime + "\r\n";
                        cp = cp + "Car Park : " + carpark + "\r\n";
                        cp = cp + "Station  : " + station + "\r\n";
                        cp = cp + "Issue  : " + issue + "\r\n";
                        cp = cp + "Issue id : " + linkid + "\r\n";
                        alert.textBox1.Text = cp;
                        LogClass.WirteLine(cp);
                        Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - alert.Width, Screen.PrimaryScreen.WorkingArea.Height - alert.Height);
                        alert.PointToScreen(p);
                        alert.Location = p;
                        Beautiful.AnimateWindow(alert.Handle, 1000, Beautiful.AW_BLEND);
                        alert.Show();
                        // FirstFresh();
                    }
                }
            }
            catch (Exception e)
            {
                LogClass.WirteLine("popup windows for new attend case error : " + e.ToString());
            }

            try
            {
                if (ds.Tables[1].Rows.Count >= 1)
                {
                    for (int i = 0; i < ds.Tables[1].Rows.Count; i++)
                    {
                        string submitby = ds.Tables[1].Rows[i][0].ToString();
                        string linkid   = ds.Tables[1].Rows[i][1].ToString();
                        string carpark  = ds.Tables[1].Rows[i][2].ToString();
                        string station  = ds.Tables[1].Rows[i][3].ToString();
                        string issue    = ds.Tables[1].Rows[i][4].ToString();
                        string follower = ds.Tables[1].Rows[i][5].ToString();
                        Alert  alert    = new Alert();
                        string cp       = submitby + " submit a new service report from " + "\r\n";
                        cp = cp + "Car Park : " + carpark + "\r\n";
                        cp = cp + "Station  : " + station + "\r\n";
                        cp = cp + "Issue  : " + issue + "\r\n";
                        cp = cp + "Issue id : " + linkid + "\r\n";
                        cp = cp + "Follow up by : " + follower + "\r\n";
                        alert.textBox1.Text = cp;
                        LogClass.WirteLine(cp);
                        Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width - alert.Width, Screen.PrimaryScreen.WorkingArea.Height - alert.Height);
                        alert.PointToScreen(p);
                        alert.Location = p;
                        Beautiful.AnimateWindow(alert.Handle, 1000, Beautiful.AW_BLEND);
                        alert.Show();
                        FirstFresh();
                    }
                }
            }
            catch (Exception e)
            {
                LogClass.WirteLine("popup windows for new service report error : " + e.ToString());
            }
        }