private void bindCatalog() { QJVRMS.Business.KeyWords obj = new QJVRMS.Business.KeyWords(); DataSet ds = obj.GetKeywordsByParentid(0); this.grvKeyCatalog.DataSource = ds.Tables[0].DefaultView; this.grvKeyCatalog.DataBind(); }
protected void grvKeyCatalog_RowDeleting(object sender, GridViewDeleteEventArgs e) { int id = Convert.ToInt32(this.grvKeyCatalog.DataKeys[e.RowIndex].Value.ToString()); QJVRMS.Business.KeyWords obj = new QJVRMS.Business.KeyWords(); obj.Delete(id); this.bindCatalog(); }
private void bind() { int parentId = Convert.ToInt32(this.hId.Value); QJVRMS.Business.KeyWords obj = new QJVRMS.Business.KeyWords(); DataSet ds = obj.GetKeywordsByParentid(parentId); this.rptKey.DataSource = ds.Tables[0].DefaultView; this.rptKey.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { string txtName = this.txtName.Text.Trim().Replace("'", "''"); string txtOrder = this.txtOrder.Text.Trim(); int sort; int.TryParse(txtOrder, out sort); QJVRMS.Business.KeyWords obj = new QJVRMS.Business.KeyWords(); obj.Add(0, txtName, sort); bindCatalog(); }
protected void btnSave_Click(object sender, EventArgs e) { string txtName = this.txtName.Text.Trim().Replace("'", "''"); //string txtOrder = this.txtOrder.Text.Trim(); int sort = 1; //int.TryParse(txtOrder, out sort); int parentId = Convert.ToInt32(this.hId.Value); QJVRMS.Business.KeyWords obj = new QJVRMS.Business.KeyWords(); obj.Add(parentId, txtName, sort); bind(); }
protected void btnSave_Click(object sender, EventArgs e) { string txtName = this.txtName.Text.Trim().Replace("'", "''"); //string txtOrder = this.txtOrder.Text.Trim(); int sort=1; //int.TryParse(txtOrder, out sort); int parentId = Convert.ToInt32(this.hId.Value); QJVRMS.Business.KeyWords obj = new QJVRMS.Business.KeyWords(); obj.Add(parentId, txtName, sort); bind(); }
protected void grvKeyCatalog_RowUpdating(object sender, GridViewUpdateEventArgs e) { string keyword = ((TextBox)(this.grvKeyCatalog.Rows[e.RowIndex].Cells[0].Controls[0])).Text.ToString().Trim().Replace("'", "''"); int sort; int.TryParse(((TextBox)(this.grvKeyCatalog.Rows[e.RowIndex].Cells[1].Controls[0])).Text.ToString().Trim().Replace("'", "''"), out sort); int parentId = 0; int id = Convert.ToInt32(this.grvKeyCatalog.DataKeys[e.RowIndex].Value.ToString()); QJVRMS.Business.KeyWords obj = new QJVRMS.Business.KeyWords(); obj.UpdateById(id, parentId, keyword, sort); this.grvKeyCatalog.EditIndex = -1; this.bindCatalog(); }
protected void rptKey_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { if (e.CommandName.ToLower().Equals("del")) { int id; int.TryParse(e.CommandArgument.ToString(), out id); QJVRMS.Business.KeyWords obj = new QJVRMS.Business.KeyWords(); obj.Delete(id); bind(); } } }