Ejemplo n.º 1
0
        protected void btnAddComments_OnClick(object sender, EventArgs e)
        {
            var txtProspectCommentAdd = (TextBox)gvComments.FooterRow.FindControl("txtProspectCommentAdd");
            var ddlProspectCommentTypeAdd = (DropDownList)gvComments.FooterRow.FindControl("ddlProspectCommentTypeAdd");
            var ddlProspectStageIdAdd = (DropDownList)gvComments.FooterRow.FindControl("ddlProspectStageIDAdd");
            var ddlCommentSourcesAdd = (DropDownList)gvComments.FooterRow.FindControl("ddlCommentSourcesAdd");
            var txtLastActivityDate2Add = (TextBox)gvComments.FooterRow.FindControl("txtLastActivityDate2Add");
            var txtKeyPhraseAdd = (TextBox)gvComments.FooterRow.FindControl("txtKeyPhraseAdd");

            var dbContext = new ProspectDataContext();

            var dbProspectConversation = new ProspectConversation
            {
                ProspectId = Convert.ToInt32(spanProspectId.InnerText) ,
                ProspectComment = txtProspectCommentAdd.Text,
                ProspectCommentTypeID = Convert.ToInt32(ddlProspectCommentTypeAdd.SelectedValue),
                ProspectStageID = Convert.ToInt32(ddlProspectStageIdAdd.SelectedValue),
                ProspectCommentSourceID = Convert.ToInt32(ddlCommentSourcesAdd.SelectedValue),
                KeyPhrase = txtKeyPhraseAdd.Text,
                LastActivityDate = Convert.ToDateTime(txtLastActivityDate2Add.Text),
                CreatedByUserId = UserId
            };

            dbContext.ProspectConversations.InsertOnSubmit(dbProspectConversation);
            dbContext.SubmitChanges();

            BindListOfProspects(Convert.ToInt32(spanProspectId.InnerText));
            PopulateDropdownsProspectConversations();
        }
 partial void UpdateProspectConversation(ProspectConversation instance);
 partial void DeleteProspectConversation(ProspectConversation instance);
 partial void InsertProspectConversation(ProspectConversation instance);