Example #1
0
 protected void JqgridNews_RowAdding(object sender, Trirand.Web.UI.WebControls.JQGridRowAddEventArgs e)
 {
     using (var dc = ThaitaeDataDataContext.Create())
     {
         var news = new New
                 {
                     newsContent = e.RowData["newsContent"],
                     newsTopic = e.RowData["newsTopic"],
                     newsType = Convert.ToInt32(e.RowData["NewsTypeName"])
                 };
         dc.News.InsertOnSubmit(news);
         dc.SubmitChanges();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Request.QueryString["newsId"])) return;
     var newsId = Convert.ToInt32(Request.QueryString["newsId"]);
     SelectedNews = NewsHelper.SelectedNews(newsId);
 }
 partial void UpdateNew(New instance);
 partial void DeleteNew(New instance);
 partial void InsertNew(New instance);