protected void btnCapNhatChiTieuMauBieu_Click(object sender, DirectEventArgs e) { daChiTieuMauBieu dCTMB = new daChiTieuMauBieu(); dCTMB.CTMB.IDMauBieu = IDmauBieu; dCTMB.CTMB.IDChiTieu = IDChiTieu; try { dCTMB.CTMB.ThuTu = ThuTu; } catch { } try { dCTMB.CTMB.InDam = InDam; } catch { dCTMB.CTMB.InDam = false; } try { dCTMB.CTMB.InNghieng = InNghieng; } catch { dCTMB.CTMB.InNghieng = false; } try { dCTMB.CTMB.STTsx = STTsx; } catch { dCTMB.CTMB.STTsx = 0; } try { dCTMB.CTMB.NhapTay = NhapTay; } catch { dCTMB.CTMB.NhapTay = false; } dCTMB.ThemSua(); X.Msg.Alert("", "Anh/chị đã cập nhật thành công thông tin chỉ tiêu!").Show(); }
public void Edit(int id, string field, string oldvalue, string newvalue, object BangCTMB) { daChiTieuMauBieu dCTMB = new daChiTieuMauBieu(); dCTMB.CTMB.IDMauBieu = int.Parse(cboBieuBaoCao.SelectedItem.Value); dCTMB.CTMB.IDChiTieu = id; Newtonsoft.Json.Linq.JObject node = JSON.Deserialize <Newtonsoft.Json.Linq.JObject>(BangCTMB.ToString()); try { dCTMB.CTMB.ThuTu = node.Property("ThuTu").Value.ToString(); } catch { } try { dCTMB.CTMB.InDam = Boolean.Parse(node.Property("InDam").Value.ToString()); } catch { dCTMB.CTMB.InDam = false; } try { dCTMB.CTMB.InNghieng = Boolean.Parse(node.Property("InNghieng").Value.ToString()); } catch { dCTMB.CTMB.InNghieng = false; } try { dCTMB.CTMB.STTsx = Decimal.Parse(node.Property("STTsx").Value.ToString()); } catch { dCTMB.CTMB.STTsx = 0; } try { dCTMB.CTMB.NhapTay = Boolean.Parse(node.Property("NhapTay").Value.ToString()); } catch { dCTMB.CTMB.NhapTay = false; } dCTMB.ThemSua(); grdChiTieuMB.GetStore().GetById(id).Commit(); }