public bool QuanLyMeNu_Insert(Entity.QuanLyMeNu Data) { try { using (SqlCommand dbCmd = new SqlCommand("sp_QuanLyMeNu_Insert", GetConnection())) { dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.Add(new SqlParameter("@TenMenu", Data.TenMenu)); dbCmd.Parameters.Add(new SqlParameter("@Active", Data.Active)); dbCmd.Parameters.Add(new SqlParameter("@Type", Data.Type)); dbCmd.Parameters.Add(new SqlParameter("@Ord", Data.Ord)); dbCmd.Parameters.Add(new SqlParameter("@Level", Data.Level)); dbCmd.Parameters.Add(new SqlParameter("@Link", Data.Link)); dbCmd.Parameters.Add(new SqlParameter("@TypeClick", Data.TypeClick)); dbCmd.Parameters.Add(new SqlParameter("@Icon", Data.Icon)); //dbCmd.Parameters.Add(new SqlParameter("@HinhThucThanhToan", Data.HinhThucThanhToan)); dbCmd.ExecuteNonQuery(); } //Clear cache System.Web.HttpContext.Current.Cache.Remove("QuanLyMeNu"); return(true); } catch { return(false); } }
public List <QuanLyMeNu> QuanLyMeNu_GetByTop(string Top, string Where, string Order) { List <Entity.QuanLyMeNu> list = new List <Entity.QuanLyMeNu>(); using (SqlCommand dbCmd = new SqlCommand("sp_QuanLyMeNu_GetByTop", GetConnection())) { Entity.QuanLyMeNu obj = new Entity.QuanLyMeNu(); dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.Add(new SqlParameter("@Top", Top)); dbCmd.Parameters.Add(new SqlParameter("@Where", Where)); dbCmd.Parameters.Add(new SqlParameter("@Order", Order)); SqlDataReader dr = dbCmd.ExecuteReader(); dr.Close(); dr = dbCmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { list.Add(obj.QuanLyMeNuIDataReader(dr)); } } dr.Close(); obj = null; } return(list); }
protected void btnSave_Top_Click(object sender, EventArgs e) { Entity.QuanLyMeNu dt = new Entity.QuanLyMeNu(); if (insert == true) { dt.TenMenu = txtTenMenu.Text; dt.Type = txtType.Text; dt.Ord = txtOrd.Text; dt.Level = txtLevel.Text; dt.Link = txtLink.Text; dt.TypeClick = cmbTypeClick.SelectedValue.ToString(); dt.Icon = txtIcon.Text; dt.Active = chkActive.Checked == true ? "True" : "False"; QuanLyMeNuService.QuanLyMeNu_Insert(dt); getData(); } else { dt.ID = txtID.Text; dt.TenMenu = txtTenMenu.Text; dt.Type = txtType.Text; dt.Ord = txtOrd.Text; dt.Level = txtLevel.Text; dt.Link = txtLink.Text; dt.TypeClick = cmbTypeClick.SelectedValue.ToString(); dt.Icon = txtIcon.Text; dt.Active = chkActive.Checked == true ? "True" : "False"; QuanLyMeNuService.QuanLyMeNu_Update(dt); getData(); } insert = true; pnData.Visible = true; pnInfo.Visible = false; ClearText(); }
public Entity.QuanLyMeNu QuanLyMeNuIDataReader(IDataReader dr) { Entity.QuanLyMeNu obj = new Entity.QuanLyMeNu(); obj.ID = (dr["ID"] is DBNull) ? string.Empty : dr["ID"].ToString(); obj.TenMenu = (dr["TenMenu"] is DBNull) ? string.Empty : dr["TenMenu"].ToString(); obj.Type = (dr["Type"] is DBNull) ? string.Empty : dr["Type"].ToString(); obj.Ord = (dr["Ord"] is DBNull) ? string.Empty : dr["Ord"].ToString(); obj.Level = (dr["Level"] is DBNull) ? string.Empty : dr["Level"].ToString(); obj.Link = (dr["Link"] is DBNull) ? string.Empty : dr["Link"].ToString(); obj.TypeClick = (dr["TypeClick"] is DBNull) ? string.Empty : dr["TypeClick"].ToString(); obj.Icon = (dr["Icon"] is DBNull) ? string.Empty : dr["Icon"].ToString(); obj.Active = (dr["Active"] is DBNull) ? string.Empty : dr["Active"].ToString(); return(obj); }
public static bool QuanLyMeNu_Update(Entity.QuanLyMeNu data) { return cmb.QuanLyMeNu_Update(data); }
public static bool QuanLyMeNu_Insert(Entity.QuanLyMeNu data) { return cmb.QuanLyMeNu_Insert(data); }