protected void Page_Load(object sender, EventArgs e) { string _action = MXRequest.GetQueryString("action"); int id = 0; if (!string.IsNullOrEmpty(_action) && _action == MXEnums.ActionEnum.Edit.ToString()) { this.action = MXEnums.ActionEnum.Edit.ToString();//修改类型 if (!int.TryParse(Request.QueryString["id"] as string, out id)) { JscriptMsg("传输参数不正确!", "back", "Error"); return; } if (!_service.Exists(id)) { JscriptMsg("记录不存在或已被删除!", "back", "Error"); return; } } if (!Page.IsPostBack) { if (action == MXEnums.ActionEnum.Edit.ToString()) //修改 { ShowInfo(id); } else { txtbeginDate.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); txtendDate.Text = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd HH:mm:ss"); } } }