public override void Delete() { if (bdsResource.Position < 0) { return; } DataRow drCurrent = ((DataRowView)bdsResource.Current).Row; if (!Common.MsgYes_No(Languages.GetLanguage("SURE_DELETE"))) { return; } if (DataTool.SQLDelete("SYSRESOURCES", drCurrent)) { //Cập nhật History htHistory["CODE"] = drCurrent[strCode]; htHistory["NAME"] = drCurrent[strName]; htHistory["UPDATE_TYPE"] = "D"; Epoint.Lists.frmView frm = new Lists.frmView(); frm.UpdateHistory(); bdsResource.RemoveAt(bdsResource.Position); dtResource.AcceptChanges(); } }
public override void Delete() { if (bdsResource.Position < 0) { return; } DataRow drCurrent = ((DataRowView)bdsResource.Current).Row; if ((Boolean)drCurrent["IsZaloSend"]) { EpointMessage.MsgOk("Tin đã gửi không thể xóa"); return; } if (Convert.ToInt32(SQLExec.ExecuteReturnValue("SP_HRM_CHECKParent '" + drCurrent["File_ID"].ToString() + "'")) > 0) { EpointMessage.MsgOk("Không thể xóa nhóm cha !"); return; } if (!Common.MsgYes_No(Languages.GetLanguage("SURE_DELETE"))) { return; } if (DataTool.SQLDelete("ZALORESOURCES", drCurrent)) { //Cập nhật History htHistory["CODE"] = drCurrent[strCode]; htHistory["NAME"] = drCurrent[strName]; htHistory["UPDATE_TYPE"] = "D"; Epoint.Lists.frmView frm = new Lists.frmView(); frm.UpdateHistory(); bdsResource.RemoveAt(bdsResource.Position); dtResource.AcceptChanges(); } }
public override void Edit(enuEdit enuNew_Edit) { if (bdsResource.Position < 0 && enuNew_Edit == enuEdit.Edit) { return; } //Copy hang hien tai if (bdsResource.Position >= 0) { Common.CopyDataRow(((DataRowView)bdsResource.Current).Row, ref drCurrent); } else { drCurrent = dtResource.NewRow(); } frmResource_Edit frmEdit = new frmResource_Edit(); frmEdit.Load(enuNew_Edit, drCurrent); //Người dùng chọn chấp nhận if (frmEdit.isAccept) { //Cập nhật History DataRow drHistory = drCurrent; htHistory["CODE"] = drHistory[strCode]; htHistory["NAME"] = drHistory[strName]; if (enuNew_Edit == enuEdit.New) { htHistory["UPDATE_TYPE"] = "N"; Epoint.Lists.frmView frm = new Lists.frmView(); frm.UpdateHistory(); } else if (enuNew_Edit == enuEdit.Edit && ((string)drHistory[strCode] != (string)((DataRowView)bdsResource.Current)[strCode] || (string)drHistory[strName] != (string)((DataRowView)bdsResource.Current)[strName])) { htHistory["UPDATE_TYPE"] = "E"; htHistory["CODE_OLD"] = ((DataRowView)bdsResource.Current)[strCode]; htHistory["NAME_OLD"] = ((DataRowView)bdsResource.Current)[strName]; Epoint.Lists.frmView frm = new Lists.frmView(); frm.UpdateHistory(); } //Cập nhật dữ liệu danh mục if (enuNew_Edit == enuEdit.New) { if (bdsResource.Position >= 0) { dtResource.ImportRow(drCurrent); } else { dtResource.Rows.Add(drCurrent); } bdsResource.Position = bdsResource.Find("FILE_ID", drCurrent["FILE_ID"]); } else { Common.CopyDataRow(drCurrent, ((DataRowView)bdsResource.Current).Row); } dtResource.AcceptChanges(); } //else // dtResource.RejectChanges(); }