示例#1
0
文件: Form1.cs 项目: esafb52/ClassSRM
        // isOne => if month is 01 we must set prevMonth 12 and prevYear - 1
        private void drawChart(int id, string Date1, string Date2, bool isOne)
        {
            var dc = new ClassSRMDataContext(Config.connection);

            if (isOne)
            {
                int nyear = Convert.ToInt32(strYear) - 1;
                sumEvaBindingSource.DataSource  = dc.SelectSumEvaDate(id, strYear + "/" + Date1 + "/" + "01", strYear + "/" + Date1 + "/" + "31");
                sumEvaBindingSource1.DataSource = dc.SelectSumEvaDate(id, nyear + "/" + Date2 + "/" + "01", nyear + "/" + Date2 + "/" + "31");
            }
            else
            {
                sumEvaBindingSource.DataSource  = dc.SelectSumEvaDate(id, strYear + "/" + Date1 + "/" + "01", strYear + "/" + Date1 + "/" + "31");
                sumEvaBindingSource1.DataSource = dc.SelectSumEvaDate(id, strYear + "/" + Date2 + "/" + "01", strYear + "/" + Date2 + "/" + "31");
            }
        }
示例#2
0
文件: Form1.cs 项目: esafb52/ClassSRM
        private void drawChart(int id)
        {
            var dc = new ClassSRMDataContext(Config.connection);

            CreateCustomDate();
            if (strCurMonth.Equals("01"))
            {
                int nyear = Convert.ToInt32(strYear) - 1;
                sumEvaBindingSource.DataSource  = dc.SelectSumEvaDate(id, strYear + "/" + strCurMonth + "/" + "01", strYear + "/" + strCurMonth + "/" + "31");
                sumEvaBindingSource1.DataSource = dc.SelectSumEvaDate(id, nyear + "/" + "12" + "/" + "01", nyear + "/" + "12" + "/" + "31");
            }
            else
            {
                sumEvaBindingSource.DataSource  = dc.SelectSumEvaDate(id, strYear + "/" + strCurMonth + "/" + "01", strYear + "/" + strCurMonth + "/" + "31");
                sumEvaBindingSource1.DataSource = dc.SelectSumEvaDate(id, strYear + "/" + PrevMonth.ToString("00") + "/" + "01", strYear + "/" + PrevMonth + "/" + "31");
            }
        }