Esempio n. 1
0
    public static void Create(WeekRecord week)
    {
        SimpleOrmOperator.Create(week);
        string datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至'));
        DateTime begin = DateTimeHelper.GetMonday(DateTime.Parse(datestr));
        YuyueLimitOperator.Save(week, 1, 1, datestr, week.Week1km1fp);
        YuyueLimitOperator.Save(week, 1, 2, datestr, week.Week1km2fp);
        YuyueLimitOperator.Save(week, 1, 3, datestr, week.Week1km3fp);

        YuyueLimitOperator.Save(week, 2, 1, datestr, week.Week2km1fp);
        YuyueLimitOperator.Save(week, 2, 2, datestr, week.Week2km2fp);
        YuyueLimitOperator.Save(week, 2, 3, datestr, week.Week2km3fp);

        YuyueLimitOperator.Save(week, 3, 1, datestr, week.Week3km1fp);
        YuyueLimitOperator.Save(week, 3, 2, datestr, week.Week3km2fp);
        YuyueLimitOperator.Save(week, 3, 3, datestr, week.Week3km3fp);

        YuyueLimitOperator.Save(week, 4, 1, datestr, week.Week4km1fp);
        YuyueLimitOperator.Save(week, 4, 2, datestr, week.Week4km2fp);
        YuyueLimitOperator.Save(week, 4, 3, datestr, week.Week4km3fp);

        YuyueLimitOperator.Save(week, 5, 1, datestr, week.Week5km1fp);
        YuyueLimitOperator.Save(week, 5, 2, datestr, week.Week5km2fp);
        YuyueLimitOperator.Save(week, 5, 3, datestr, week.Week5km3fp);

        YuyueLimitOperator.Save(week, 6, 1, datestr, week.Week6km1fp);
        YuyueLimitOperator.Save(week, 6, 2, datestr, week.Week6km2fp);
        YuyueLimitOperator.Save(week, 6, 3, datestr, week.Week6km3fp);

        YuyueLimitOperator.Save(week, 7, 1, datestr, week.Week7km1fp);
        YuyueLimitOperator.Save(week, 7, 2, datestr, week.Week7km2fp);
        YuyueLimitOperator.Save(week, 7, 3, datestr, week.Week7km3fp);
    }
    private string ComputeLink(WeekRecord week, int dayofweek, int km)
    {
        if (week.Id <= 0)
        {
            return string.Empty;
        }
        string sql = "select id,i_total,i_used_num,i_checked_num,c_kscc,c_kscc_code,c_ksdd,c_ksdd_code,c_school_name,c_school_code,date_ksrq from table_yuyue_limit "
           + " where i_week_num=" + week.WeekNum + " and i_dayofweek=" + dayofweek + " and i_km=" + km;
        DataTable dt = DataAccessFactory.GetDataAccess().SelectDataTable(sql, "tmp");
        string depcode = "social";
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            sb.Append(dt.Rows[i][6].ToString() + ";" + dt.Rows[i][4].ToString());

            if (dt.Rows[i][9].ToString() == depcode)
            {
                sb.Append(";" + "<a href='SocialCommitUser.aspx?id=" + dt.Rows[i][0].ToString() + "' target='_blank'>" + dt.Rows[i][8].ToString() + "</a>");
            }
            else
            {
                sb.Append(";" + dt.Rows[i][8].ToString());
            }
            sb.Append("(" + dt.Rows[i][2].ToString() + "/" + dt.Rows[i][3].ToString() + ")");
            sb.Append("/" + dt.Rows[i][1].ToString());
            sb.Append("<br/>");

        }
        return sb.ToString();
    }
Esempio n. 3
0
 public static void Create(WeekRecord week, ArrayList limits)
 {
     SimpleOrmOperator.Create(week);
     string datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至'));
     DateTime begin = DateTimeHelper.GetMonday(DateTime.Parse(datestr));
     foreach (object obj in limits)
     {
         YuyueLimit limit = obj as YuyueLimit;
         YuyueLimitOperator.Save(week, limit, begin);
     }
 }
Esempio n. 4
0
 public static Hashtable GetWeekLimits(WeekRecord week)
 {
     int weekNum = week.WeekNum;
     //String weekRang = week.WeekRange;
     //String year = weekRang.Substring(0,4);
     Hashtable dictWeekLimits = new Hashtable();
     ArrayList listWeekLimits = new ArrayList();
     string querySql = string.Format("where I_WEEK_NUM={0}",weekNum);
     listWeekLimits=SimpleOrmOperator.QueryConditionList<YuyueLimit>(querySql);
     foreach (YuyueLimit limit in listWeekLimits) {
         String key = genLimitKey(limit);
         dictWeekLimits.Add(key,limit);
     }
     return dictWeekLimits;
 }
Esempio n. 5
0
    public static void Save(WeekRecord week,int dayofweek,int km,string begindate,string desc)
    {
        if (desc == null || desc.Length == 0)
        {
            return;
        }
        int weeknum = week.WeekNum;
        DateTime begin = DateTime.Parse(begindate);
        ArrayList lists = new ArrayList();
        string[] array1 = desc.Trim("<br/>".ToCharArray()).Split(new string[]{"<br/>"},StringSplitOptions.RemoveEmptyEntries);
        string[] array2 = null;
        string[] array3 = null;
        YuyueLimit limit;
        for (int i = 0; i < array1.Length; i++)
        {
            limit = new YuyueLimit();
            limit.WeekNum = weeknum;
            limit.Operator = week.CheckOperator;
            limit.Ksrq = begin.AddDays(dayofweek-1).ToString("yyyy-MM-dd");
            limit.DayOfWeek = dayofweek;
            array2 = array1[i].Split(';');
            array3 = array2[0].Split(':');
            limit.KsddCode = array3[0];
            limit.Ksdd = array3[1];

            array3 = array2[1].Split(':');
            limit.KsccCode = array3[0];
            limit.Kscc = array3[1];

            array3 = array2[2].Split(':');
            limit.SchoolCode = array3[0];
            limit.SchoolName = array3[1];

            limit.Km = km;

            limit.Total =Int32.Parse(array2[3]);
            SimpleOrmOperator.Create(limit);

        }
           // SimpleOrmOperator.Delete<YuyueLimit>(id);
    }
    private void InitWeekRecord(WeekRecord week)
    {
        string datestr = "";
        if (week.Id <= 0)
        {
            datestr = this.txtDate.Value;
            // return;
        }
        else
        {
            datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至'));
        }
        DateTime begin = DateTimeHelper.GetMonday(DateTime.Parse(datestr));
        this.txtDate.Value = datestr;
        for (int i = 0; i < 7; i++)
        {
            this.Table1.Rows[i + 2].Cells[0].Text = this.GetChineseXq(i + 1) + "(" + begin.AddDays(i).ToString("yyyy-MM-dd") + ")";
        }
        this.txtxq1km1zs.Text = week.Week1km1Num.ToString();
        this.Table1.Rows[2].Cells[2].Text = this.ComputeLink(week, 1, 1);
        this.txtxq1km2zs.Text = week.Week1km2Num.ToString();
        this.Table1.Rows[2].Cells[4].Text = this.ComputeLink(week, 1, 2);
        this.txtxq1km3zs.Text = week.Week1km3Num.ToString();
        this.Table1.Rows[2].Cells[6].Text = this.ComputeLink(week, 1, 3);

        this.txtxq2km1zs.Text = week.Week2km1Num.ToString();
        this.Table1.Rows[3].Cells[2].Text = this.ComputeLink(week, 2, 1);
        this.txtxq2km2zs.Text = week.Week2km2Num.ToString();
        this.Table1.Rows[3].Cells[4].Text = this.ComputeLink(week, 2, 2);
        this.txtxq2km3zs.Text = week.Week2km3Num.ToString();
        this.Table1.Rows[3].Cells[6].Text = this.ComputeLink(week, 2, 3);

        this.txtxq3km1zs.Text = week.Week3km1Num.ToString();
        this.Table1.Rows[4].Cells[2].Text = this.ComputeLink(week, 3, 1);
        this.txtxq3km2zs.Text = week.Week3km2Num.ToString();
        this.Table1.Rows[4].Cells[4].Text = this.ComputeLink(week, 3, 2);
        this.txtxq3km3zs.Text = week.Week3km3Num.ToString();
        this.Table1.Rows[4].Cells[6].Text = this.ComputeLink(week, 3, 3);

        this.txtxq4km1zs.Text = week.Week4km1Num.ToString();
        this.Table1.Rows[5].Cells[2].Text = this.ComputeLink(week, 4, 1);
        this.txtxq4km2zs.Text = week.Week4km2Num.ToString();
        this.Table1.Rows[5].Cells[4].Text = this.ComputeLink(week, 4, 2);
        this.txtxq4km3zs.Text = week.Week4km3Num.ToString();
        this.Table1.Rows[5].Cells[6].Text = this.ComputeLink(week, 4, 3);

        this.txtxq5km1zs.Text = week.Week5km1Num.ToString();
        this.Table1.Rows[6].Cells[2].Text = this.ComputeLink(week, 5, 1);
        this.txtxq5km2zs.Text = week.Week5km2Num.ToString();
        this.Table1.Rows[6].Cells[4].Text = this.ComputeLink(week, 5, 2);
        this.txtxq5km3zs.Text = week.Week5km3Num.ToString();
        this.Table1.Rows[6].Cells[6].Text = this.ComputeLink(week, 5, 3);

        this.txtxq6km1zs.Text = week.Week6km1Num.ToString();
        this.Table1.Rows[7].Cells[2].Text = this.ComputeLink(week, 6, 1);
        this.txtxq6km2zs.Text = week.Week6km2Num.ToString();
        this.Table1.Rows[7].Cells[4].Text = this.ComputeLink(week, 6, 2);
        this.txtxq6km3zs.Text = week.Week6km3Num.ToString();
        this.Table1.Rows[7].Cells[6].Text = this.ComputeLink(week, 6, 3);

        this.txtxq7km1zs.Text = week.Week7km1Num.ToString();
        this.Table1.Rows[8].Cells[2].Text = this.ComputeLink(week, 7, 1);
        this.txtxq7km2zs.Text = week.Week7km2Num.ToString();
        this.Table1.Rows[8].Cells[4].Text = this.ComputeLink(week, 7, 2);
        this.txtxq7km3zs.Text = week.Week7km3Num.ToString();
        this.Table1.Rows[8].Cells[6].Text = this.ComputeLink(week, 7, 3);
    }
Esempio n. 7
0
 public static bool Save(WeekRecord week, YuyueLimit limit,DateTime beginDate)
 {
     limit.Operator = week.CheckOperator;
     limit.Ksrq = beginDate.AddDays(limit.DayOfWeek - 1).ToString("yyyy-MM-dd");
     return SimpleOrmOperator.Create(limit);
 }
Esempio n. 8
0
 public static WeekRecord GetByWeekNum(int num,string shortdate)
 {
     WeekRecord week = new WeekRecord();
     ArrayList lists = SimpleOrmOperator.QueryConditionList<WeekRecord>(" where i_week_num=" + num + " and c_week_range like '"+shortdate+"%'");
     if (lists.Count == 1)
     {
         week = lists[0] as WeekRecord;
     }
     else{
         week.WeekNum = num;
     }
     return week;
     // SimpleOrmOperator.Delete<WeekRecord>(id);
 }
Esempio n. 9
0
    public static void Update(WeekRecord week, ArrayList limits)
    {
        SimpleOrmOperator.Update(week);
        string datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至'));
        DateTime begin = DateTimeHelper.GetMonday(DateTime.Parse(datestr));
        string deleteSql = "delete from table_yuyue_limit where i_week_num=" + week.WeekNum + " and date_ksrq like '" + begin.Year.ToString() + "%'";
        DataAccessFactory.GetDataAccess().ExecuteSql(deleteSql);

        foreach (object obj in limits) {
            YuyueLimit limit = obj as YuyueLimit;
            YuyueLimitOperator.Save(week, limit, begin);
        }
    }
Esempio n. 10
0
    public static void Update(WeekRecord week)
    {
        SimpleOrmOperator.Update(week);
        string datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至'));
        DateTime begin = DateTimeHelper.GetMonday(DateTime.Parse(datestr));
        DataAccessFactory.GetDataAccess().ExecuteSql("delete from table_yuyue_limit where i_week_num="+week.WeekNum+ " and date_ksrq like '"+begin.Year.ToString()+"%'");

        YuyueLimitOperator.Save(week, 1, 1, datestr, week.Week1km1fp);
        YuyueLimitOperator.Save(week, 1, 2, datestr, week.Week1km2fp);
        YuyueLimitOperator.Save(week, 1, 3, datestr, week.Week1km3fp);

        YuyueLimitOperator.Save(week, 2, 1, datestr, week.Week2km1fp);
        YuyueLimitOperator.Save(week, 2, 2, datestr, week.Week2km2fp);
        YuyueLimitOperator.Save(week, 2, 3, datestr, week.Week2km3fp);

        YuyueLimitOperator.Save(week, 3, 1, datestr, week.Week3km1fp);
        YuyueLimitOperator.Save(week, 3, 2, datestr, week.Week3km2fp);
        YuyueLimitOperator.Save(week, 3, 3, datestr, week.Week3km3fp);

        YuyueLimitOperator.Save(week, 4, 1, datestr, week.Week4km1fp);
        YuyueLimitOperator.Save(week, 4, 2, datestr, week.Week4km2fp);
        YuyueLimitOperator.Save(week, 4, 3, datestr, week.Week4km3fp);

        YuyueLimitOperator.Save(week, 5, 1, datestr, week.Week5km1fp);
        YuyueLimitOperator.Save(week, 5, 2, datestr, week.Week5km2fp);
        YuyueLimitOperator.Save(week, 5, 3, datestr, week.Week5km3fp);

        YuyueLimitOperator.Save(week, 6, 1, datestr, week.Week6km1fp);
        YuyueLimitOperator.Save(week, 6, 2, datestr, week.Week6km2fp);
        YuyueLimitOperator.Save(week, 6, 3, datestr, week.Week6km3fp);

        YuyueLimitOperator.Save(week, 7, 1, datestr, week.Week7km1fp);
        YuyueLimitOperator.Save(week, 7, 2, datestr, week.Week7km2fp);
        YuyueLimitOperator.Save(week, 7, 3, datestr, week.Week7km3fp);
    }
Esempio n. 11
0
    private void InitWeekRecord(WeekRecord week)
    {
        string datestr = "";
        if (week.Id <= 0)
        {
            datestr = this.txtDate.Value;
            ViewState[VIEWSTATUE_LIMITS] = new ArrayList();
           // WeekRecord record=new WeekRecord();
           // record.
            ViewState[VIEWSTATUE_WEEKRECORD] = week;
           // return;
        }
        else
        {
            datestr = week.WeekRange.Substring(0, week.WeekRange.IndexOf('至'));
        }
        DateTime begin = DateTimeHelper.GetMonday(DateTime.Parse(datestr));
        this.txtDate.Value = datestr;
        for (int i = 0; i < 7; i++)
        {
            this.Table1.Rows[i + 2].Cells[0].Text = this.GetChineseXq(i + 1) + "(" + begin.AddDays(i).ToString("yyyy-MM-dd") + ")";
        }
        this.txtxq1km1zs.Text = week.Week1km1Num.ToString();
        this.Table1.Rows[2].Cells[2].Text=week.Week1km1fp == null ? "&nbsp;" : week.Week1km1fp.ToString();
        this.txtxq1km2zs.Text=week.Week1km2Num.ToString();
        this.Table1.Rows[2].Cells[4].Text = week.Week1km2fp == null ? "&nbsp;" : week.Week1km2fp.ToString();
        this.txtxq1km3zs.Text = week.Week1km3Num .ToString();
        this.Table1.Rows[2].Cells[6].Text = week.Week1km3fp == null ? "&nbsp;" : week.Week1km3fp.ToString();

        this.txtxq2km1zs.Text = week.Week2km1Num.ToString();
        this.Table1.Rows[3].Cells[2].Text = week.Week2km1fp == null ? "&nbsp;" : week.Week2km1fp.ToString();
        this.txtxq2km2zs.Text = week.Week2km2Num.ToString();
        this.Table1.Rows[3].Cells[4].Text = week.Week2km2fp == null ? "&nbsp;" : week.Week2km2fp.ToString();
        this.txtxq2km3zs.Text = week.Week2km3Num.ToString();
        this.Table1.Rows[3].Cells[6].Text = week.Week2km3fp == null ? "&nbsp;" : week.Week2km3fp.ToString();

        this.txtxq3km1zs.Text = week.Week3km1Num.ToString();
        this.Table1.Rows[4].Cells[2].Text = week.Week3km1fp == null ? "&nbsp;" : week.Week3km1fp.ToString();
        this.txtxq3km2zs.Text = week.Week3km2Num.ToString();
        this.Table1.Rows[4].Cells[4].Text = week.Week3km2fp == null ? "&nbsp;" : week.Week3km2fp.ToString();
        this.txtxq3km3zs.Text = week.Week3km3Num.ToString();
        this.Table1.Rows[4].Cells[6].Text = week.Week3km3fp == null ? "&nbsp;" : week.Week3km3fp.ToString();

        this.txtxq4km1zs.Text = week.Week4km1Num.ToString();
        this.Table1.Rows[5].Cells[2].Text = week.Week4km1fp == null ? "&nbsp;" : week.Week4km1fp.ToString();
        this.txtxq4km2zs.Text = week.Week4km2Num.ToString();
        this.Table1.Rows[5].Cells[4].Text = week.Week4km2fp == null ? "&nbsp;" : week.Week4km2fp.ToString();
        this.txtxq4km3zs.Text = week.Week4km3Num.ToString();
        this.Table1.Rows[5].Cells[6].Text = week.Week4km3fp == null ? "&nbsp;" : week.Week4km3fp.ToString();

        this.txtxq5km1zs.Text = week.Week5km1Num.ToString();
        this.Table1.Rows[6].Cells[2].Text = week.Week5km1fp == null ? "&nbsp;" : week.Week5km1fp.ToString();
        this.txtxq5km2zs.Text = week.Week5km2Num.ToString();
        this.Table1.Rows[6].Cells[4].Text = week.Week5km2fp == null ? "&nbsp;" : week.Week5km2fp.ToString();
        this.txtxq5km3zs.Text = week.Week5km3Num.ToString();
        this.Table1.Rows[6].Cells[6].Text = week.Week5km3fp == null ? "&nbsp;" : week.Week5km3fp.ToString();

        this.txtxq6km1zs.Text = week.Week6km1Num.ToString();
        this.Table1.Rows[7].Cells[2].Text = week.Week6km1fp == null ? "&nbsp;" : week.Week6km1fp.ToString();
        this.txtxq6km2zs.Text = week.Week6km2Num.ToString();
        this.Table1.Rows[7].Cells[4].Text = week.Week6km2fp == null ? "&nbsp;" : week.Week6km2fp.ToString();
        this.txtxq6km3zs.Text = week.Week6km3Num.ToString();
        this.Table1.Rows[7].Cells[6].Text = week.Week6km3fp == null ? "&nbsp;" : week.Week6km3fp.ToString();

        this.txtxq7km1zs.Text = week.Week7km1Num.ToString();
        this.Table1.Rows[8].Cells[2].Text = week.Week7km1fp == null ? "&nbsp;" : week.Week7km1fp.ToString();
        this.txtxq7km2zs.Text = week.Week7km2Num.ToString();
        this.Table1.Rows[8].Cells[4].Text = week.Week7km2fp == null ? "&nbsp;" : week.Week7km2fp.ToString();
        this.txtxq7km3zs.Text = week.Week7km3Num.ToString();
        this.Table1.Rows[8].Cells[6].Text = week.Week7km3fp == null ? "&nbsp;" : week.Week7km3fp.ToString();
    }