// 单个删除 protected void lbtnDelCa_Click(object sender, EventArgs e) { // 当前点击的按钮 LinkButton lb = (LinkButton)sender; int caId = int.Parse(lb.CommandArgument); tbl_sinkia_attribute bll = new tbl_sinkia_attribute(); bll.GetModel(caId); string attribute_name = bll.attribute_name; tbl_product bllpp = new tbl_product(); bllpp.pro_level = caId; if (!bllpp.Existsshuxing())//查找是否存在下级商品 { bll.Delete(caId); mym.JscriptMsg(this.Page, " 成功删除属性:" + attribute_name + "", Utils.CombUrlTxt("pro_attribute_list.aspx", "keywords={0}&page={1}", this.keywords, this.page.ToString()), "Success"); } else { mym.JscriptMsg(this.Page, "有商品属于该商品属性,不能删除!", "", "Error"); return; } }
private void ShowInfo(int _id) { tbl_sinkia_attribute model = new tbl_sinkia_attribute(); model.GetModel(_id); txttitle.Text = model.attribute_name; attribute_value.Text = model.attribute_value; // txtSortId.Text = model.sort_id.ToString(); }
private bool DoEdit(int _id) { bool result = false; tbl_sinkia_attribute model = new tbl_sinkia_attribute(); model.GetModel(_id); model.attribute_name = txttitle.Text.Trim(); model.attribute_value = attribute_value.Text.Trim(); if (model.Update()) { // mym.AddAdminLog("修改", "修改商品类别:" + txttitle.Text); //记录日志 result = true; } return(result); }