コード例 #1
0
        private void Save()
        {
            // Save data
            int toDoId = Int32.Parse(hdfToDoId.Value);

            DateTime? newDueDate = null; if (tkrdpDueDate.SelectedDate.HasValue) newDueDate = tkrdpDueDate.SelectedDate;
            int? newUnitId = null; if (ddlUnit.SelectedValue != "-1") newUnitId = Int32.Parse(ddlUnit.SelectedValue);

            // Insert to dataset
            ToDoListInformationBasicInformation toDoListInformationBasicInformation = new ToDoListInformationBasicInformation(toDoListInformationTDS);
            toDoListInformationBasicInformation.Update(toDoId, newDueDate, newUnitId);

            // Store datasets
            Session["toDoListInformationTDS"] = toDoListInformationTDS;

            // Update database
            UpdateDatabase();

            ViewState["update"] = "yes";

            // Redirect
            string url = "";
            if (Request.QueryString["source_page"] == "toDoList_navigator2.aspx")
            {
                url = "./toDoList_navigator2.aspx?source_page=toDoList_edit.aspx&toDo_id=" + hdfToDoId.Value  + GetNavigatorState() + "&update=yes";
            }

            if (Request.QueryString["source_page"] == "toDoList_summary.aspx")
            {
                url = "./toDoList_summary.aspx?source_page=toDoList_edit.aspx&toDo_id=" + hdfToDoId.Value + "&dashboard=" + hdfDashboard.Value  + GetNavigatorState() + "&update=yes";
            }

            Response.Redirect(url);
        }
コード例 #2
0
        private void Apply()
        {
            // Save data
            int toDoId = Int32.Parse(hdfToDoId.Value);

            DateTime? newDueDate = null; if (tkrdpDueDate.SelectedDate.HasValue) newDueDate = tkrdpDueDate.SelectedDate;
            int? newUnitId = null; if (ddlUnit.SelectedValue != "-1") newUnitId = Int32.Parse(ddlUnit.SelectedValue);

            // Insert to dataset
            ToDoListInformationBasicInformation toDoListInformationBasicInformation = new ToDoListInformationBasicInformation(toDoListInformationTDS);
            toDoListInformationBasicInformation.Update(toDoId, newDueDate, newUnitId);

            // Store datasets
            Session["toDoListInformationTDS"] = toDoListInformationTDS;

            // Update database
            UpdateDatabase();

            ViewState["update"] = "yes";
        }