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();
 }
 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);
     }
 }
示例#3
0
		public virtual OperationResult UpdateEntity(TsErrorCause tsErrorCause,bool isSave=true)
		{
			return tsErrorCauseRepository.Update(tsErrorCause,isSave);
		}
示例#4
0
		public virtual OperationResult AddEntity(TsErrorCause tsErrorCause,bool isSave=true)
		{
			return tsErrorCauseRepository.Insert(tsErrorCause,isSave);
		}