/// <summary> /// 设定子节点 /// Created:20170602(ChengMengjia) /// </summary> /// <param name="advTree1"></param> /// <param name="ProjectID"></param> private static void SetMainSubTreeData(IList <PNode> listNode, PNode parent, DevComponents.AdvTree.Node node) { string parentID = parent.ID.Substring(0, 36); IEnumerable <PNode> children = listNode.Where(t => t.ParentID == parentID).OrderBy(t => t.No).OrderByDescending(t => t.No.HasValue); if (children.Count <PNode>() < 1) { parent.FinishStatus = parent.FinishStatus == null ? 0 : parent.FinishStatus; node.Style = MatchColor(parent.FinishStatus); return; } DevComponents.AdvTree.Node node2; foreach (PNode child in children) { node2 = new DevComponents.AdvTree.Node() { Name = child.ID, Text = string.IsNullOrEmpty(child.WBSNo) ? child.Name + "(" + EnumsHelper.GetDescription((WBSPType)child.PType) + ")" : child.WBSNo + "-" + child.Name, Tag = JsonHelper.EntityToString <PNode>(child) }; #region 交付物需要检查完成情况 #endregion SetMainSubTreeData(listNode, child, node2); node.Nodes.Add(node2); } parent.FinishStatus = (from p in children select p.FinishStatus).Max(); node.Style = MatchColor(parent.FinishStatus); }
public ResponseResult <GridResponse <CommonSearchItem> > GetMaterialCode(string code, GridSettings gridSettings) { var result = _unitOfWork.MaterialRepository.GetAll(); if (!string.IsNullOrEmpty(code)) { result = result.Where( i => i.F01_MaterialCode.ToUpper().Contains(code.ToUpper()) || i.F01_MaterialDsp.ToUpper().Contains(code.ToUpper())); } // Sort and paging var itemCount = result.Count(); OrderByAndPaging(ref result, gridSettings); var resultLst = result.ToList().Select(s => new CommonSearchItem { F01_MaterialCode = s.F01_MaterialCode, F01_MaterialDsp = s.F01_MaterialDsp, F01_Unit = s.F01_Unit, F01_RtrPosCls = s.F01_RtrPosCls, F01_EntrustedClass = s.F01_EntrustedClass, F01_PackingUnit = s.F01_PackingUnit, F01_LiquidClass = EnumsHelper.GetDescription <Constants.Liquid>(ConvertHelper.ToInteger(s.F01_LiquidClass)) }); //var lstResult = Mapper.Map<IEnumerable<TM01_Material>, IEnumerable<MaterialItem>>(result.ToList()); var resultModel = new GridResponse <CommonSearchItem>(resultLst, itemCount); return(new ResponseResult <GridResponse <CommonSearchItem> >(resultModel, true)); //return result; }
public Task(int numTask, Enum priority, Enum difficult) { Number = numTask; Priority = priority; Difficulty = difficult; Difficulty listDifficult; Enum.TryParse(Difficulty.ToString(), true, out listDifficult); Duration = int.Parse(EnumsHelper.GetDescription(listDifficult)); }
private string breakk; //分割符 #endregion public WBSCode() { InitializeComponent(); //加载序列 foreach (WBSCodeOrder order in Enum.GetValues(typeof(WBSCodeOrder))) { ComboItem item = new ComboItem(); item.Text = EnumsHelper.GetDescription(order); item.Value = (int)order; cmbOrder.Items.Add(item); } //DataHelper.LoadDictItems(cmbOrder, DictCategory.WBSCodeOrder); DataHelper.LoadDictItems(cmbLength, DictCategory.WBSCodeLength); DataHelper.LoadDictItems(cmbBreak, DictCategory.WBSCodeBreak); DataBind(); }
/// <summary> /// 获取wbs代码列表 /// 2017/05/04(zhuguanjun) /// </summary> /// <returns></returns> public DataTable GetWBSCodeList(List <QueryField> qlist) { StringBuilder sql = new StringBuilder(); sql.Append(" select w.*,d2.Name as LengthName, d3.Name as BreakName,"); sql.Append(" case w.Orderr when " + (int)WBSCodeOrder.Upper + " then '" + EnumsHelper.GetDescription(WBSCodeOrder.Upper) + "'"); sql.Append(" when " + (int)WBSCodeOrder.Lower + " then '" + EnumsHelper.GetDescription(WBSCodeOrder.Lower) + "'"); sql.Append(" when " + (int)WBSCodeOrder.Number + " then '" + EnumsHelper.GetDescription(WBSCodeOrder.Number) + "' end as OrderName"); sql.Append(" from WBSCode w"); sql.Append(" left join DictItem d1 on d1.No = w.Orderr and d1.DictNo = " + (int)DictCategory.WBSCodeOrder); sql.Append(" left join DictItem d2 on d2.No = w.Length and d2.DictNo = " + (int)DictCategory.WBSCodeLength); sql.Append(" left join DictItem d3 on d3.No = w.Breakk and d3.DictNo = " + (int)DictCategory.WBSCodeBreak); sql.Append(" where PID=@PID "); DataTable dt = NHHelper.ExecuteDataTable(sql.ToString(), qlist); return(dt); }
public FormSetting() { InitializeComponent(); #region 配置绑定 LoadWorkDir(); LoadWeekly(); #endregion //加载基础数据项 foreach (DictCategory category in Enum.GetValues(typeof(DictCategory))) { ComboItem item = new ComboItem(); item.Text = EnumsHelper.GetDescription(category); item.Value = (int)category; cbDictCategory.Items.Add(item); } cbDictCategory.SelectedIndexChanged += new System.EventHandler(LoadDictItems); }
public static void BeforeScenarioStartWatch() { Feature = new Feature(); Scenario = new Scenario(); ResultStatus = new ResultStatus(); Browser = new Browser() { BrowserName = CurrentPreferences.driver.ToString() }; Screen = new Screen() { Size = EnumsHelper.GetDescription(CurrentPreferences.screen) }; ExecutedTest = new ExecutedTest { StartTime = DateTime.Now, Browser = Browser, Screen = Screen }; }
public Status UpperTool(E_Tool e_Tools) { string b = string.Format("//li[contains(@class,'menu-space') or (@class='mega-menu-item')]//*[text()='{0}']", EnumsHelper.GetDescription(e_Tools)); return(SeleniumHelper.OnClick(By.XPath(b))); }
public Status HappyCubes(E_Cubes e_Cubes) { string a = string.Format("//*[@class = 'categories']/a//div[contains(text(), '{0}')]", EnumsHelper.GetDescription(e_Cubes)); return(SeleniumHelper.OnClick(By.XPath(a))); }
public Status IllnessUpperTool(E_Illness e_Illness) { string a = string.Format("//header//div[@class ='top-header actions']//*[contains(text(), '{0}')]", EnumsHelper.GetDescription(e_Illness)); return(SeleniumHelper.OnClick(By.XPath(a))); }
public Status HappyTool(E_Happy e_Happy) { string a = string.Format("//*[@class='ness-nav-wrap']//ul//a[contains(text(), '{0}')]", EnumsHelper.GetDescription(e_Happy)); return(SeleniumHelper.OnClick(By.XPath(a))); }
public Status InnerTool(Enum e_Tools) { string a = string.Format("//li//a[contains(@class,'table_') or (@class='mega_menu_tools_img_link')]//*[text()='{0}']", EnumsHelper.GetDescription(e_Tools)); return(SeleniumHelper.OnClick(By.XPath(a))); }
/// <summary> /// 设定子节点 /// Created:20170330(Xuxb) /// Updated:20170527(ChengMengjia) 增加Check框 /// </summary> /// <param name="advTree1"></param> /// <param name="ProjectID"></param> void SetSubTreeData(IList <PNode> listNode, PNode parent, DevComponents.AdvTree.Node node) { string parentID = parent.ID.Substring(0, 36); IEnumerable <PNode> children = listNode.Where(t => t.ParentID == parentID).OrderBy(t => t.No); if (children.Count <PNode>() < 1) { return; } DevComponents.AdvTree.Node node2; foreach (PNode child in children) { node2 = new DevComponents.AdvTree.Node() { CheckBoxVisible = true, Name = child.ID, Text = (child.PType == null || child.PType == 0) ? child.Name : child.Name + "(" + EnumsHelper.GetDescription((WBSPType)child.PType) + ")", Tag = JsonHelper.EntityToString <PNode>(child) }; SetSubTreeData(listNode, child, node2); node.Nodes.Add(node2); } }
public static Status AttributeIsContains(IWebElement element, EnumsHelper.E_Attributes attributeName, string attributeValue) { try { return(StatusHelper.ConvertBoolToPassOrFailStatus(element.GetAttribute(EnumsHelper.GetDescription(attributeName)).Contains(attributeValue))); } catch { return(Status.Fail); } }
public static Status IconIsContainsInElement(IWebElement element, EnumsHelper.E_IconsClass iconsClass) { return(ElementIsExists(element, By.XPath(".//i[contains(@class,'" + EnumsHelper.GetDescription(iconsClass) + "')]"))); }
public Status QuadroTool(E_HomePage e_HomePage) { string a = string.Format("//*[contains(@class, 'col-md-full-right')]//span[text() = '{0}']", EnumsHelper.GetDescription(e_HomePage)); return(SeleniumHelper.OnClick(By.XPath(a))); }
public Status DropMenu(E_Tik e_Tik) { string a = string.Format("//a[@class='dropdown-item' and contains(.,'{0}')]", EnumsHelper.GetDescription(e_Tik)); return(SeleniumHelper.OnClick(By.XPath(a))); }
public Status HappyTool(E_Side e_Side) { string a = string.Format("//*[@class = 'categorydescwrap' or @class = 'categorydescwrap special']/*[contains(., '{0}')]", EnumsHelper.GetDescription(e_Side)); return(SeleniumHelper.OnClick(By.XPath(a))); }
public ResponseResult <GridResponse <PrintPreProductItem> > MaterialListPrint(string request) { var lstPreproduct = _unitOfWork.PreProductRepository.GetAll(); if (!string.IsNullOrEmpty(request)) { lstPreproduct = lstPreproduct.Where(i => i.F03_PreProductCode.ToUpper().Contains(request.ToUpper())); } var lstPreProductCode = lstPreproduct.Select(i => i.F03_PreProductCode); var lstPrePdtMkp = _unitOfWork.PrePdtMkpRepository.GetAll().Where(i => lstPreProductCode.Contains(i.F02_PreProductCode)); var lstMaterial = _unitOfWork.MaterialRepository.GetAll(); var itemCount = lstPrePdtMkp.Count(); lstPrePdtMkp = lstPrePdtMkp.OrderBy(i => i.F02_PreProductCode).ThenBy(i => i.F02_LayinPriority) .ThenBy(i => i.F02_ThrawSeqNo) .ThenBy(i => i.F02_PotSeqNo) .ThenBy(i => i.F02_MsrSeqNo); var lstResult = lstPreproduct.ToList().Select(i => new PrintPreProductItem() { MaterialPrintItems = new List <MaterialPrintItem>( lstPrePdtMkp.Where(m => m.F02_PreProductCode == i.F03_PreProductCode) .ToList().Select(o => new MaterialPrintItem() { MasterialName = lstMaterial.FirstOrDefault(k => k.F01_MaterialCode == o.F02_MaterialCode) != null? lstMaterial.FirstOrDefault(k => k.F01_MaterialCode == o.F02_MaterialCode).F01_MaterialDsp:"", MasterialCode = o.F02_MaterialCode, Sum3F4F = (o.F02_3FLayinAmount + o.F02_4FLayinAmount).ToString("N"), WSeq = o.F02_MsrSeqNo, C_Pri = o.F02_LayinPriority, PSeq = o.F02_PotSeqNo, CSeq = o.F02_ThrawSeqNo, LoadPosition = o.F02_LoadPosition, Method = Enum.GetName(typeof(Constants.WeighingMethod), o.F02_WeighingMethod), Additive = Enum.GetName(typeof(Constants.Additive), ConvertHelper.ToInteger(o.F02_Addtive)), MilingFlag1 = EnumsHelper.GetDescription <Constants.Crushing>( ConvertHelper.ToInteger(o.F02_MilingFlag1)), MilingFlag2 = EnumsHelper.GetDescription <Constants.Crushing>( ConvertHelper.ToInteger(o.F02_MilingFlag2)), })), F03_AllMtrAmtPerBth = i.F03_AllMtrAmtPerBth, F03_BatchLot = i.F03_BatchLot, F03_ColorClass = i.F03_ColorClass, F03_ContainerType = i.F03_ContainerType, F03_KneadingLine = i.F03_KneadingLine, F03_LotNoEnd = i.F03_LotNoEnd, F03_LowTmpClass = i.F03_LowTmpClass, MixDate1 = i.F03_MixDate1.HasValue ? i.F03_MixDate1.Value.ToString("HH:mm:ss") : "", MixDate2 = i.F03_MixDate2.HasValue ? i.F03_MixDate2.Value.ToString("HH:mm:ss") : "", F03_MixMode = i.F03_MixMode, MixDate3 = i.F03_MixDate3.HasValue ? i.F03_MixDate3.Value.ToString("HH:mm:ss") : "", F03_Point = i.F03_Point, F03_PreProductCode = i.F03_PreProductCode, F03_PreProductName = i.F03_PreProductName, F03_TmpRetTime = i.F03_TmpRetTime, YieldRate = i.F03_YieldRate.ToString("F") }); var resultModel = new GridResponse <PrintPreProductItem>(lstResult, itemCount); return(new ResponseResult <GridResponse <PrintPreProductItem> >(resultModel, true)); }
/// <summary> /// Search pre-product records for printing. /// </summary> /// <param name="request"></param> /// <param name="gridSettings"></param> /// <returns></returns> public ResponseResult <GridResponse <PrintPreProductItem> > SearchMaterialList(string request, GridSettings gridSettings) { var lstPreproduct = _unitOfWork.PreProductRepository.GetAll(); if (!string.IsNullOrEmpty(request)) { lstPreproduct = lstPreproduct.Where(i => i.F03_PreProductCode.ToUpper().Contains(request.ToUpper())); } var lstPreProductCode = lstPreproduct.Select(i => i.F03_PreProductCode); var lstPrePdtMkp = _unitOfWork.PrePdtMkpRepository.GetAll().Where(i => lstPreProductCode.Contains(i.F02_PreProductCode)); var lstMaterial = _unitOfWork.MaterialRepository.GetAll(); var itemCount = lstPrePdtMkp.Count(); if (gridSettings != null) { lstPrePdtMkp = lstPrePdtMkp.OrderBy(i => i.F02_PreProductCode).ThenBy(i => i.F02_LayinPriority) .ThenBy(i => i.F02_ThrawSeqNo) .ThenBy(i => i.F02_PotSeqNo) .ThenBy(i => i.F02_MsrSeqNo); lstPrePdtMkp = lstPrePdtMkp.Skip((gridSettings.PageIndex - 1) * gridSettings.PageSize).Take(gridSettings.PageSize); } var lstResult = (from prePdtMkp in lstPrePdtMkp join preProduct in lstPreproduct on prePdtMkp.F02_PreProductCode equals preProduct.F03_PreProductCode join tm01Material in lstMaterial on prePdtMkp.F02_MaterialCode equals tm01Material.F01_MaterialCode select new { preProduct, tm01Material, prePdtMkp }).ToList().Select(i => new PrintPreProductItem() { MasterialName = i.tm01Material.F01_MaterialDsp, MasterialCode = i.prePdtMkp.F02_MaterialCode, Sum3F4F = i.prePdtMkp.F02_3FLayinAmount + i.prePdtMkp.F02_4FLayinAmount, WSeq = i.prePdtMkp.F02_MsrSeqNo, C_Pri = i.prePdtMkp.F02_LayinPriority, PSeq = i.prePdtMkp.F02_PotSeqNo, CSeq = i.prePdtMkp.F02_ThrawSeqNo, LoadPosition = i.prePdtMkp.F02_LoadPosition, Method = Enum.GetName(typeof(Constants.WeighingMethod), i.prePdtMkp.F02_WeighingMethod), Additive = Enum.GetName(typeof(Constants.Additive), ConvertHelper.ToInteger(i.prePdtMkp.F02_Addtive)), MilingFlag1 = EnumsHelper.GetDescription <Constants.Crushing>( ConvertHelper.ToInteger(i.prePdtMkp.F02_MilingFlag1)), MilingFlag2 = EnumsHelper.GetDescription <Constants.Crushing>( ConvertHelper.ToInteger(i.prePdtMkp.F02_MilingFlag2)), F03_AllMtrAmtPerBth = i.preProduct.F03_AllMtrAmtPerBth, F03_BatchLot = i.preProduct.F03_BatchLot, F03_ColorClass = i.preProduct.F03_ColorClass, F03_ContainerType = i.preProduct.F03_ContainerType, F03_KneadingLine = i.preProduct.F03_KneadingLine, F03_LotNoEnd = i.preProduct.F03_LotNoEnd, F03_LowTmpClass = i.preProduct.F03_LowTmpClass, MixDate1 = i.preProduct.F03_MixDate1.HasValue ? i.preProduct.F03_MixDate1.Value.ToString("HH:mm:ss") : "", MixDate2 = i.preProduct.F03_MixDate2.HasValue ? i.preProduct.F03_MixDate2.Value.ToString("HH:mm:ss") : "", F03_MixMode = i.preProduct.F03_MixMode, MixDate3 = i.preProduct.F03_MixDate3.HasValue ? i.preProduct.F03_MixDate3.Value.ToString("HH:mm:ss") : "", F03_Point = i.preProduct.F03_Point, F03_PreProductCode = i.preProduct.F03_PreProductCode, F03_PreProductName = i.preProduct.F03_PreProductName, F03_TmpRetTime = i.preProduct.F03_TmpRetTime, F03_YieldRate = i.preProduct.F03_YieldRate }); //var lstResult = new List<PrintPreProductItem>(); //foreach (var tm02PrePdtMkp in lstPrePdtMkp) //{ // var tm03PreProduct = // lstPreproduct.FirstOrDefault(i => i.F03_PreProductCode == tm02PrePdtMkp.F02_PreProductCode); // var printPreProduct = Mapper.Map<TM03_PreProduct, PrintPreProductItem>(tm03PreProduct); // printPreProduct.MasterialCode = tm02PrePdtMkp.F02_MaterialCode; // var marterial = lstMaterial.FirstOrDefault(i => i.F01_MaterialCode == tm02PrePdtMkp.F02_MaterialCode); // if (marterial != null) // printPreProduct.MasterialName = marterial.F01_MaterialDsp; // printPreProduct.MasterialCode = tm02PrePdtMkp.F02_MaterialCode; // printPreProduct.Sum3F4F = tm02PrePdtMkp.F02_3FLayinAmount + tm02PrePdtMkp.F02_4FLayinAmount; // printPreProduct.WSeq = tm02PrePdtMkp.F02_MsrSeqNo; // printPreProduct.C_Pri = tm02PrePdtMkp.F02_ThrawSeqNo; // printPreProduct.PSeq = tm02PrePdtMkp.F02_PotSeqNo; // printPreProduct.CSeq = tm02PrePdtMkp.F02_LayinPriority; // printPreProduct.LoadPosition = tm02PrePdtMkp.F02_LoadPosition; // printPreProduct.Method = Enum.GetName(typeof(Constants.WeighingMethod), tm02PrePdtMkp.F02_WeighingMethod); // printPreProduct.Additive =Enum.GetName(typeof(Constants.Additive),ConvertHelper.ToInteger(tm02PrePdtMkp.F02_Addtive)); // printPreProduct.MilingFlag1 =EnumsHelper.GetDescription<Constants.Crushing>(ConvertHelper.ToInteger( tm02PrePdtMkp.F02_MilingFlag1)); // printPreProduct.MilingFlag2 = EnumsHelper.GetDescription<Constants.Crushing>(ConvertHelper.ToInteger(tm02PrePdtMkp.F02_MilingFlag2)); // lstResult.Add(printPreProduct); //} // IQueryable<PrintPreProductItem> lstreuslt1 = lstResult.AsQueryable(); var resultModel = new GridResponse <PrintPreProductItem>(lstResult, itemCount); return(new ResponseResult <GridResponse <PrintPreProductItem> >(resultModel, true)); }
public Status DLoad(E_DL e_DL) { string a = string.Format("//td[contains(@role, 'gridcell')]//a[text()='{0}']", EnumsHelper.GetDescription(e_DL)); return(SeleniumHelper.OnClick(By.XPath(a))); }
public void CheckLoad(E_DL e_DL) { string texter = string.Format("//td[contains(@role, 'gridcell')]//a[text()='{0}']", EnumsHelper.GetDescription(e_DL)); string name = SeleniumHelper.GetTextFromElement(By.XPath(texter)); string filePath = @"C:\Users\Shushu HaShual\Downloads\" + "/" + name + ".doc"; Console.WriteLine(File.Exists(filePath) ? Status.Pass : Status.Error); }