随笔-6  评论-1  文章-7  trackbacks-0

/// <summary>
        /// 在页面显示出对应的年月
        /// </summary>
        protected void YearMonthBind(string companyID, int startMonth)
        {
            int myYear = Convert.ToInt32(dropYear.SelectedValue);
            int myMonth = startMonth;

            foreach (DataGridItem i in this.DtGrid.Controls[0].Controls)
            {
                if (i.ItemType == ListItemType.Header)
                {
                    for (int month_i = 1; month_i <= 12; month_i++)
                    {
                        Label myLabel = (Label)i.FindControl("lblMonth" + month_i.ToString());
                        myLabel.Text = myYear.ToString() + "." + myMonth.ToString();

                        myMonth++;
                        if (myMonth > 12)
                        {
                            myMonth = myMonth - 12;
                            myYear += 1;
                        }
                    }
                    break;
                }

            }


        }

private void showMessage(string mess)
        {
            string js = "alert('" + mess + "')";
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "showMessage", js, true);
        }

posted on 2008-03-25 13:54 romce 阅读(10) 评论(0)  编辑 收藏 所属分类: 随笔

标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
 
另存  打印