示例#1
0
    private void SaveInformation()
    {
        SubmitClick = false;
        lblCustomMessage.Text = "";

        CoreLibrary.Comment.Controller controller = new CoreLibrary.Comment.Controller();
        Comment entComment = new Comment()
        {
            Email = tbxeMail.Text,
            Name = tbxName.Text,
            CompanyWorking = ddlCompany.SelectedValue,
            SupervisorRating = rblSupervisorRating.SelectedValue,
            CompanyOpinionRating = rblCompanyOpinionRating.SelectedValue,
            WorkEnviromentRating = rblWorkEnviromentRating.SelectedValue,
            GroupDirectorRating = rblGroupDirectorRating.SelectedValue,
            SecurityRating = rblSecurityAnswer.SelectedValue,
            Subject = tbxSubject.Text,
            CommentSuggestion = tbxComment.Text
        };
        if (controller.Save(entComment))
        {
            if (NewCommentSendMail(entComment))
                ScriptManager.RegisterStartupScript(this, this.GetType(), "GlobalAttributes", " alert('La información se envio correctamente');", true);
            else
                ScriptManager.RegisterStartupScript(this, this.GetType(), "GlobalAttributes", " alert('La información guarda correctamente, pero hubo problemas en el envio de correo');", true);
            //Response.Redirect("http://vamsaags.com/");
        }
    }
示例#2
0
 private void sentToForm(int IdComment)
 {
     CoreLibrary.Comment.Controller commentController = new CoreLibrary.Comment.Controller();
     Comment entComment = commentController.GetCommentByID(IdComment);
     lblCreatedOnDate.Text = entComment.CreatedOn.ToShortDateString();
     tbxeMail.Text = entComment.Email;
     tbxName.Text = entComment.Name;
     rblSupervisorRating.SelectedValue = entComment.SupervisorRating.ToString();
     rblCompanyOpinionRating.Text = entComment.CompanyOpinionRating.ToString();
     rblWorkEnviromentRating.SelectedValue = entComment.WorkEnviromentRating.ToString();
     tbxCompanyWorking.Text = entComment.CompanyWorking;
     rblGroupDirectorRating.Text = entComment.GroupDirectorRating.ToString();
     rblSecurityAnswer.SelectedValue = entComment.SecurityRating.ToString();
     tbxSubject.Text = entComment.Subject;
     tbxComment.Text = entComment.CommentSuggestion;
     commentController.MarkAsRead(IdComment);
 }