protected void lbtThem_Click(object sender, EventArgs e) { string error = ""; ChuyenMucClass cmc = new ChuyenMucClass(); if (txtTenChuyenMuc.Text == "") { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Bạn chưa nhập tên chuyên mục');", true); } else { cmc.Category_Edit(0, int.Parse("0" + drChuyenMucChaEdit.SelectedValue), txtTenChuyenMuc.Text + "", txtLink.Text + "", ref error); if (error + "" != "") { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('" + error + "');", true); LoadGridChuyenMuc(0); ResetForm(); LoadDropChuyenMuc(drChuyenMucChaEdit, 0); } } cmc = null; }
private void LuuCM(int cateid) { string error = ""; ChuyenMucClass cmc = new ChuyenMucClass(); if (txtTenChuyenMuc.Text + "" == "") { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('Bạn chưa nhập tên cho chuyên mục');", true); } else { cmc.Category_Edit(cateid, int.Parse("0" + drChuyenMucChaEdit.SelectedValue), txtTenChuyenMuc.Text + "", txtLink.Text, ref error); if (error + "" != "") { ScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "alert('" + error + "');", true); LoadGridChuyenMuc(0); ResetForm(); LoadDropChuyenMuc(drChuyenMuc, 0); LoadDropChuyenMuc(drChuyenMucChaEdit, 0); } } cmc = null; }