private void Update(string calendarId) { if (string.IsNullOrEmpty(calendarId)) { this.Label1.Text = ""; } QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); DataTable dt = calendarFactory.GetCalendar(calendarId); if (dt == null || dt.Rows.Count == 0) { this.Label1.Text = ""; } this.txtTheme.Text = dt.Rows[0]["Theme"].ToString(); this.txtSite.Text = dt.Rows[0]["Site"].ToString(); this.ddlLabel.Items.FindByValue(dt.Rows[0]["Label"].ToString()).Selected = true; DateTime sDate = Convert.ToDateTime(dt.Rows[0]["StartTime"].ToString()); DateTime eDate = Convert.ToDateTime(dt.Rows[0]["EndTime"].ToString()); this.AjaxCalendarS.Text = sDate.ToShortDateString(); this.AjaxCalendarE.Text = eDate.ToShortDateString(); this.ddlDTime.Items.FindByValue(sDate.ToShortTimeString()).Selected = true; this.ddlETime.Items.FindByValue(eDate.ToShortTimeString()).Selected = true; this.txtContent.Text = dt.Rows[0]["DContent"].ToString(); }
protected void btnSave_Click(object sender, EventArgs e) { string theme = this.txtTheme.Text; string site = this.txtSite.Text; string label = this.ddlLabel.SelectedValue; string sDate = this.AjaxCalendarS.Text; string eDate = this.AjaxCalendarE.Text; string sTime = this.ddlDTime.SelectedValue; string eTime = this.ddlETime.SelectedValue; string content = this.txtContent.Text; if (type == "Add") calendarId = Guid.NewGuid().ToString(); else calendarId = ViewState["CALENDARID"].ToString(); QJVRMS.Business.CalendarFactory calendar = new QJVRMS.Business.CalendarFactory(); if (calendar.EditCalendar(calendarId, theme, site, label, sDate, sTime, eDate, eTime, content, CurrentUser.UserLoginName)) { this.Label1.Text = "成功"; string t = ViewState["CALENDARTIME"].ToString(); DateTime sDateTime = Convert.ToDateTime(sDate); DateTime eDateTime = Convert.ToDateTime(eDate); string param = GetString(sDateTime, eDateTime); //Page.RegisterClientScriptBlock("calendar", "<script>add('" + t + "', '" + CurrentUser.UserLoginName + "', '" + t.Replace("-", string.Empty) + "')</script>"); Page.RegisterClientScriptBlock("calendar", "<script>adds('" + param + "', '" + CurrentUser.UserLoginName + "')</script>"); } else this.Label1.Text = "失败"; }
protected void btnSave_Click(object sender, EventArgs e) { string theme = this.txtTheme.Text; string site = this.txtSite.Text; string label = this.ddlLabel.SelectedValue; string sDate = this.AjaxCalendarS.Text; string eDate = this.AjaxCalendarE.Text; string sTime = this.ddlDTime.SelectedValue; string eTime = this.ddlETime.SelectedValue; string content = this.txtContent.Text; if (type == "Add") { calendarId = Guid.NewGuid().ToString(); } else { calendarId = ViewState["CALENDARID"].ToString(); } QJVRMS.Business.CalendarFactory calendar = new QJVRMS.Business.CalendarFactory(); if (calendar.EditCalendar(calendarId, theme, site, label, sDate, sTime, eDate, eTime, content, CurrentUser.UserLoginName)) { this.Label1.Text = "成功"; } else { this.Label1.Text = "失败"; } }
private void Look(string calendarId) { if (string.IsNullOrEmpty(calendarId)) return; QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); DataTable dt = calendarFactory.GetCalendar(calendarId); if (dt == null || dt.Rows.Count == 0) return; this.lbTheme.Text = dt.Rows[0]["Theme"].ToString(); this.lbSite.Text = dt.Rows[0]["Site"].ToString(); this.lbLabel.Text = dt.Rows[0]["Label"].ToString(); DateTime sDate = Convert.ToDateTime(dt.Rows[0]["StartTime"].ToString()); DateTime eDate = Convert.ToDateTime(dt.Rows[0]["EndTime"].ToString()); param = GetString(sDate, eDate); if (IsDiffTime(DateTime.Now, sDate)) this.lbState.Text = "距开始" + GetDiffTime(DateTime.Now, sDate); else if (IsDiffTime(DateTime.Now, eDate)) this.lbState.Text = "正在进行"; else this.lbState.Text = "已过期" + GetDiffTime(DateTime.Now, eDate); this.lbSdate.Text = sDate.ToShortDateString() + " " + sDate.ToShortTimeString(); this.lbEdate.Text = eDate.ToShortDateString() + " " + eDate.ToShortTimeString(); this.lbContent.Text = dt.Rows[0]["DContent"].ToString(); }
protected void btnSave_Click(object sender, EventArgs e) { string theme = this.txtTheme.Text; string site = this.txtSite.Text; string label = this.ddlLabel.SelectedValue; string sDate = this.AjaxCalendarS.Text; string eDate = this.AjaxCalendarE.Text; string sTime = this.ddlDTime.SelectedValue; string eTime = this.ddlETime.SelectedValue; string content = this.txtContent.Text; if (type == "Add") { calendarId = Guid.NewGuid().ToString(); } else { calendarId = ViewState["CALENDARID"].ToString(); } QJVRMS.Business.CalendarFactory calendar = new QJVRMS.Business.CalendarFactory(); if (calendar.EditCalendar(calendarId, theme, site, label, sDate, sTime, eDate, eTime, content, CurrentUser.UserLoginName)) { this.Label1.Text = "成功"; string t = ViewState["CALENDARTIME"].ToString(); DateTime sDateTime = Convert.ToDateTime(sDate); DateTime eDateTime = Convert.ToDateTime(eDate); string param = GetString(sDateTime, eDateTime); //Page.RegisterClientScriptBlock("calendar", "<script>add('" + t + "', '" + CurrentUser.UserLoginName + "', '" + t.Replace("-", string.Empty) + "')</script>"); Page.RegisterClientScriptBlock("calendar", "<script>adds('" + param + "', '" + CurrentUser.UserLoginName + "')</script>"); } else { this.Label1.Text = "失败"; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string time = get_LinkParam("time"); string name = CurrentUser.UserLoginName; QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); this.Content.InnerHtml = calendarFactory.ShowNowCalendars(time, name); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string calendarId = get_LinkParam("calendarId"); QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); string title = string.Empty; this.Content.InnerHtml = calendarFactory.ShowCalendar(calendarId, ref title); this.Title = title; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string time = get_LinkParam("time"); string name = CurrentUser.UserLoginName; QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); this.Content.InnerHtml = calendarFactory.ShowNowCalendars(time, name); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string calendarId = get_LinkParam("calendarId"); QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); string title = string.Empty; this.Content.InnerHtml = calendarFactory.ShowCalendar(calendarId, ref title); this.Title = title; } }
protected void Page_Load(object sender, EventArgs e) { this.Title = "您的日程安排"; name = CurrentUser.UserLoginName; if (!IsPostBack) { BindDropDownList(); DateTime now = DateTime.Now; QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); this.Content.InnerHtml = calendarFactory.SearchCalendarsContent(now.ToShortDateString(), string.Empty, string.Empty, string.Empty, name, 20, 1, 0); } }
protected void Page_Load(object sender, EventArgs e) { this.Title = "您的日程安排"; name = CurrentUser.UserLoginName; if (!IsPostBack) { BindDropDownList(); DateTime now = DateTime.Now; QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); this.Content.InnerHtml = calendarFactory.SearchCalendarsContent(now.ToShortDateString(), string.Empty, string.Empty, string.Empty, name, 20, 1, 0); } }
protected void btnSave_Click(object sender, EventArgs e) { string theme = this.txtTheme.Text; string site = this.txtSite.Text; string label = this.ddlLabel.SelectedValue; string sDate = this.AjaxCalendarS.Text; string eDate = this.AjaxCalendarE.Text; string sTime = this.ddlDTime.SelectedValue; string eTime = this.ddlETime.SelectedValue; string content = this.txtContent.Text; if(type == "Add") calendarId = Guid.NewGuid().ToString(); else calendarId = ViewState["CALENDARID"].ToString(); QJVRMS.Business.CalendarFactory calendar = new QJVRMS.Business.CalendarFactory(); if (calendar.EditCalendar(calendarId, theme, site, label, sDate, sTime, eDate, eTime, content, CurrentUser.UserLoginName)) this.Label1.Text = "成功"; else this.Label1.Text = "失败"; }
private void Update(string calendarId) { if (string.IsNullOrEmpty(calendarId)) this.Label1.Text = ""; QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); DataTable dt = calendarFactory.GetCalendar(calendarId); if (dt == null || dt.Rows.Count == 0) this.Label1.Text = ""; this.txtTheme.Text = dt.Rows[0]["Theme"].ToString(); this.txtSite.Text = dt.Rows[0]["Site"].ToString(); this.ddlLabel.Items.FindByValue(dt.Rows[0]["Label"].ToString()).Selected = true; DateTime sDate = Convert.ToDateTime(dt.Rows[0]["StartTime"].ToString()); DateTime eDate = Convert.ToDateTime(dt.Rows[0]["EndTime"].ToString()); this.AjaxCalendarS.Text = sDate.ToShortDateString(); this.AjaxCalendarE.Text = eDate.ToShortDateString(); this.ddlDTime.Items.FindByValue(sDate.ToShortTimeString()).Selected = true; this.ddlETime.Items.FindByValue(eDate.ToShortTimeString()).Selected = true; this.txtContent.Text = dt.Rows[0]["DContent"].ToString(); }
private void Look(string calendarId) { if (string.IsNullOrEmpty(calendarId)) { return; } QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); DataTable dt = calendarFactory.GetCalendar(calendarId); if (dt == null || dt.Rows.Count == 0) { return; } this.lbTheme.Text = dt.Rows[0]["Theme"].ToString(); this.lbSite.Text = dt.Rows[0]["Site"].ToString(); this.lbLabel.Text = dt.Rows[0]["Label"].ToString(); DateTime sDate = Convert.ToDateTime(dt.Rows[0]["StartTime"].ToString()); DateTime eDate = Convert.ToDateTime(dt.Rows[0]["EndTime"].ToString()); param = GetString(sDate, eDate); if (IsDiffTime(DateTime.Now, sDate)) { this.lbState.Text = "距开始" + GetDiffTime(DateTime.Now, sDate); } else if (IsDiffTime(DateTime.Now, eDate)) { this.lbState.Text = "正在进行"; } else { this.lbState.Text = "已过期" + GetDiffTime(DateTime.Now, eDate); } this.lbSdate.Text = sDate.ToShortDateString() + " " + sDate.ToShortTimeString(); this.lbEdate.Text = eDate.ToShortDateString() + " " + eDate.ToShortTimeString(); this.lbContent.Text = dt.Rows[0]["DContent"].ToString(); }
protected void Page_Load(object sender, EventArgs e) { string result = string.Empty; string type = get_LinkParam("type"); string calendarId = string.Empty; string name = string.Empty; QJVRMS.Business.CalendarFactory calendarFactory = new QJVRMS.Business.CalendarFactory(); switch (type) { case "Show": string nowTime = get_LinkParam("time"); name = get_LinkParam("name"); result = calendarFactory.ShowNowCalendars(nowTime, name); break; case "Delete": calendarId = get_LinkParam("calendarId"); if (calendarFactory.DeleteCalendar(calendarId)) { result = "删除成功;" + calendarId; } break; case "Content": int year = int.Parse(get_LinkParam("year")); int month = int.Parse(get_LinkParam("month")); name = get_LinkParam("name"); result = calendarFactory.ShowContent(year, month, name); break; case "Head": int hyear = int.Parse(get_LinkParam("year")); int hmonth = int.Parse(get_LinkParam("month")); name = get_LinkParam("name"); result = calendarFactory.ShowHead(hyear, hmonth, name); break; case "Single": string sTime = get_LinkParam("time"); name = get_LinkParam("name"); result = calendarFactory.ShowSingle(sTime, name); break; case "Save": string monthtime = get_LinkParam("time"); string stime = get_LinkParam("stime"); string etime = get_LinkParam("etime"); string state = get_LinkParam("state"); name = get_LinkParam("name"); string t = get_LinkParam("t"); result = calendarFactory.SearchCalendarsContent(monthtime, stime, etime, state, name, 20, 1, int.Parse(t)); break; case "Page": string pmonthtime = get_LinkParam("time"); string pstime = get_LinkParam("stime"); string petime = get_LinkParam("etime"); string pstate = get_LinkParam("state"); name = get_LinkParam("name"); string pt = get_LinkParam("t"); string size = string.IsNullOrEmpty(get_LinkParam("size")) ? "20" : get_LinkParam("size"); string index = get_LinkParam("index"); result = calendarFactory.SearchCalendarsContent(pmonthtime, pstime, petime, pstate, name, int.Parse(size), int.Parse(index), int.Parse(pt)); break; } Response.Write(result); Response.End(); }