Example #1
0
    protected void btnXoa_Click(object sender, EventArgs e)
    {
        ctl_newbuilding cls;
        List <object>   selectedKey = grvList.GetSelectedFieldValues(new string[] { "collection_id" });

        if (selectedKey.Count > 0)
        {
            foreach (var item in selectedKey)
            {
                cls = new ctl_newbuilding();
                tbCollectionImage checkImage = (from i in db.tbCollectionImages where i.collection_id == Convert.ToInt32(item) select i).SingleOrDefault();
                if (cls.Linq_xoa(Convert.ToInt32(item)))
                {
                    alert.alert_Success(Page, "Xóa thành công", "");
                    loadData();
                }
                else
                {
                    alert.alert_Error(Page, "Xóa thất bại", "");
                }
            }
        }
        else
        {
            alert.alert_Warning(Page, "Bạn chưa chọn dữ liệu", "");
        }
    }