コード例 #1
0
        public override void DataBind()
        {
            string[] users = Users.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);

            if (ShowUsers)
            {
                DataTable userTable = new DataTable();
                userTable.Locale = CultureInfo.InvariantCulture;
                userTable.Columns.Add(new DataColumn("UserId", typeof(int)));
                userTable.Columns.Add(new DataColumn("Details", typeof(string)));

                foreach (string s in users)
                {
                    int userId = int.Parse(s, CultureInfo.InvariantCulture);

                    string details = String.Empty;
                    if (!Mediachase.IBN.Business.Calendar.CheckUserCalendar(userId))
                    {
                        details = LocRM.GetString("NoCalendar");
                    }

                    DataRow dr = userTable.NewRow();
                    dr["UserId"]  = userId;
                    dr["Details"] = details;
                    userTable.Rows.Add(dr);
                }

                UsersGrid.DataSource = userTable.DefaultView;
                UsersGrid.DataBind();
            }

            ImageHeight = users.Length * ResourceChart.ItemHeight;            // +ResourceChart.HeaderHeight;
            divImg.Style.Add(HtmlTextWriterStyle.Height, (ImageHeight + ResourceChart.HeaderHeight).ToString() + "px");

            LinkToGraph.Value = String.Format(CultureInfo.InvariantCulture,
                                              "{0}?Users={1}&Vast={2}&StartDate={3}&CurDate={4}&ObjectTypes={5}&HObjects={6}&HTypes={7}",
                                              ResolveClientUrl("~/Projects/ResourceChartImage.aspx"),
                                              Users,
                                              IntervalDuration == 7,
                                              StartDate.ToString("yyyy-MM-dd"),
                                              Server.UrlEncode(CurDate.ToString("yyyy-MM-dd HH:mm")),
                                              ObjectTypes,
                                              HObjects,
                                              HTypes);

            base.DataBind();
        }
コード例 #2
0
ファイル: ItemType.cs プロジェクト: asd751840550/CalendarWpf
 public override string ToString()
 {
     return(CurDate.ToString());
 }