public void TsCompleteCheck() { var catalog = new AggregateCatalog(); catalog.Catalogs.Add(new DirectoryCatalog(Directory.GetCurrentDirectory())); catalog.Catalogs.Add(new AssemblyCatalog(Assembly.GetExecutingAssembly())); using (var testContainer = new CompositionContainer(catalog)) { TsErrorCause tec = new TsErrorCause(); tec.errorCom = testContainer.GetExportedValue <IModelFormService>().Models().FirstOrDefault(m => m.MODELCODE == "modelcode1").errorComs.FirstOrDefault(); tec.errorCodeSeason = testContainer.GetExportedValue <IEcsFormService>().Ecss().FirstOrDefault(); tec.duty = testContainer.GetExportedValue <IDutyFormService>().Dutys().FirstOrDefault(); tec.solution = testContainer.GetExportedValue <IModelFormService>().Models().FirstOrDefault(m => m.MODELCODE == "modelcode1").solutions.FirstOrDefault(); tec.solmemo = Usercode; tec.muser = Usercode; DateTime dt = DateTime.Now; tec.mtime = Convert.ToInt32(dt.Hour.ToString() + dt.Minute + dt.Second); tec.mdate = Convert.ToInt32(dt.Year.ToString() + dt.Month + dt.Day); testContainer.GetExportedValue <ITsFormService>().Tss().FirstOrDefault(t => t.rcard == Card).tsErrorCodes.FirstOrDefault().tsErrorCauses.Add(tec); OperationResult operationResult = testContainer.GetExportedValue <IFrmTsInputEditService>().TsCompleteCheck(Card); Assert.IsTrue(operationResult.ResultType == OperationResultType.Success); } }
private void AddTsErrorCause() { TsErrorCause tec = new TsErrorCause(); tec.errorCom = (ErrorCom)listBox1.SelectedItem; tec.errorCodeSeason = (ErrorCodeSeason)listBox3.SelectedItem; tec.duty = (Duty)listBox4.SelectedItem; tec.solution = (Solution)listBox5.SelectedItem; tec.solmemo = richTextBox1.Text; tec.muser = Program.usercode; DateTime dt = DateTime.Now; tec.mtime = Convert.ToInt32(dt.Hour.ToString() + dt.Minute + dt.Second); tec.mdate = Convert.ToInt32(dt.Year.ToString() + dt.Month + dt.Day); tec.shiftday = Convert.ToInt32(dt.Year.ToString() + dt.Month + dt.Day); if (tsErrorCode.tsErrorCauses == null) { tsErrorCode.tsErrorCauses = new List <TsErrorCause>(); tsErrorCode.tsErrorCauses.Add(tec); } else { tsErrorCode.tsErrorCauses.Add(tec); } tec.tsErrorCode = tsErrorCode; Program.programContainer.GetExportedValue <FrmTsInputEdit>().TreeFresh(); formStatus = Status.NOTHING; this.Hide(); }
private void listBox2_SelectedIndexChanged(object sender, EventArgs e) { ErrorCodeSeasonGroup errorCodeSeasonGroup = (ErrorCodeSeasonGroup)listBox2.SelectedItem; if (errorCodeSeasonGroup != null) { listBox3.DataSource = errorCodeSeasonGroup.ecses.ToList(); } listBox3.SelectedItem = null; //OperationResult operationResult = Program.programContainer.GetExportedValue<FrmTsInputEdit>().tsCompositionContainer.GetExportedValue<IFrmTsInputEditService>().GetErrorCodeSeasonByGroup(errorCodeSeasonGroup.ecsgcode); //List<ErrorCodeSeason> list = (List<ErrorCodeSeason>)operationResult.AppendData; //listBox3.DataSource = list; TsErrorCause tec = Program.programContainer.GetExportedValue <FrmTsInputEdit>().currentTsErrorCause; if (tec != null) { int index_listBoxe3 = listBox3.FindString(tec.errorCodeSeason.ecsdesc); if (index_listBoxe3 == -1) { MessageBox.Show("Item is not available in ListBox2"); } else { listBox3.SetSelected(index_listBoxe3, true); } } }
private void BtnDelete_Click(object sender, EventArgs e) { if (treeView1.SelectedNode.Tag is TsErrorCause) { TsErrorCause tec = (TsErrorCause)treeView1.SelectedNode.Tag; tec.tsErrorCode.tsErrorCauses.Remove(tec); TreeFresh(); } if (treeView1.SelectedNode.Tag is TsErrorCode) { TsErrorCode tc = (TsErrorCode)treeView1.SelectedNode.Tag; tc.ts.tsErrorCodes.Remove(tc); TreeFresh(); } }
private void UpdateTsErrorCause() { TsErrorCause tec = Program.programContainer.GetExportedValue <FrmTsInputEdit>().currentTsErrorCause; tec.errorCom = (ErrorCom)listBox1.SelectedItem; tec.errorCodeSeason = (ErrorCodeSeason)listBox3.SelectedItem; tec.duty = (Duty)listBox4.SelectedItem; tec.solution = (Solution)listBox5.SelectedItem; tec.solmemo = richTextBox1.Text; tec.muser = Program.usercode; DateTime dt = DateTime.Now; tec.mtime = Convert.ToInt32(dt.Hour.ToString() + dt.Minute + dt.Second); tec.mdate = Convert.ToInt32(dt.Year.ToString() + dt.Month + dt.Day); Program.programContainer.GetExportedValue <FrmTsInputEdit>().BindFresh(); formStatus = Status.NOTHING; this.Hide(); }
public virtual OperationResult UpdateEntity(TsErrorCause tsErrorCause,bool isSave=true) { return tsErrorCauseRepository.Update(tsErrorCause,isSave); }
public virtual OperationResult AddEntity(TsErrorCause tsErrorCause,bool isSave=true) { return tsErrorCauseRepository.Insert(tsErrorCause,isSave); }