protected void btnUpdateGroup_Click(object sender, DirectEventArgs e) { try { bool isSuccess = false; if (e.ExtraParams["Command"] == "Update") { isSuccess = new DALController().Update(wdThemNhomTaiSan, "DM_NHOM_VTHH", hdfNodeID.Text); } else { isSuccess = new DALController().Add(wdThemNhomTaiSan, "DM_NHOM_VTHH"); } if (isSuccess) { Dialog.ShowNotification("Cập nhật thành công"); wdThemNhomTaiSan.Hide(); RM.RegisterClientScriptBlock("RefreshTree", "refreshTree(#{treeFortuneGroup});Storecb_MA_NHOM_VTHH.reload();btnEditGroup.disable();btnDeleteGroup.disable();"); } } catch (SqlException sqlEx) { if (sqlEx.Number == ErrorNumber.DUPLICATE_PRIMARY_KEY) { X.Msg.Alert("Có lỗi xảy ra", "Mã nhóm tài sản bị trùng, hãy nhập mã khác").Show(); } } catch (Exception ex) { X.Msg.Alert("Có lỗi xảy ra", ex.Message.ToString()).Show(); } }
public static DALController GetInstance() { if (Instance == null) { Instance = new DALController(); } return(Instance); }
protected DALObj(DALController controller) { Controller = controller; }