Beispiel #1
0
        protected void lnkAddCheckUp_Click(object sender, EventArgs e)
        {
            DateTime checkupDate = DateTime.MinValue;

            DateTime.TryParse(txtCheckUpDate.Text, out checkupDate);
            var btn = sender as LinkButton;

            if (!Equals(checkupDate, DateTime.MinValue))
            {
                var nCheckUp = btn.CommandName == "New" ? new CheckUp() : checkUpManager.FindBy(Convert.ToInt32(btn.CommandArgument));
                if (nCheckUp.CheckUpId == 0)
                {
                    nCheckUp.TeamId       = Convert.ToInt32(txtTeamId.Value);
                    nCheckUp.TeamMemberId = Convert.ToInt32(txtMemberId.Value);
                }
                nCheckUp.Method         = ddlMethod.SelectedItem.Text;
                nCheckUp.CheckUpDate    = checkupDate;
                nCheckUp.Outcome        = txtOutcome.Text;
                nCheckUp.RequiresAction = chkActionRequired.Checked;
                nCheckUp.Actions        = txtActions.Text;
                if (nCheckUp.CheckUpId == 0)
                {
                    checkUpManager.Add(nCheckUp);
                    ((SiteMaster)Page.Master).AddNotification(Page, "Check Up Added Successful", "Check Up for " + ddlMembers.SelectedItem.Text + " was added.");
                }
                else
                {
                    checkUpManager.Update(nCheckUp);
                    ((SiteMaster)Page.Master).AddNotification(Page, "Check Up Updated Successful", "Check Up for " + ddlMembers.SelectedItem.Text + " was updated.");
                }
                checkUpManager.Save();

                LoadCheckUps(null, Convert.ToInt32(ddlTeams.SelectedValue), Convert.ToInt32(ddlMembers.SelectedValue));
            }
        }
Beispiel #2
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);
            }
        }