private LpuRR GetLpuRR() { int idLPU; int.TryParse(_dgv1.Rows[_dgv1.SelectedCells[0].RowIndex].Cells[0].Value.ToString(), out idLPU); return(_lpuRRList.GetItem(idLPU) as LpuRR); }
public void SetStyle() { foreach (DataGridViewRow row in _dgv.Rows) { if (Convert.ToInt32(row.Cells["Окончание отчётности"].Value.ToString()) < globalData.CurDate.Year) { row.DefaultCellStyle.BackColor = bbgray4; } int idLPU; int.TryParse(row.Cells["№ ЛПУ-RR"].Value.ToString(), out idLPU); LpuRRList lpuRRList = LpuRRList.GetUniqueInstance(); LpuRR lpuRR = lpuRRList.GetItem(idLPU) as LpuRR; if (lpuRR.StatusLPU == StatusLPU.Неактивен) { row.DefaultCellStyle.ForeColor = Color.Red; } else if (lpuRR.StatusLPU == StatusLPU.Групповой) { row.DefaultCellStyle.ForeColor = Color.Blue; } } }
private void CopyInfo(bool isNeedCopyLPUFromCONAN) { if (isNeedCopyLPUFromCONAN) { int idLpuCompetitor; int.TryParse(dgvLPUCompetitors.Rows[dgvLPUCompetitors.CurrentCell.RowIndex].Cells[0].Value.ToString(), out idLpuCompetitor); LpuCompetitors lpuCompetitor = _lpuCompetitorsList.GetItem(idLpuCompetitor); _lpu.Name = lpuCompetitor.Name; _lpu.INN = lpuCompetitor.INN; _lpu.KPP = lpuCompetitor.KPP; _lpu.RealRegion = lpuCompetitor.RealRegion; } int idLpuRR; int.TryParse(dgvLpuRR.Rows[dgvLpuRR.CurrentCell.RowIndex].Cells[0].Value.ToString(), out idLpuRR); //if (idLpuRR != 0) // { _lpu.LpuRR = _lpuRRList.GetItem(idLpuRR) as LpuRR; DialogResult = System.Windows.Forms.DialogResult.OK; /*} * else * { * MessageBox.Show("Сопоставление с прочими ЛПУ приостановлено. Для уточнения деталей обращайтесь с Тельнину Д.П..", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning); * } */ }
public LPU(DataRow row) : base(row) { int idTypeLPU; int.TryParse(row["TypeLPU_id"].ToString(), out idTypeLPU); TypeLPU = TypeLPUList.GetUniqueInstance().GetItem(idTypeLPU) as TypeLPU; int idOwnership; int.TryParse(row["Ownership_id"].ToString(), out idOwnership); Ownership = OwnershipList.GetUniqueInstance().GetItem(idOwnership) as Ownership; int idAdmLevel; int.TryParse(row["AdmLevel_id"].ToString(), out idAdmLevel); AdmLevel = AdmLevelList.GetUniqueInstance().GetItem(idAdmLevel) as AdmLevel; int idLpuRR; int.TryParse(row["lpuRR_id"].ToString(), out idLpuRR); LpuRRList lpuRRList = LpuRRList.GetUniqueInstance(); LpuRR = lpuRRList.GetItem(idLpuRR) as LpuRR; int.TryParse(row["Organization_bedsTotal"].ToString(), out _bedsTotal); int.TryParse(row["Organization_bedsIC"].ToString(), out _bedsIC); int.TryParse(row["Organization_Surgical"].ToString(), out _bedsSurgical); int.TryParse(row["Organization_Operating"].ToString(), out _operating); SubRegion = row["Organization_SubRegion"].ToString(); int idTypeFin; int.TryParse(row["typeFin_id"].ToString(), out idTypeFin); TypeFinList typeFinList = TypeFinList.GetUniqueInstance(); TypeFin = typeFinList.GetItem(idTypeFin) as TypeFin; int idLpuRR2; int.TryParse(row["lpuRR2_id"].ToString(), out idLpuRR2); LpuRR2 = lpuRRList.GetItem(idLpuRR2) as LpuRR; }
private bool CopyFields() { int idTypeLPU = Convert.ToInt32(cbTypeLpu.SelectedValue); _lpu.TypeLPU = _typeLPUList.GetItem(idTypeLPU) as TypeLPU; int idOwnership = Convert.ToInt32(cbOwnership.SelectedValue); _lpu.Ownership = _ownershipList.GetItem(idOwnership) as Ownership; int idAdmLevel = Convert.ToInt32(cbAdmLevel.SelectedValue); _lpu.AdmLevel = _admLevelList.GetItem(idAdmLevel) as AdmLevel; int idMainSpec = Convert.ToInt32(cbMainSpec.SelectedValue); _lpu.MainSpec = _mainSpecList.GetItem(idMainSpec) as MainSpec; int idTypeFin = Convert.ToInt32(cbTypeFin.SelectedValue); _lpu.TypeFin = _typeFinList.GetItem(idTypeFin) as TypeFin; /* * int idSubRegion = Convert.ToInt32(cbSubRegion.SelectedValue); * _lpu.SubRegion = _subRegionList.GetItem(idSubRegion) as SubRegion; */ ClassForForm.CheckFilled(tbName.Text, "Официальное название"); ClassForForm.CheckFilled(tbShortName.Text, "Сокращенное название"); ClassForForm.CheckFilled(tbINN.Text, "ИНН"); if (_parentLPU != null) { ClassForForm.CheckFilled(tbKPP.Text, "КПП"); } ClassForForm.CheckFilled(tbStreet.Text, "Уличный адрес"); ClassForForm.CheckINN(_lpu, tbINN.Text); _lpu.Name = tbName.Text; _lpu.ShortName = tbShortName.Text; _lpu.City = tbCity.Text; _lpu.INN = (_parentLPU == null) ? tbINN.Text : string.Empty; _lpu.KPP = tbKPP.Text; _lpu.PostIndex = tbPostIndex.Text; string email = _lpu.Email; _lpu.Email = tbEmail.Text; if (!ClassForForm.IsEmail(tbEmail.Text)) { MessageBox.Show("Ошибка в электронном адресе. Пожалуйста, исправьте.", "Ошибка ввода", MessageBoxButtons.OK, MessageBoxIcon.Warning); _lpu.Email = email; return(false); } string website = _lpu.Website; _lpu.Website = tbWebSite.Text; if (!ClassForForm.IsWebSite(tbWebSite.Text)) { MessageBox.Show("Ошибка в адресе веб-сайта. Пожалуйста, исправьте.", "Ошибка ввода", MessageBoxButtons.OK, MessageBoxIcon.Warning); _lpu.Website = website; return(false); } _lpu.Phone = tbPhone.Text; _lpu.Street = tbStreet.Text; string bedsTotal, bedsIC, bedsSurgical; bedsTotal = _lpu.BedsTotal; bedsIC = _lpu.BedsIC; bedsSurgical = _lpu.BedsSurgical; _lpu.BedsTotal = tbBedsTotal.Text; _lpu.BedsIC = tbBedsIC.Text; _lpu.BedsSurgical = tbBedsSurgical.Text; if (_lpu.IsTotalLessThenSum()) { MessageBox.Show("Общее количество коек меньше, чем сумма реанимационных и хирургических коек.\nПожалуйста, исправьте.", "Ошибка ввода", MessageBoxButtons.OK, MessageBoxIcon.Warning); _lpu.BedsTotal = bedsTotal; _lpu.BedsIC = bedsIC; _lpu.BedsSurgical = bedsSurgical; return(false); } _lpu.Operating = tbOperating.Text; if (_lpu.IsHaveDepartment()) { _lpu.MachineGD = string.Empty; _lpu.MachineGDF = string.Empty; _lpu.MachineCRRT = string.Empty; _lpu.Shift = string.Empty; _lpu.PatientGD = string.Empty; _lpu.PatientPD = string.Empty; _lpu.PatientCRRT = string.Empty; } else { _lpu.MachineGD = tbMachineGD.Text; _lpu.MachineGDF = tbMachineGDF.Text; _lpu.MachineCRRT = tbMachineCRRT.Text; _lpu.Shift = tbShift.Text; _lpu.PatientGD = tbPatientGD.Text; _lpu.PatientPD = tbPatientPD.Text; _lpu.PatientCRRT = tbPatientCRRT.Text; } if (cbLpuRR.Enabled) { int idLpuRR; int.TryParse(cbLpuRR.SelectedValue.ToString(), out idLpuRR); LpuRR lpuRR = _lpuRRList.GetItem(idLpuRR) as LpuRR; if (lpuRR != null) { _lpu.LpuRR = lpuRR; } } if (cbLpuRR2.Enabled) { int idLpuRR2; int.TryParse(cbLpuRR2.SelectedValue.ToString(), out idLpuRR2); LpuRR lpuRR2 = _lpuRRList.GetItem(idLpuRR2) as LpuRR; if (lpuRR2 != null) { _lpu.LpuRR2 = lpuRR2; } } return(true); }