public DTestReport(human human, testresult testresult, pBaseEntities ge, fBaseEntities fe, bool WithResult) { _testresult = testresult; _human = human; _ge = ge; _fe = fe; _withresult = WithResult; _listscales = new List<IScale>(); // 1 level _listscales.Add(new DScaleL(GetAnswersFromBase(), _ge)); _listscales.Add(new DScaleF(GetAnswersFromBase(), _ge)); _listscales.Add(new DScaleK(GetAnswersFromBase(), _ge)); _listscales.Add(new DScaleHS(GetAnswersFromBase(), _ge, new DScaleK(GetAnswersFromBase(), _ge))); _listscales.Add(new DScaleD(GetAnswersFromBase(), _ge)); _listscales.Add(new DScaleHY(GetAnswersFromBase(), _ge)); _listscales.Add(new DScalePD(GetAnswersFromBase(), _ge, new DScaleK(GetAnswersFromBase(), _ge))); _listscales.Add(new DScaleMF(GetAnswersFromBase(), _ge)); _listscales.Add(new DScalePA(GetAnswersFromBase(), _ge)); _listscales.Add(new DScalePT(GetAnswersFromBase(), _ge, new DScaleK(GetAnswersFromBase(), _ge))); _listscales.Add(new DScaleSC(GetAnswersFromBase(), _ge, new DScaleK(GetAnswersFromBase(), _ge))); _listscales.Add(new DScaleMA(GetAnswersFromBase(), _ge, new DScaleK(GetAnswersFromBase(), _ge))); _listscales.Add(new DScaleSI(GetAnswersFromBase(), _ge)); //2 level _listscales.Add(new DScaleAC(GetAnswersFromBase(), _ge)); _listscales.Add(new DScalePC(GetAnswersFromBase(), _ge)); _listscales.Add(new DScaleDAN(GetAnswersFromBase(), _ge)); //3 level _listscales.Add(new DScaleDS(GetAnswersFromBase(), _ge)); _listscales.Add(new DScaleNPU(GetAnswersFromBase(), _ge)); _listscales.Add(new DScaleCS(GetAnswersFromBase(), _ge)); _listscales.Add(new DScaleMN(GetAnswersFromBase(), _ge)); //4 level _listscales.Add(new DScaleLAP(GetAnswersFromBase(), _ge)); // _listscales.Add(new DScaleKL(GetAnswersFromBase(),_human, _ge)); }
public KettellATestReport(human human, testresult testresult, pBaseEntities ge, fBaseEntities fe, bool WithResult) { _testresult = testresult; _human = human; _ge = ge; _fe = fe; _withresult = WithResult; _listscales = new List<IScale>(); _listscales.Add(new KettellScaleA(this.GetAnswersFromBase(), _ge,EnumKettellType.AForm)); _listscales.Add(new KettellScaleB(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleC(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleE(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleF(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleG(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleH(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleI(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleL(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleM(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleN(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleO(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleQ1(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleQ2(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleQ3(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); _listscales.Add(new KettellScaleQ4(this.GetAnswersFromBase(), _ge, EnumKettellType.AForm)); }
private void AddHuman(human newhuman) { int newdepartmentid; department newdep = _departmens.FirstOrDefault(ndep => ndep.idd == (int)newhuman.departmentid); department basedep = _fe.departments.FirstOrDefault(dep => dep.description == newdep.description); if (basedep == null) { newdepartmentid = this.AddDepartment(_departmens.First(dep => dep.idd == newhuman.departmentid)); } else { newdepartmentid = basedep.idd; } human createdhuman = human.Createhuman(0, newhuman.secondname); createdhuman.additinfo = newhuman.additinfo; createdhuman.birthday = newhuman.birthday; createdhuman.departmentid = newdepartmentid; createdhuman.educationid = newhuman.educationid; createdhuman.firstname = newhuman.firstname; createdhuman.genderid = newhuman.genderid; createdhuman.lastname = newhuman.lastname; foreach (testresult tresult in newhuman.testresults) { testresult createdtresult = testresult.Createtestresult(0, createdhuman.idh, tresult.testdate, tresult.testid, tresult.teststream, tresult.mode); createdhuman.testresults.Add(createdtresult); } _fe.humans.AddObject(createdhuman); _fe.SaveChanges(); }
/// <summary> /// Создание нового объекта human. /// </summary> /// <param name="idh">Исходное значение свойства idh.</param> /// <param name="secondname">Исходное значение свойства secondname.</param> public static human Createhuman(global::System.Int32 idh, global::System.String secondname) { human human = new human(); human.idh = idh; human.secondname = secondname; return(human); }
public MDTestReport(human human, testresult testresult, pBaseEntities ge, fBaseEntities fe, bool WithResult) { _testresult = testresult; _human = human; _ge = ge; _fe = fe; _withresult = WithResult; _listscales = new List<IScale>(); int ages = (_testresult.testdate.Date - _human.birthday.Value.Date).Days / 365; MDAnswers _answers = GetAnswersFromBase(); MDScaleAnamnes _anamnes = new MDScaleAnamnes(_answers, _ge); MDScaleLie _lie = new MDScaleLie(_answers, _ge); MDScaleM1_1 _m1_1 = new MDScaleM1_1(_answers, _ge); MDScaleM1_2 _m1_2 = new MDScaleM1_2(_answers, _ge); MDScaleM1 _m1 = new MDScaleM1(_answers, _ge, _m1_1, _m1_2); MDScaleM2 _m2 = new MDScaleM2(_answers, _ge); MDScaleM2_1 _m2_1 = new MDScaleM2_1(_answers, _ge); MDScaleM2_2 _m2_2 = new MDScaleM2_2(_answers, _ge); MDScaleM2_3 _m2_3 = new MDScaleM2_3(_answers, _ge); MDScaleM3 _m3 = new MDScaleM3(_answers, _ge); MDScaleM3_1 _m3_1 = new MDScaleM3_1(_answers, _ge); MDScaleM3_2 _m3_2 = new MDScaleM3_2(_answers, _ge); MDScaleM3_3 _m3_3 = new MDScaleM3_3(_answers, _ge); MDScaleM3_4 _m3_4 = new MDScaleM3_4(_answers, _ge); MDScaleM3_5 _m3_5 = new MDScaleM3_5(_answers, _ge); MDScaleM3_6 _m3_6 = new MDScaleM3_6(_answers, _ge); MDScaleIntegral _integral = new MDScaleIntegral(_anamnes, _lie, _m1, _m2, _m3); _listscales.Add(_lie); _listscales.Add(_anamnes); _listscales.Add(_m1); if (_withresult == true) { _listscales.Add(_m1_1); _listscales.Add(_m1_2); } _listscales.Add(_m2); if (_withresult == true) { _listscales.Add(_m2_1); _listscales.Add(_m2_2); _listscales.Add(_m2_3); } _listscales.Add(_m3); if (_withresult == true) { _listscales.Add(_m3_1); _listscales.Add(_m3_2); _listscales.Add(_m3_3); _listscales.Add(_m3_4); _listscales.Add(_m3_5); _listscales.Add(_m3_6); } _listscales.Add(_integral); }
public ReferenceFactory(human human,pBaseEntities ge, fBaseEntities fe) { _ge = ge; _fe = fe; _human = human; _human.testresults.Load(); _evalrefs = new List<string[]>(); this.GetEvalRefs(); }
public ContrastsTestReport(human human, testresult testresult, pBaseEntities ge, fBaseEntities fe) { _testresult = testresult; _human = human; _ge = ge; _fe = fe; _listscales = new List<IScale>(); _listscales.Add(new ContrastsScale(this.GetAnswersFromBase())); }
public PTestReport(human human, testresult testresult, pBaseEntities ge, fBaseEntities fe, bool WithResult) { _testresult = testresult; _human = human; _ge = ge; _fe = fe; _withresult = WithResult; _listscales = new List<IScale>(); _listscales.Add(new PScaleI(GetAnswersFromBase(), _ge)); _listscales.Add(new PScaleNPU(GetAnswersFromBase(), _ge)); }
private void UpgradeHuman(human oldhuman, human newhuman) { foreach (testresult tresult in newhuman.testresults) { if (oldhuman.testresults.FirstOrDefault(oldrestest => oldrestest.testid == tresult.testid & oldrestest.testdate == tresult.testdate) == null) { testresult createdtresult = testresult.Createtestresult(0, oldhuman.idh, tresult.testdate, tresult.testid, tresult.teststream, tresult.mode); oldhuman.testresults.Add(createdtresult); _fe.SaveChanges(); } } }
private void RestoreHuman(human newhuman) { human oldhuman = _fe.humans.FirstOrDefault(human => human.firstname == newhuman.firstname & human.secondname == newhuman.secondname & human.lastname == newhuman.lastname); if (oldhuman == null) { this.AddHuman(newhuman); } else { this.UpgradeHuman(oldhuman, newhuman); } }
private void LoadHumans() { dg_humans.Rows.Clear(); if (dg_humans.Columns.Count == 0) { SetGridStyle(); } SearchParam p = new SearchParam(this.cb_fam, this.cb_tests, this.dp_begdate, this.dp_enddate); var testresultsQuery = _fe.testresults.Where(p.Predicate, p.Parameters); foreach (testresult tst in testresultsQuery) { human _human = _fe.humans.First(h => h.idh == tst.idh); testsparam _test = _ge.testsparams.First(t => t.idt == tst.testid); dg_humans.Rows.Add(tst.idh, true, _test.description, tst.testdate, _human.secondname, _human.firstname, _human.birthday); } }
public LTestReport(human human, testresult testresult, pBaseEntities ge, fBaseEntities fe, bool WithResult) { _testresult = testresult; _human = human; _ge = ge; _fe = fe; _withresult = WithResult; _listscales = new List<IScale>(); _listscales.Add(new LScaleG1(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG2(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG3(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG4(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG5(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG6(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG7(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG8(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG9(GetAnswersFromBase(), _ge)); _listscales.Add(new LScaleG10(GetAnswersFromBase(), _ge)); }
public FPITestReport(human human, testresult testresult, pBaseEntities ge, fBaseEntities fe, bool WithResult) { _testresult = testresult; _human = human; _ge = ge; _fe = fe; _withresult = WithResult; _listscales = new List<IScale>(); _listscales.Add(new FPIScaleI(this.GetAnswersFromBase(),_ge)); _listscales.Add(new FPIScaleII(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleIII(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleIV(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleV(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleVI(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleVII(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleVIII(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleIX(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleX(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleXI(this.GetAnswersFromBase(), _ge)); _listscales.Add(new FPIScaleXII(this.GetAnswersFromBase(), _ge)); }
public bool CheckRestorePath(string restorePath) { bool pathisexists = false; bool humansisexists = false; bool departmentisexists = false; if (Directory.Exists(restorePath) == true) { pathisexists = true; _restorePath = new DirectoryInfo(restorePath); _humans = new List <human>(); _departmens = new List <department>(); FileInfo[] files = _restorePath.GetFiles("*.rbk"); if (files.Length != 0) { for (int fileindex = 0; fileindex < files.Length; fileindex++) { human _human = this.Restore <human>(files[fileindex].Name); if (_human != null) { _humans.Add(_human); humansisexists = true; } else { department _department = this.Restore <department>(files[fileindex].Name); if (_department != null) { _departmens.Add(_department); departmentisexists = true; } } } } } return(pathisexists & humansisexists & departmentisexists); }
private void btn_startexport_Click(object sender, EventArgs e) { List <human> _humans = new List <human>(); for (int rowindex = 0; rowindex < dg_humans.Rows.Count; rowindex++) { if ((bool)dg_humans.Rows[rowindex].Cells["check"].Value == true) { int idh = Convert.ToInt32(dg_humans.Rows[rowindex].Cells[0].Value); human _human = _fe.humans.FirstOrDefault(h => h.idh == idh); if (_human != null & _humans.Exists(h => h.idh == _human.idh) == false) { _humans.Add(_human); } } } pb_progress.Value = 1; pb_progress.Minimum = 1; pb_progress.Step = 1; pb_progress.Maximum = _humans.Count; _backuptool.Save(_humans); MessageBox.Show("Экспорт завершен"); }
public DScaleKL(DAnswers DAnswers, human h, pBaseEntities GlobalEntities) { _answers = DAnswers; _ge = GlobalEntities; _h = h; }
private bool HumanIsExist(human h) { if (h.firstname == this.FirstName & h.secondname == this.SecondName & h.lastname == this.LastName & h.birthday == this.BirthDay) { return true; } else { return false; } }
public IScalesCollection(pBaseEntities ge, testresult testresult, human human) { _listscales = new List<IScale>(); }
/// <summary> /// Устаревший метод для добавления новых объектов в набор EntitySet humans. Взамен можно использовать метод .Add связанного свойства ObjectSet<T>. /// </summary> public void AddTohumans(human human) { base.AddObject("humans", human); }
/// <summary> /// Создание нового объекта human. /// </summary> /// <param name="idh">Исходное значение свойства idh.</param> /// <param name="secondname">Исходное значение свойства secondname.</param> public static human Createhuman(global::System.Int32 idh, global::System.String secondname) { human human = new human(); human.idh = idh; human.secondname = secondname; return human; }
private void Loading() { _tp = _ge.testsparams.First(t => t.idt == _testid); switch (_testid) { case (int)EnumPTests.KettellC://TODO:это все поместить в фабрику отчетов с функцие добавления пустых ответов //create fool kettellanswers KettellAnswers ka = new KettellAnswers(); for (int a = 0; a < 104; a++) { ka.Add(0, "", "", a, ""); } XmlSerializer mySerializer = new XmlSerializer(typeof(KettellAnswers)); StringWriter myWriter = new StringWriter(); mySerializer.Serialize(myWriter, ka); _human=_fe.humans.First(h => h.idh == _humanid); KettellCTestReport kcr = new KettellCTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.KettellC, myWriter.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < kcr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = kcr.ListScales[i]; } break; case (int)EnumPTests.PNN: PNNAnswers pa = new PNNAnswers(); for (int a = 0; a < 104; a++) { pa.Add(PnnSignalType.Green,PnnKeyType.AnyKey,DateTime.Now,0); } XmlSerializer mySerializerp = new XmlSerializer(typeof(PNNAnswers)); StringWriter myWriterp = new StringWriter(); mySerializerp.Serialize(myWriterp, pa); _human=_fe.humans.First(h => h.idh == _humanid); PNNTestReport pnr = new PNNTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.PNN, myWriterp.ToString(), "manual"), _ge, _fe); for (int i = 0; i < pnr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = pnr.ListScales[i]; } break; case (int)EnumPTests.Adaptability: DAnswers kd = new DAnswers(); for (int a = 0; a < 165; a++) { kd.Add(0, "", "", a, ""); } XmlSerializer mySerializerd = new XmlSerializer(typeof(DAnswers)); StringWriter myWriterd = new StringWriter(); mySerializerd.Serialize(myWriterd, kd); _human=_fe.humans.First(h => h.idh == _humanid); DTestReport kdr = new DTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Adaptability, myWriterd.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < kdr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = kdr.ListScales[i]; } break; case (int)EnumPTests.FPI: FPIAnswers kfpi= new FPIAnswers(); for (int a = 0; a < 114; a++) { kfpi.Add(0, "", "", a, ""); } XmlSerializer mySerializerfpi = new XmlSerializer(typeof(FPIAnswers)); StringWriter myWriterfpi = new StringWriter(); mySerializerfpi.Serialize(myWriterfpi, kfpi); _human=_fe.humans.First(h => h.idh == _humanid); FPITestReport kfr = new FPITestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.FPI, myWriterfpi.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < kfr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = kfr.ListScales[i]; } break; case (int)EnumPTests.KettellA: KettellAnswers kaa = new KettellAnswers(); for (int a = 0; a < 185; a++) { kaa.Add(0, "", "", a, ""); } XmlSerializer mySerializera = new XmlSerializer(typeof(KettellAnswers)); StringWriter myWritera = new StringWriter(); mySerializera.Serialize(myWritera, kaa); _human=_fe.humans.First(h => h.idh == _humanid); KettellATestReport kar = new KettellATestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.KettellA, myWritera.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < kar.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = kar.ListScales[i]; } break; case (int)EnumPTests.Contrasts: ContrastsAnswers mkd = new ContrastsAnswers(); for (int a = 0; a < 6; a++) { mkd.Add(DateTime.Now, 0); } XmlSerializer mySerializermd = new XmlSerializer(typeof(ContrastsAnswers)); StringWriter myWritermd = new StringWriter(); mySerializermd.Serialize(myWritermd, mkd); _human = _fe.humans.First(h => h.idh == _humanid); ContrastsTestReport mkdr = new ContrastsTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Contrasts, myWritermd.ToString(), "manual"), _ge, _fe); for (int i = 0; i < mkdr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = mkdr.ListScales[i]; } break; case (int)EnumPTests.Prognoz: PAnswers paa = new PAnswers(); for (int a = 0; a < 86; a++) { paa.Add(0, "", "", a, ""); } XmlSerializer mySerializerpr = new XmlSerializer(typeof(PAnswers)); StringWriter myWriterpr = new StringWriter(); mySerializerpr.Serialize(myWriterpr, paa); _human = _fe.humans.First(h => h.idh == _humanid); PTestReport par = new PTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Prognoz, myWriterpr.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < par.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = par.ListScales[i]; } break; case (int)EnumPTests.Addictive: AAnswers aaa = new AAnswers(); for (int a = 0; a < 30; a++) { aaa.Add(0, "", "", a, ""); } XmlSerializer mySerializeraa = new XmlSerializer(typeof(AAnswers)); StringWriter myWriteraa = new StringWriter(); mySerializeraa.Serialize(myWriteraa, aaa); _human = _fe.humans.First(h => h.idh == _humanid); ATestReport aar = new ATestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Addictive, myWriteraa.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < aar.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = aar.ListScales[i]; } break; case (int)EnumPTests.NPNA: NPNAnswers npn = new NPNAnswers(); for (int a = 0; a < 276; a++) { npn.Add(0, "", "", a, ""); } XmlSerializer mySerializernpn = new XmlSerializer(typeof(NPNAnswers)); StringWriter myWriternpn = new StringWriter(); mySerializernpn.Serialize(myWriternpn, npn); _human = _fe.humans.First(h => h.idh == _humanid); NPNTestReport npnr = new NPNTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.NPNA, myWriternpn.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < npnr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale = npnr.ListScales[i]; } break; case (int)EnumPTests.Leongard: LAnswers lpn = new LAnswers(); for (int a = 0; a < 88; a++) { lpn.Add(0, "", "", a, ""); } XmlSerializer mySerializerlpn = new XmlSerializer(typeof(LAnswers)); StringWriter myWriterlpn = new StringWriter(); mySerializerlpn.Serialize(myWriterlpn, lpn); _human = _fe.humans.First(h => h.idh == _humanid); LTestReport lpnr = new LTestReport(_human, testresult.Createtestresult(0, _humanid, DateTime.Now, (int)EnumPTests.Leongard, myWriterlpn.ToString(), "manual"), _ge, _fe, true); for (int i = 0; i < lpnr.ListScales.Count(); i++) { ScaleControl sc = new ScaleControl(); this.flp_parent.Controls.Add(sc); sc.ControlScale =lpnr.ListScales[i]; } break; } }