Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » Date / Time » Downloads
 
Add your own
alternative version

Persian Calendar with Tray Icon

, 12 Mar 2012 CPOL
A Persian calendar that shows a tray icon
traycalande-binary.zip
hijri.mdb
mytray.exe
traycalande-source.zip
traycalande-source
bin
Release
ClassDiagram1.cd
ClassDiagram2.cd
CrystalReport1.rpt
CrystalReport_task.rpt
CrystalReport_taskall.rpt
hijri.mdb
In_DataSet.xsc
In_DataSet.xss
mytray.csproj.user
mytray.csproj.vspscc
mytray.suo
mytray.vssscc
mytray_TemporaryKey.pfx
Properties
Settings.settings
vssver.scc
Resources
icon1.ico
icon10.ico
icon11.ico
icon12.ico
icon13.ico
icon14.ico
icon15.ico
icon16.ico
icon17.ico
icon18.ico
icon19.ico
icon2.ico
icon20.ico
icon21.ico
icon22.ico
icon23.ico
icon24.ico
icon25.ico
icon26.ico
icon27.ico
icon28.ico
icon29.ico
icon3.ico
icon30.ico
icon31.ico
icon4.ico
icon5.ico
icon6.ico
icon7.ico
icon8.ico
icon9.ico
tumb.jpg
vssver.scc
vssver2.scc
��using System;) using System.Collections.Generic;) using System.ComponentModel;) using System.Data;) using System.Drawing;) using System.Text;) using System.Windows.Forms;) using System.Globalization;) ) ) namespace mytray) {)     public partial class Form_Task : Form)     {)         private void SetTime())         {)             string strh,strm;)               DateTime d = DateTime.Now;)                if( d.Hour<10))                    strh="0"+d.Hour.ToString();)                else)                    strh=d.Hour.ToString();)               if( d.Minute<10))                    strm="0"+d.Minute.ToString();)                else)                    strm=d.Minute.ToString();) )                txt_Time.Text = strh + ":" + strm;) )         }) ) )         private string date;)         private string dayofweek;)         /// <summary>)         /// set the tasks date)         /// </summary>)        public string Date)         {)            set{)                date=value;

               string[] ar = date.Split('/');

               string str = "";

               str = ar[0] +"/"+ Convert.ToUInt32(ar[1]).ToString("00") +"/"+ Convert.ToUInt32(ar[2]).ToString("00");

              // if (ar[0].Trim() != "")         //strFilter= "{Tasks.Date}>=DateTime ("+ar[0]+","+ ar[1]+","+ ar[2]+", 00, 00, 00)" ;//1387/2/5'";

  )                date=str;)                tskbindings.Filter = "Date='" + date + "'";)                txt_date.Text = Date;)                this.Text = "D�3* �'1G'� " + GetDayOfWeekName() + date;)                if(TaskCount==0) SetTime();)                })            get{)                return date;)            }) )         })         public int TaskCount)         {)             get)             {)                 return tskbindings.Count;)             }) )         })         string GetDayOfWeekName())         {)             string dstr=Date;)             string []s=dstr.Split('/');)             /* use of .net persiancalender)             PersianCalendar PerC = new PersianCalendar();)             DateTime dt;)             dt=PerC.ToDateTime(Convert.ToInt32(s[0]))                 , Convert.ToInt32(s[1]), Convert.ToInt32(s[2]), 0, 0, 0, 0);)   )             int d = (int)dt.DayOfWeek;)             int w =dt.DayOfYear;)              */)             CPersianCalender theCalender = new CPersianCalender();)             int dayOfWeek = theCalender.GetDayOfWeek(Convert.ToInt32(s[2]))                 , Convert.ToInt32(s[1]), Convert.ToInt32(s[0]));)             return theCalender.GetDayOfWeekName(dayOfWeek);) )         }) )         public Form_Task())         {)             InitializeComponent();)             this.tasksTableAdapter.Fill(this.tasks_DataSet.Tasks);)            )         }) )         private void Form_Task_Load(object sender, EventArgs e))         {)             // TODO: This line of code loads data into the 'tasks_DataSet.Tasks' table. You can move, or remove it, as needed.

)             this.tasksTableAdapter.Fill(this.tasks_DataSet.Tasks);) )             // TODO: This line of code loads data into the 'tasks_DataSet.Tasks' table. You can move, or remove it, as needed.

) ) )        //    tskbindings.AddNew();)           //  tskbindings.AddNew();)             txt_date.Text = Date;)             if(TaskCount==0))             SetTime();)             this.Text = "D�3* �'1G'� " + GetDayOfWeekName()+ date;) )  )         }) )         private void dateTimePicker1_ValueChanged(object sender, EventArgs e))         {) )         }) )         private void button1_Click(object sender, EventArgs e))         {)           //  tasks_DataSet.Tasks.AddTasksRow(txt_Desc.Text, Date, txt_Time.Text);)        //     tasks_DataSet.AcceptChanges();)          //   tasksTableAdapter.Update(this.tasks_DataSet);)             )           //  tskbindings.AddNew();)             txt_date.Text = Date;)             DateTime d = DateTime.Now;)             SetTime();) )          //   txt_date.Text = Date;) )         }) )         private void Form_Task_FormClosing(object sender, FormClosingEventArgs e))         {)             tasksTableAdapter.Update(this.tasks_DataSet.Tasks);) )         }) )         private void linkLabel_insert_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e))         {) )             )             txt_date.Text = Date;)             DateTime d = DateTime.Now;)             SetTime();)        }) )         private void linkLabel_del_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e))         {)             tskbindings.RemoveCurrent();)             txt_date.Text = Date;)             DateTime d = DateTime.Now;)             SetTime();) )         }) )         private void linkLabel_undo_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e))         {)             tasks_DataSet.RejectChanges();) )         }) )         private void linkLabel_new_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e))         {)             tskbindings.AddNew();)             txt_date.Text = Date;)             DateTime d = DateTime.Now;)             SetTime();)             tskbindings.EndEdit();) ) )         }) )         private void checkBox_notcomplete_CheckedChanged(object sender, EventArgs e))         {)             if(checkBox_notcomplete.Checked==true))                 tskbindings.Filter += " AND (Done = 0)";)             else)                 tskbindings.Filter = "Date='" + date + "'";) )         }) )         private void linkLabel_print_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e))         {)             Form_print fp = new Form_print();)             string str =GetDayOfWeekName()+" "+ date;)             fp.Init_Report(tasks_DataSet,GetDayOfWeekName(),Date,checkBox_notcomplete.Checked);)             fp.ShowDialog();)         }) )         private void tasksBindingSource_CurrentChanged(object sender, EventArgs e))         {) )         }) )         private void linkLabel_save_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e))         {)             tskbindings.EndEdit();)             tasksTableAdapter.Update(tasks_DataSet.Tasks);)             Close();)         }) )         private void linkLabel_delete_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e))         {)             if(tskbindings.Count>0))             tskbindings.RemoveCurrent();)         }) )         private void btn_cancel_Click(object sender, EventArgs e))         {)             tasks_DataSet.RejectChanges();)             Close();)         }) )         private void dataGridView1_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e))         {)           int i = 1;)            foreach (DataGridViewRow r in dataGridView1.Rows))            {)                r.Cells[0].Value = i.ToString();)                i++;)            }) )         }) )         private void txt_Time_TypeValidationCompleted(object sender, TypeValidationEventArgs e))         {)             if (e.IsValidInput == false))             {)             //    MessageBox.Show("error in input");)                 txt_Time.Text = "";)             })         })     }) }

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

mohammad hajibegloo
Engineer neyshabur azad univeristy
Iran (Islamic Republic Of) Iran (Islamic Republic Of)
I had worked as programmer,project manager,web developer for more than 3 years, and have worked on programming personaly for more than 10 years.
I have worked in university as a teacher for 8 years.
my favorite langueges are : VC++,C#,ASP.NET,PHP

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150327.1 | Last Updated 12 Mar 2012
Article Copyright 2008 by mohammad hajibegloo
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid