Ejemplo n.º 1
0
        protected void RepeaterSchedule_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "button")
            {
                ((Label)e.Item.FindControl("Label1")).Text = DateTime.Now.ToString();
            }

            else if (e.CommandName == "monthLinkButton")
            {
                Panel p = (Panel)e.Item.FindControl("monthPanel");
                p.Visible = true;
                string[] arg        = e.CommandArgument.ToString().Split(new char[] { '$' });
                string   monthDeail = sc.GetMonthScheduleDetail(Guid.Parse(arg[0]), int.Parse(arg[1]));
                ((Label)e.Item.FindControl("monthLabel")).Text = monthDeail;
            }
        }
Ejemplo n.º 2
0
        protected void RepeaterSchedule_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "monthLinkButton")
            {
                Panel p = (Panel)e.Item.FindControl("monthPanel");
                p.Visible = true;
                string[] arg = e.CommandArgument.ToString().Split(new char[] { '$' });

                editWorkID = Guid.Parse(arg[0]);
                editMonth  = int.Parse(arg[1]);

                //判断月节点信息是否为当月,如果不是则不能编辑显示内容包括周工作计划等信息
                string monthDeail = editMonth < DateTime.Now.Month - 1 ? sc.GetMonthScheduleDetail(editWorkID, editMonth) : sc.GetMonthSchedule(editWorkID, editMonth);
                //string monthDeail = sc.GetMonthSchedule(editWorkID, editMonth);
                ((Label)e.Item.FindControl("monthLabel")).Text = monthDeail;

                //通过ViewState将当前编辑的工作ID和月份传给提交按钮事件
                ViewState["editWorkID"] = editWorkID;
                ViewState["editMonth"]  = editMonth;

                //如果编辑的不为当前页则隐藏编辑文本框和repeater控件
                if (editMonth < DateTime.Now.Month - 1)
                {
                    ((Repeater)e.Item.FindControl("RepeaterWeekSchedule")).Visible = false;
                }
                else
                {
                    ((Repeater)e.Item.FindControl("RepeaterWeekSchedule")).DataBind();
                }
            }

            //if (e.CommandName == "SubmitWeekSchedule")
            //{
            //    Response.Write("xx");
            //}
        }