private void grdVehicleFee_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (_userInfo.UserPermission.Contains(ConstantInfo.PERMISSON_CAP_NHAT_THONG_CAU_HINH_TINH_PHI_PHUONG_TIEN) == false) { return; } try { if (grdVehicleFee.SelectedRows.Count == 1) { int vehicleTypeId = int.Parse(grdVehicleFee.SelectedRows[0].Cells["VehicleType"].Value.ToString()); int goodsTypeId = int.Parse(grdVehicleFee.SelectedRows[0].Cells["GoodsType"].Value.ToString()); tblVehicleFeeSetting vehicleFee = VehicleFeeSettingFactory.find(vehicleTypeId, goodsTypeId); if (vehicleFee == null) { MessageBox.Show("Không còn tồn tại loại biểu phí này, hãy tìm kiếm lại", "Lỗi đồng bộ dữ liệu", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } var updateForm = new FrmAddVehicleFeeSetting(_userInfo, 1, this, vehicleFee); updateForm.MdiParent = this.MdiParent; updateForm.Show(); } else { MessageBox.Show("Bạn cần chọn 1 bản nghi cần cập nhật."); } } catch (Exception ex) { logger.Error(ex.ToString()); if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString()); } }
private void btnAdd_Click(object sender, EventArgs e) { FrmAddVehicleFeeSetting addForm = new FrmAddVehicleFeeSetting(_userInfo, 0, this); addForm.MdiParent = this.MdiParent; addForm.Show(); }
private void btnUpdate_Click(object sender, EventArgs e) { try { if (grdVehicleFee.SelectedRows.Count == 1) { int vehicleTypeId = int.Parse(grdVehicleFee.SelectedRows[0].Cells["VehicleType"].Value.ToString()); int goodsTypeId = int.Parse(grdVehicleFee.SelectedRows[0].Cells["GoodsType"].Value.ToString()); tblVehicleFeeSetting vehicleFee = VehicleFeeSettingFactory.find(vehicleTypeId, goodsTypeId); if (vehicleFee == null) { MessageBox.Show("Không còn tồn tại loại biểu phí này, hãy tìm kiếm lại", "Lỗi đồng bộ dữ liệu", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } var updateForm = new FrmAddVehicleFeeSetting(_userInfo, 1, this, vehicleFee); updateForm.MdiParent = this.MdiParent ; updateForm.Show(); } else { MessageBox.Show("Bạn cần chọn 1 bản nghi cần cập nhật."); } } catch (Exception ex) { logger.Error(ex.ToString()); if (GlobalInfo.IsDebug) MessageBox.Show(ex.ToString()); } }