private void SaveNewsCat() { string strLink = ""; try { int i = 0; HtmlInputCheckBox check = new HtmlInputCheckBox(); var gcdel = (from gp in DB.ESHOP_NEWS_CATs where gp.NEWS_ID == m_news_id select gp); DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel); foreach (RepeaterItem item in rptList.Items) { check = new HtmlInputCheckBox(); check = (HtmlInputCheckBox)item.FindControl("chkSelect"); Label lblID = (Label)item.FindControl("lblID"); if (check.Checked) { int _Id = Utils.CIntDef(lblID.Text, 0); ESHOP_NEWS_CAT grinsert = new ESHOP_NEWS_CAT(); grinsert.CAT_ID = _Id; grinsert.NEWS_ID = m_news_id; DB.ESHOP_NEWS_CATs.InsertOnSubmit(grinsert); } i++; } DB.SubmitChanges(); strLink = "news.aspx?news_id=" + m_news_id; } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { if (!string.IsNullOrEmpty(strLink)) { Response.Redirect(strLink); } } }
private void SaveNewsCategory(int NewsId) { try { ESHOP_NEWS_CAT nc = new ESHOP_NEWS_CAT(); nc.CAT_ID = Utils.CIntDef(ddlCategory.SelectedValue); nc.NEWS_ID = NewsId; DB.ESHOP_NEWS_CATs.InsertOnSubmit(nc); DB.SubmitChanges(); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } }
private void SaveNewsCat() { string strLink = ""; try { HtmlInputCheckBox check = new HtmlInputCheckBox(); var gcdel = (from gp in DB.ESHOP_NEWS_CATs where gp.NEWS_ID == m_news_id select gp); DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel); for (int i = 0; i < Rplistcate.Items.Count; i++) { check = new HtmlInputCheckBox(); check = (HtmlInputCheckBox)Rplistcate.Items[i].FindControl("chkSelect"); HiddenField Hdid = Rplistcate.Items[i].FindControl("Hdcatid") as HiddenField; int _catid = Utils.CIntDef(Hdid.Value); if (check.Checked) { ESHOP_NEWS_CAT grinsert = new ESHOP_NEWS_CAT(); grinsert.CAT_ID = _catid; grinsert.NEWS_ID = m_news_id; DB.ESHOP_NEWS_CATs.InsertOnSubmit(grinsert); } } DB.SubmitChanges(); strLink = "news.aspx?type=" + _type + "&news_id=" + m_news_id; } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { if (!string.IsNullOrEmpty(strLink)) { Response.Redirect(strLink); } } }
private void SaveNewsCat() { string strLink = ""; try { HtmlInputCheckBox check = new HtmlInputCheckBox(); var gcdel = (from gp in DB.ESHOP_NEWS_CATs where gp.NEWS_ID == m_news_id select gp); DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel); for (int i = 0; i < Rplistcate.Items.Count; i++) { check = new HtmlInputCheckBox(); check = (HtmlInputCheckBox)Rplistcate.Items[i].FindControl("chkSelect"); HiddenField Hdid = Rplistcate.Items[i].FindControl("Hdcatid") as HiddenField; int _catid = Utils.CIntDef(Hdid.Value); if (check.Checked) { ESHOP_NEWS_CAT grinsert = new ESHOP_NEWS_CAT(); grinsert.CAT_ID = _catid; grinsert.NEWS_ID = m_news_id; DB.ESHOP_NEWS_CATs.InsertOnSubmit(grinsert); } } DB.SubmitChanges(); strLink = "news.aspx?news_id=" + m_news_id; } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { if (!string.IsNullOrEmpty(strLink)) Response.Redirect(strLink); } }
private void Save() { if (Session["lnewsid"] != null) { List <string> lid = (List <string>)Session["lnewsid"]; var gcdel = (from gp in DB.ESHOP_NEWS_CATs where lid.Contains(gp.NEWS_ID.ToString()) select gp); DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel); int _catid = Utils.CIntDef(ddlCategory.SelectedValue); foreach (string item in lid) { ESHOP_NEWS_CAT news_cat = new ESHOP_NEWS_CAT(); news_cat.NEWS_ID = Utils.CIntDef(item); news_cat.CAT_ID = _catid; DB.ESHOP_NEWS_CATs.InsertOnSubmit(news_cat); } DB.SubmitChanges(); } }
private void Save() { if (Session["lnewsid"] != null) { List<string> lid = (List<string>)Session["lnewsid"]; var gcdel = (from gp in DB.ESHOP_NEWS_CATs where lid.Contains(gp.NEWS_ID.ToString()) select gp); DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel); int _catid = Utils.CIntDef(ddlCategory.SelectedValue); foreach (string item in lid) { ESHOP_NEWS_CAT news_cat = new ESHOP_NEWS_CAT(); news_cat.NEWS_ID = Utils.CIntDef(item); news_cat.CAT_ID = _catid; DB.ESHOP_NEWS_CATs.InsertOnSubmit(news_cat); } DB.SubmitChanges(); } }
private void SaveNewsCat() { string strLink = ""; try { int i = 0; HtmlInputCheckBox check = new HtmlInputCheckBox(); var gcdel = (from gp in DB.ESHOP_NEWS_CATs where gp.NEWS_ID == m_news_id select gp); DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel); foreach (DataGridItem item in GridItemList.Items) { check = new HtmlInputCheckBox(); check = (HtmlInputCheckBox)item.Cells[1].FindControl("chkSelect"); if (check.Checked) { ESHOP_NEWS_CAT grinsert = new ESHOP_NEWS_CAT(); grinsert.CAT_ID = Utils.CIntDef(GridItemList.DataKeys[i]); grinsert.NEWS_ID = m_news_id; DB.ESHOP_NEWS_CATs.InsertOnSubmit(grinsert); } i++; } DB.SubmitChanges(); strLink = "news.aspx?news_id=" + m_news_id + "&type=" + _cat_type; } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { if (!string.IsNullOrEmpty(strLink)) Response.Redirect(strLink); } }
private void SaveNewsCat() { string strLink = ""; try { int i = 0; HtmlInputCheckBox check = new HtmlInputCheckBox(); var gcdel = (from gp in DB.ESHOP_NEWS_CATs where gp.NEWS_ID == m_news_id select gp); DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel); foreach (RepeaterItem item in rptList.Items) { check = new HtmlInputCheckBox(); check = (HtmlInputCheckBox)item.FindControl("chkSelect"); Label lblID = (Label)item.FindControl("lblID"); if (check.Checked) { int _Id = Utils.CIntDef(lblID.Text, 0); ESHOP_NEWS_CAT grinsert = new ESHOP_NEWS_CAT(); grinsert.CAT_ID = _Id; grinsert.NEWS_ID = m_news_id; DB.ESHOP_NEWS_CATs.InsertOnSubmit(grinsert); } i++; } DB.SubmitChanges(); strLink = "news.aspx?news_id=" + m_news_id; } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } finally { if (!string.IsNullOrEmpty(strLink)) Response.Redirect(strLink); } }
private void SaveNewsCategory(int NewsId, int _catid) { try { ESHOP_NEWS_CAT nc = new ESHOP_NEWS_CAT(); nc.CAT_ID = _catid; nc.NEWS_ID = NewsId; DB.ESHOP_NEWS_CATs.InsertOnSubmit(nc); DB.SubmitChanges(); } catch (Exception ex) { clsVproErrorHandler.HandlerError(ex); } }