コード例 #1
0
        protected void btnSaveArticle_Click(object sender, EventArgs e)
        {
            Article ac = new Article();

            ac.UserName = HttpContext.Current.User.Identity.Name;
            ac.DurationId = dm.getDurationId();

            ac.ArticleName = txtArticleName.Text;
            ac.PublishTypeId = Convert.ToInt32(ddPublishType.SelectedValue);
            if(CheckBox1.Checked){
                ac.ResearchId = Convert.ToInt32(ddResearchRefer.SelectedValue);
            }
            ac.Description = txtDesc.Text;

            db.Articles.InsertOnSubmit(ac);
            db.SubmitChanges();
        }
コード例 #2
0
		private void detach_Articles(Article entity)
		{
			this.SendPropertyChanging();
			entity.Research = null;
		}
コード例 #3
0
 partial void DeleteArticle(Article instance);
コード例 #4
0
		private void attach_Articles(Article entity)
		{
			this.SendPropertyChanging();
			entity.Research = this;
		}
コード例 #5
0
 partial void UpdateArticle(Article instance);
コード例 #6
0
 partial void InsertArticle(Article instance);
コード例 #7
0
		private void detach_Articles(Article entity)
		{
			this.SendPropertyChanging();
			entity.PublishType = null;
		}
コード例 #8
0
        protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            Article ac = new Article();

            ac.ArticleId = Convert.ToInt32(((HiddenField)ASPxGridView2.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView2.Columns["ArticleName"], "hidEditId")).Value);
            ac.ArticleName = ((TextBox)ASPxGridView2.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView2.Columns["ArticleName"], "txtEditArticleName")).Text;
            ac.PublishTypeId = Convert.ToInt32(((ASPxComboBox)ASPxGridView2.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView2.Columns["PublishTypeId"], "ddEditPublishTypeId")).Value);
            ac.ResearchId = Convert.ToInt32(((ASPxComboBox)ASPxGridView2.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView2.Columns["ResearchName"], "ddEditResearchId")).Value);

            dll_Research_Article dll = new dll_Research_Article(username, dr.getDurationId());
            dll.updateData(ac);
            this.ASPxGridView2.CancelEdit();
            e.Cancel = true;
            FillGridView2();
        }
コード例 #9
0
        protected void ASPxGridView2_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            Article ac = new Article();

            ac.UserName = username;
            ac.DurationId = durationId;

            ac.ArticleName = ((TextBox)ASPxGridView2.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView2.Columns["ArticleName"], "txtEditArticleName")).Text;
            ac.PublishTypeId = Convert.ToInt32(((ASPxComboBox)ASPxGridView2.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView2.Columns["PublishTypeId"], "ddEditPublishTypeId")).Value);
            ac.ResearchId = Convert.ToInt32(((ASPxComboBox)ASPxGridView2.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView2.Columns["ResearchId"], "ddEditResearchId")).Value);

            dll_Research_Article dll = new dll_Research_Article(username, durationId);
            dll.insertData(ac);
            e.Cancel = true;
            ASPxGridView2.CancelEdit();
            FillGridView2();
        }