/// <summary> /// Return a flag indicating whether or not one or more virtual channel is used by the cycle creation configuration /// </summary> /// <returns>Virtual channel use flag: True = virtual used / False = virtual not used</returns> public bool IsCycleUsingVirtualChannel() { foreach (CycleParameter oParam in Parameters) { CyclePart ePart = CyclePart.PreCycle; while (!(ePart.Equals(CyclePart.None))) { CycleDataPart oDataPart = oParam.GetDataParameterDataPart(ePart); if (oDataPart.Source.Equals(CycleDataSource.VirtualChannel)) { return(true); } switch (ePart) { case CyclePart.PreCycle: ePart = CyclePart.InCycle; break; case CyclePart.InCycle: ePart = CyclePart.PostCycle; break; case CyclePart.PostCycle: ePart = CyclePart.None; break; } } } return(false); }
/// <summary> /// Return the cycle data part object corresponding to the part given as argument /// </summary> /// <param name="ePart">Cycle data part to get</param> /// <returns>Cycle data part, null if not found</returns> public CycleDataPart GetDataParameterDataPart(CyclePart ePart) { switch (ePart) { case CyclePart.PreCycle: return(PreCycle); case CyclePart.InCycle: return(InCycle); case CyclePart.PostCycle: return(PostCycle); default: return(null); } }
protected bool CheckError(CyclePart p) { if (string.IsNullOrEmpty(p.PartCode)) return true; long wid = long.Parse(ddlWarehouse.SelectedValue); var ps = PartInfoDAO.GetPartSafety(p.PartCode, wid); if ((ps == null) && !PartDAO.IsPartCodeValidForCC(p.PartCode, PartType.Part)) { p.PartType = p.PartName = ""; p.Error = Errors.NotExistPartCode; return false; } if (CycleCountDAO.Parts.Where(i => i.PartCode == p.PartCode).Count() > 1) { p.Error = Errors.DuplicatedPartCode; return false; } p.Error = string.Empty; return true; }