예제 #1
0
 public void ToolMouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         //DrawingObject clickObject = canvas.GetCanvasObject(e.X,e.Y);
         varChart          = new Chart(new System.Drawing.Point(e.X, e.Y));
         varChart.Endpoint = new System.Drawing.Point(e.X, e.Y);
         canvas.AddDrawingObject(varChart);
     }
     if (e.Button == MouseButtons.Right)
     {
         if (varChart.GetPointChartAll().Count == 0 || varChart.GetLabelYAll().Count == 0)
         {
             string s = "Isi point dan label x menggunakan XValue dan label y dengan YValue";
             using (Notifikasi form = new Notifikasi(s))
             {
                 if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     form.ShowDialog();
                 }
             }
         }
         else
         {
             using (TableChart form = new TableChart(varChart, canvas))
             {
                 if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     form.ShowDialog();
                 }
             }
         }
     }
 }
예제 #2
0
    public Notifikasi GetNotifikasi()
    {
        Notifikasi           notif         = new Notifikasi();
        List <NotifPimpinan> notifPimpinan = new List <NotifPimpinan>();

        SqlConnection conn  = Common.getConnection();
        string        query = "";
        SqlCommand    cmd   = new SqlCommand();

        cmd.Connection  = conn;
        cmd.CommandType = System.Data.CommandType.Text;

        query           = "SELECT count(*) as jml_notif, tipe FROM v_notif_pimpinan group by tipe";
        cmd.CommandText = query;

        conn.Open();
        SqlDataReader reader = cmd.ExecuteReader();

        while (reader.Read())
        {
            NotifPimpinan pimpinan = new NotifPimpinan();
            pimpinan.JmlNotif = reader["jml_notif"].ToString();
            pimpinan.Tipe     = reader["tipe"].ToString();

            notifPimpinan.Add(pimpinan);
        }
        conn.Close();

        notif.Pimpinans = notifPimpinan;

        query           = "SELECT count(*) as notif_teknisi FROM t_penugasan_inventaris where is_start=0 and status!=6 ";
        cmd.CommandText = query;

        conn.Open();
        reader = cmd.ExecuteReader();
        while (reader.Read())
        {
            notif.notifTeknisi = reader["notif_teknisi"].ToString();
        }
        conn.Close();

        return(notif);
    }