protected void btnSubmit_Click(object sender, EventArgs e) { //Model.Calendar calendar = BLL.WorkHelper.CalendarManager.GetAllCalendarByID(Id); Model.Calendar calendar = new Model.Calendar(); if (id > 0) { calendar.Id = sid; calendar.UId.UID = id; calendar.TransactTime = Convert.ToDateTime(this.txtTime.Value); calendar.RemaindTime = Convert.ToDateTime(this.txtJackTime.Value); calendar.Repeat = this.rdoRepeat.SelectedValue; calendar.CalType = this.droType.SelectedValue; calendar.CalTheme = this.txtTitle.Text; calendar.CalContent = this.txDes.Value; Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('更新成功!');</script>"); BLL.WorkHelper.CalendarManager.GetCalendarById(calendar); Response.Redirect("SelectCalender.aspx"); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('更新失败!');</script>"); } }
protected void btnSubmit_Click1(object sender, EventArgs e) { UserInfo user = Session["user"] as UserInfo; Model.Calendar calendar = new Model.Calendar(); calendar.UId.UID = user.UID; calendar.CalTheme = txtTitle.Text.Trim(); calendar.CalContent = txDes.Value; calendar.TransactTime = Convert.ToDateTime(txtTime.Value); calendar.RemaindTime = Convert.ToDateTime(txtJackTime.Value.Trim() + " " + txtHour.Text.Trim() + ":" + txtSecond.Text.Trim()); calendar.CalType = droType.SelectedValue; calendar.Repeat = rdoRepeat.SelectedValue; int flag = CalendarManager.AddCalendar(calendar); if (flag > 0) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加成功!');location.href='SelectCalender.aspx';</script>"); //增加操作日志 //UserInfo users = (UserInfo)Session["CurUser"]; //string operateName = users.LoginID; //DateTime operateTime = Convert.ToDateTime(DateTime.Now.ToString()); //string operateType = users.LoginID + "添加了日程管理"; //LogManage.AddSystemLog(operateName, operateTime, operateType); Response.Redirect("SelectCalender.aspx"); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加失败!');</script>"); } }
private void btnSearchCalendar_Click(object sender, EventArgs e) { var searchForm = new CalendarSearch(); var result = searchForm.ShowDialog(); if (result == DialogResult.OK) { this._calendar = searchForm.Result; this.txtCalendar.Text = searchForm.Result.Description; } }
public UserCalendarTerminalUpdate(UserCalendarTerminal entity) { InitializeComponent(); this._calendar = entity.Calendar; this._terminal = entity.Terminal; this.Text = "Modificación de Configuración para el Usuario \"" + entity.UserProfileDescription + "\""; this.txtCalendar.Text = entity.CalendarDescription; this.txtTerminal.Text = entity.TerminalDescription; this.Result = entity; }
private void Bind() { Model.Calendar calendar = BLL.WorkHelper.CalendarManager.GetAllCalendarByID(Id); this.txFDate.Text = Convert.ToString(calendar.TransactTime); this.txtRemind.Text = Convert.ToString(calendar.RemaindTime); if (calendar.Repeat.Trim() == "是") { this.rdoRepeat.SelectedValue = "是"; } else { this.rdoRepeat.SelectedValue = "否"; } this.dropType.SelectedValue = calendar.CalType; this.txName.Value = calendar.CalTheme; this.txDes.Value = calendar.CalContent; }
public CalendarUpdate(Calendar entity = null) { InitializeComponent(); if (entity == null) { this.Text = "Alta de Calendarios"; dtpStartTime.Enabled = false; dtpEndTime.Enabled = false; dtpStartDate.Enabled = false; dtpEndDate.Enabled = false; chkMonday.Enabled = false; chkTuesday.Enabled = false; chkWednesday.Enabled = false; chkThursday.Enabled = false; chkFriday.Enabled = false; chkSaturday.Enabled = false; chkSunday.Enabled = false; } else { this.Text = "Modificación de Calendario \"" + entity.ID + "\""; if (entity.StartTime != null && entity.EndTime != null) { chkTime.Checked = true; dtpStartTime.Value = entity.StartTime.Value; dtpEndTime.Value = entity.EndTime.Value; } else { dtpStartTime.Enabled = false; dtpEndTime.Enabled = false; } if (entity.StartDate != null && entity.EndDate != null) { chkDate.Checked = true; dtpStartDate.Value = entity.StartDate.Value; dtpEndDate.Value = entity.EndDate.Value; } else { dtpStartDate.Enabled = false; dtpEndDate.Enabled = false; } if (entity.OnMonday != null && entity.OnTuesday != null && entity.OnWednesday != null && entity.OnThursday != null && entity.OnFriday != null && entity.OnSaturday != null && entity.OnSunday != null) { chkDays.Checked = true; chkMonday.Checked = entity.OnMonday.Value; chkTuesday.Checked = entity.OnTuesday.Value; chkWednesday.Checked = entity.OnWednesday.Value; chkThursday.Checked = entity.OnThursday.Value; chkFriday.Checked = entity.OnFriday.Value; chkSaturday.Checked = entity.OnSaturday.Value; chkSunday.Checked = entity.OnSunday.Value; } else { chkMonday.Enabled = false; chkTuesday.Enabled = false; chkWednesday.Enabled = false; chkThursday.Enabled = false; chkFriday.Enabled = false; chkSaturday.Enabled = false; chkSunday.Enabled = false; } } this.Result = entity ?? new Calendar(); }