Пример #1
0
        protected void lnkAddCheckUp_Click(object sender, EventArgs e)
        {
            DateTime checkupDate = DateTime.MinValue;

            DateTime.TryParse(txtCheckUpDate.Text, out checkupDate);
            if (!Equals(checkupDate, DateTime.MinValue))
            {
                CheckUpRepository checkUpManager = new CheckUpRepository();
                var nCheckUp = new CheckUp();
                nCheckUp.TeamId         = Convert.ToInt32(ddlTeam.SelectedValue);
                nCheckUp.TeamMemberId   = Convert.ToInt32(ddlMember.SelectedValue);
                nCheckUp.Method         = ddlMethod.SelectedItem.Text;
                nCheckUp.CheckUpDate    = checkupDate;
                nCheckUp.Outcome        = txtOutCome.Text;
                nCheckUp.RequiresAction = chkActionRequired.Checked;
                nCheckUp.Actions        = txtFollowUpAction.Text;

                checkUpManager.Add(nCheckUp);
                checkUpManager.Save();
                //((SiteMaster)Page.Master).AddNotification(Page, "Check Up Added Successful", "Check Up for " + ddlMember.SelectedItem.Text + " was added.","function(){window.location = '" + Page.ResolveUrl("~/home.aspx?Team=" + nCheckUp.TeamId) + "';}");
                Response.Redirect("~/home.aspx?Team=" + nCheckUp.TeamId);
            }
        }