public JsonResult OSRFormSubmit(OSR osr) { if (osr.data_check == "CREATEOSR") { var userFFID = this.Get_user_ffID(); var userFullName = this.Get_user_fullname(); IDictionary <string, string> results = new Dictionary <string, string>(); IDictionary <string, string> LastID = new Dictionary <string, string>(); osrObject.OSRFormSubmit(osr.testerID, osr.handlerID, osr.family, osr.package, osr.process, osr.expectedDateofSetup, osr.shift, osr.status, userFullName, osr.m3Number, userFFID, osr.schedule, osr.reasonForUnplannedSetup); LastID = osrObject.getLastInputIDOSR(); return(Json(LastID)); } if (osr.data_check == "CREATEOSRBURNIN") { var userFFID = this.Get_user_ffID(); var userFullName = this.Get_user_fullname(); IDictionary <string, string> results = new Dictionary <string, string>(); IDictionary <string, string> LastID = new Dictionary <string, string>(); osrObject.OSRBurnInFormSubmit(osr.handlerID, osr.family, osr.package, osr.process, osr.expectedDateofSetup, osr.shift, osr.status, userFullName, osr.m3Number, userFFID); LastID = osrObject.getLastInputIDOSRBurnIn(); return(Json(LastID)); } if (osr.data_check == "CREATEOSRQFN") { var userFFID = this.Get_user_ffID(); var userFullName = this.Get_user_fullname(); IDictionary <string, string> results = new Dictionary <string, string>(); IDictionary <string, string> LastID = new Dictionary <string, string>(); osrObject.OSRQFNFormSubmit(osr.testerID, osr.handlerID, osr.family, osr.package, osr.process, osr.expectedDateofSetup, osr.shift, osr.status, userFullName, osr.m3Number, userFFID); LastID = osrObject.getLastInputIDOSRQFN(); return(Json(LastID)); } if (osr.data_check == "CREATEOSRCENTS") { var userFFID = this.Get_user_ffID(); var userFullName = this.Get_user_fullname(); IDictionary <string, string> results = new Dictionary <string, string>(); IDictionary <string, string> LastID = new Dictionary <string, string>(); osrObject.OSRCENTSFormSubmit(osr.handlerID, osr.handlerModel, osr.package, osr.process, osr.expectedDateofSetup, osr.shift, osr.status, userFullName, osr.m3Number, userFFID, osr.request_qty); LastID = osrObject.getLastInputIDOSRQFN(); return(Json(LastID)); } else { IDictionary <string, string> LastID = new Dictionary <string, string>(); return(Json(LastID)); } }
public void TestMethod1() { CRM obj = new CRM(); Emailr mailr = new Emailr(); OSR osr = new OSR(); //Abhijeet obj.WriteLogForCRM(); osr.WriteLogForOSR(); mailr.WriteLogForEmailr(); }
public JsonResult OSRFormSubmit(OSR osr) { var userFFID = this.Get_user_ffID(); var userFullName = this.Get_user_fullname(); IDictionary <string, string> results = new Dictionary <string, string>(); IDictionary <string, string> LastID = new Dictionary <string, string>(); osrObject.OSRFormSubmit(osr.testerID, osr.handlerID, osr.family, osr.package, osr.process, osr.expectedDateofSetup, osr.shift, osr.status, userFullName, osr.m3Number, userFFID); LastID = osrObject.getLastInputIDOSR(); return(Json(LastID)); }
public JsonResult OSRCENTSFormUpdateWithExpectedUpdate(OSR osr) { var userFFID = this.Get_user_ffID(); var userFullName = this.Get_user_fullname(); IDictionary <string, string> results = new Dictionary <string, string>(); IDictionary <string, string> LastID = new Dictionary <string, string>(); osrObject.OSRCENTSFormUpdateWithExpectedUpdate(osr.id, osr.m3Number, osr.socketID, osr.handlerID, osr.handlerModel, osr.package, osr.requestedBy, osr.dateSubmitted, osr.expectedDateofSetup, osr.recentlyUpdateBy, osr.shift, osr.status, userFullName, osr.remarks, osr.releasedTo, osr.reasonToChangeSetup, osr.request_qty); LastID = osrObject.getLastInputIDOSR(); return(Json(LastID)); }
public JsonResult OSRQFNFormUpdate(OSR osr) { var userFFID = this.Get_user_ffID(); var userFullName = this.Get_user_fullname(); IDictionary <string, string> results = new Dictionary <string, string>(); IDictionary <string, string> LastID = new Dictionary <string, string>(); osrObject.OSRQFNFormUpdate(osr.id, osr.m3Number, osr.testerID, osr.handlerID, osr.family, osr.package, osr.process, osr.requestedBy, osr.dateSubmitted, osr.expectedDateofSetup, osr.recentlyUpdateBy, osr.shift, osr.status, userFullName, osr.remarks, osr.releasedTo); LastID = osrObject.getLastInputIDOSR(); return(Json(LastID)); }
/// <summary> /// Create a single component from XML data /// </summary> /// <param name="node">XML node containing component data</param> /// <returns>Created Component</returns> private static ComponentBase CreateComponent(XmlNode node) { ComponentBase component; switch (node.LocalName) { #region Basic case "Coil": Coil coil = new Coil(); coil.Mode = node.Attributes["Mode"].Value.ToEnum <Coil.CoilMode>(); coil.Type = node.Attributes["Type"].Value.ToEnum <Coil.CoilType>(); component = coil; break; case "Contact": Contact contact = new Contact(); contact.IsClosed = node.Attributes["IsClosed"].Value.ToBool(); contact.IsInverted = node.Attributes["IsInverted"].Value.ToBool(); contact.Type = node.Attributes["Type"].Value.ToEnum <Contact.ContactType>(); component = contact; break; case "SC": component = new SC(); break; case "OSF": component = new OSF(); break; case "OSR": component = new OSR(); break; #endregion Basic #region Compare Components case "EQU": component = new EQU(); break; case "GEQ": component = new GEQ(); break; case "GRT": component = new GRT(); break; case "LEG": component = new LEG(); break; case "LES": component = new LES(); break; case "NEQ": component = new NEQ(); break; #endregion Compare Components #region Counter Components case "CTC": component = new CTC(); break; case "CTD": component = new CTD(); break; case "CTU": component = new CTU(); break; case "RES": component = new RES(); break; #endregion Counter Components #region Math Components case "ADD": component = new ADD(); break; case "DIV": component = new DIV(); break; case "MUL": component = new MUL(); break; case "SUB": component = new SUB(); break; case "MOV": component = new MOV(); break; #endregion Math Components #region Analog Components case "ADC": ADC adc = new ADC(); adc.Destination = node.Attributes["Destination"].Value; component = adc; break; case "PWM": PWM pwm = new PWM(); pwm.DudyCycle = node.Attributes["DudyCycle"].Value; component = pwm; break; #endregion Analog Components #region Function Components case "ELF": ELF elf = new ELF(); elf.Name = node.Attributes["Name"].Value; elf.Code = node.InnerText; component = elf; break; #endregion Function Components default: throw new ArgumentException("Unknow Component", "node"); } component.Comment = node.Attributes["Comment"].Value; #region Extra Processing based on Components Base Class if (component is NameableComponent) { (component as NameableComponent).Name = node.Attributes["Name"].Value; } if (component is CompareComponent) { (component as CompareComponent).VarA = node.Attributes["VarA"].Value; (component as CompareComponent).VarB = node.Attributes["VarB"].Value; } else if (component is CounterComponent) { (component as CounterComponent).Limit = node.Attributes["Limit"].Value; } else if (component is MathComponent) { (component as MathComponent).Destination = node.Attributes["Destination"].Value; (component as MathComponent).VarA = node.Attributes["VarA"].Value; (component as MathComponent).VarB = node.Attributes["VarB"].Value; } #endregion Extra Processing based on Components Base Class return(component); }
public void Basic() { #region Startup Node PowerRail = new Node(); PowerRail.LogicLevel = false; Coil coil = new Coil(PowerRail); Contact contact = new Contact(); contact.LeftLide = PowerRail; OSF osf = new OSF(); osf.LeftLide = PowerRail; OSR osr = new OSR(); osr.LeftLide = PowerRail; SC sc = new SC(PowerRail); #endregion Startup #region Coil coil.Execute(); Assert.IsFalse(coil.InternalState); PowerRail.LogicLevel = true; Assert.IsFalse(coil.InternalState); coil.Execute(); Assert.IsTrue(coil.InternalState); PowerRail.LogicLevel = false; Assert.IsTrue(coil.InternalState); coil.Execute(); Assert.IsFalse(coil.InternalState); coil.Mode = Coil.CoilMode.Negated; Assert.IsFalse(coil.InternalState); coil.Execute(); Assert.IsTrue(coil.InternalState); PowerRail.LogicLevel = true; coil.Execute(); Assert.IsFalse(coil.InternalState); coil.Mode = Coil.CoilMode.Set; PowerRail.LogicLevel = false; coil.Execute(); coil.Execute(); Assert.IsFalse(coil.InternalState); PowerRail.LogicLevel = true; coil.Execute(); Assert.IsTrue(coil.InternalState); PowerRail.LogicLevel = false; coil.Execute(); Assert.IsFalse(coil.InternalState); coil.Mode = Coil.CoilMode.Reset; coil.Execute(); Assert.IsFalse(coil.InternalState); PowerRail.LogicLevel = true; coil.Execute(); Assert.IsTrue(coil.InternalState); PowerRail.LogicLevel = false; coil.Execute(); Assert.IsFalse(coil.InternalState); #endregion Coil #region Contact PowerRail.LogicLevel = true; contact.Execute(); Assert.IsFalse(contact.InternalState); contact.IsClosed = true; contact.Execute(); Assert.IsTrue(contact.InternalState); PowerRail.LogicLevel = false; contact.Execute(); Assert.IsFalse(contact.InternalState); contact.IsInverted = true; contact.Execute(); Assert.IsFalse(contact.InternalState); PowerRail.LogicLevel = true; contact.Execute(); Assert.IsFalse(contact.InternalState); contact.IsClosed = false; contact.Execute(); Assert.IsTrue(contact.InternalState); #endregion Contact #region Short Circuit PowerRail.LogicLevel = false; sc.Execute(); Assert.IsFalse(sc.InternalState); PowerRail.LogicLevel = true; sc.Execute(); Assert.IsTrue(sc.InternalState); #endregion Short Circuit #region OSF PowerRail.LogicLevel = false; osf.Execute(); Assert.IsFalse(osf.InternalState); PowerRail.LogicLevel = true; osf.Execute(); Assert.IsFalse(osf.InternalState); PowerRail.LogicLevel = false; osf.Execute(); Assert.IsTrue(osf.InternalState); osf.Execute(); Assert.IsFalse(osf.InternalState); #endregion OSF #region OSR PowerRail.LogicLevel = false; osr.Execute(); Assert.IsFalse(osr.InternalState); PowerRail.LogicLevel = true; osr.Execute(); Assert.IsTrue(osr.InternalState); osr.Execute(); Assert.IsFalse(osr.InternalState); PowerRail.LogicLevel = false; osr.Execute(); Assert.IsFalse(osr.InternalState); #endregion OSR }