public ActionResult Create(ListHeader listHeader) { string userkey = ConfigurationManager.AppSettings["userkey"]; string uid = ConfigurationManager.AppSettings["uid"]; string LoginUser = (string)Session["LoginSAPID"]; try { TNS.TNS tns = new TNS.TNS(); var CreateList = tns.CreateListHeader(LoginUser, listHeader.Listname, listHeader.H1, listHeader.H2, listHeader.H3, listHeader.H4, listHeader.H5, listHeader.H6, listHeader.H7, listHeader.H8, listHeader.H9, listHeader.H10, listHeader.H11, listHeader.H12, listHeader.H13, listHeader.H14, listHeader.H15, listHeader.H16, listHeader.H17, listHeader.H18, listHeader.H19, listHeader.H20, userkey, uid); var CreateListStatus = CreateList.Split('~'); if (CreateListStatus[0] != "00") { TempData["Msg"] = CreateListStatus[1]; return(RedirectToAction("Index")); } else { TempData["Error"] = CreateListStatus[1]; return(RedirectToAction("Index")); } } catch (Exception ex) { //LogError logerror = new LogError(); //logerror.ErrorLog("", LoginUser, "", "Requests/GetRequests", "Requests", "GetRequests", "FetchIncidents Error", ex.Message.ToString(), 0); return(RedirectToAction("Index")); } }
/// <inheritdoc /> public bool Equals(ListElement?other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } if (Type != other.Type) { return(false); } if (ListHeader != null) { if (!ListHeader.Equals(other.ListHeader)) { return(false); } } else { if (other.ListHeader != null) { return(false); } } return(Items.SequenceEqual(other.Items)); }
//设置报表列名 public override ReportHeader GetReportHeaders(IRptParams filter) { ReportHeader header = new ReportHeader(); int width = 100; ListHeader headChild = header.AddChild("费用项目", new LocaleValue("费用项目")); headChild.Width = width; headChild.Mergeable = false; headChild.Visible = true; //循环添加部门 ListHeader[] listHeader = new ListHeader[depCol.Count]; for (int i = 0; i < depCol.Count; i++) { //部门 string depName = Convert.ToString(depCol[i]["FDepName"]); listHeader[i] = header.AddChild(depName, new LocaleValue(depName), SqlStorageType.SqlDecimal); listHeader[i].Width = width; listHeader[i].Mergeable = false; listHeader[i].Visible = true; } ListHeader headChildEnd = header.AddChild("合计", new LocaleValue("合计"), SqlStorageType.SqlDecimal); headChildEnd.Width = width; headChildEnd.Mergeable = false; headChildEnd.Visible = true; return(header); }
public override ReportHeader GetReportHeaders(IRptParams filter) { ReportHeader header = new ReportHeader(); ListHeader header1 = header.AddChild(); ListHeader header2 = header.AddChild(); ListHeader header3 = header.AddChild(); header1.Caption = new LocaleValue("客户名称", this.Context.UserLocale.LCID); header2.Caption = new LocaleValue("单据编码", this.Context.UserLocale.LCID); header3.Caption = new LocaleValue("提货日期", this.Context.UserLocale.LCID); // 编号 var seq = header1.AddChild("FSEQ", new LocaleValue("序号")); seq.ColIndex = 0; var materialId = header1.AddChild("FMATERIALID", new LocaleValue("物料编码")); materialId.ColIndex = 1; var name = header1.AddChild("FNAME", new LocaleValue("品名")); name.ColIndex = 2; var specifiCation = header2.AddChild("FSPECIFICATION", new LocaleValue("规格"), SqlStorageType.SqlDecimal); specifiCation.ColIndex = 3; //待定 装箱数 var packingQty = header2.AddChild("FPACKQTY ", new LocaleValue("装箱数"), SqlStorageType.SqlInt); packingQty.ColIndex = 4; var price = header2.AddChild("FTAXPRICE", new LocaleValue("含税单价"), SqlStorageType.SqlMoney); price.ColIndex = 5; var relQty = header2.AddChild("FREALQTY", new LocaleValue("实发数量"), SqlStorageType.SqlInt); relQty.ColIndex = 6; //待定 箱数 var packQty = header2.AddChild("FPACKERQTY", new LocaleValue("箱数"), SqlStorageType.SqlInt); packQty.ColIndex = 7; var produceDate = header3.AddChild("FPRODUCEDATE", new LocaleValue("生产日期"), SqlStorageType.SqlDatetime); produceDate.ColIndex = 8; //保质期 var expiryPeriod = header3.AddChild("FEXPPERIOD ", new LocaleValue("保质期"), SqlStorageType.SqlnText); expiryPeriod.ColIndex = 9; //结算金额(含税金额* 实发数量) var amount = header3.AddChild("FALLAMOUNT", new LocaleValue("结算金额"), SqlStorageType.SqlMoney); amount.ColIndex = 10; return(header); }
/// <summary> /// 双表头 /// </summary> /// <param name="headerName"></param> /// <param name="fieldDrys"></param> private void setField(string headerName, ref Dictionary <string, string> fieldDrys) { //合并表头 ListHeader lsHeader = header.AddChild(); lsHeader.Caption = new LocaleValue(headerName); foreach (KeyValuePair <string, string> fieldDry in fieldDrys) { lsHeader.AddChild(fieldDry.Key, new LocaleValue(fieldDry.Value, this.Context.UserLocale.LCID)); } fieldDrys.Clear(); }
/// <inheritdoc /> public override int GetHashCode() { unchecked { var hash = Type.GetHashCode() * 397; if (ListHeader != null) { hash ^= ListHeader.GetHashCode(); } return(hash); } }
private ReportHeader GetDimensionHeader(ReportHeader header) { ListHeader header2 = header.AddChild(); int childCount = header.GetChildCount(); header2.ColIndex = childCount + 1; header2.Caption = new LocaleValue(ResManager.LoadKDString("预算维度", "0032055000021878", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID); foreach (KeyValuePair <int, DimensionInfo> pair in this.dicDimensionInfo) { if (pair.Value.IsShowField) { header2.AddChild(pair.Value.ShowFieldName, new LocaleValue(pair.Value.Name, base.Context.UserLocale.LCID)); } } return(header); }
void PrepareViewBag(ListHeader list) { var styles = list.Competition .ResultLists .Where(r => r.AgeGroup != null) .Select(r => r.StyleStr) .Distinct() .ToList() .Select(r => new SelectListItem { Text = r.GetEnumValue <ClimbingStyles>().EnumFriendlyValue(), Value = r, Selected = (r == list.StyleStr) }) .OrderBy(s => s.Text); ViewBag.Styles = styles; var groups = Context.ResultLists .Where(l => l.CompId == list.CompId && l.StyleStr == list.StyleStr && l.AgeGroup != null) .Select(l => l.AgeGroup) .Distinct() .OrderBy(g => g.AgeGroup.ShortName) .ToList() .Select(r => new SelectListItem { Text = r.AgeGroup.ShortName, Value = r.Iid, Selected = r.Iid == list.GroupId }); ViewBag.Groups = groups; var lists = Context.ResultLists .Where(r => r.GroupId == list.GroupId && r.StyleStr == list.StyleStr) .OrderBy(r => r.CreateDate) .ToList() .Select(r => new SelectListItem { Text = r.RoundName, Value = r.Iid, Selected = r.Iid == list.Iid }); ViewBag.Lists = lists; }
/// <summary> /// 对模板进行构造,构造内容仅包括表头。 /// </summary> /// <param name="args"></param> public void Construct(ListArgs args) { if (args == null) { return; } this.args = args; Caption = args.caption; SearchModule.Visibility = args.searchable ? Visibility.Visible : Visibility.Collapsed; CreateButton.Visibility = args.createable ? Visibility.Visible : Visibility.Collapsed; //如果存在,生成创建页。 if (args.createable) { createpage = new CreateTemplate(); createpage.Construct(args.createargs); } //生成排序参数数组。 orderingconfigs = new string[args.columns.Count]; for (int i = 0; i < orderingconfigs.Length; ++i) { orderingconfigs[i] = ""; } //制作列分布配置。 gridlength = new GridLength[args.columns.Count]; for (int i = 0; i < args.columns.Count; ++i) { gridlength[i] = args.columns[i].width; } //制作表头项目并生成表头。 var headers = new UIElement[args.columns.Count]; for (int i = 0; i < args.columns.Count; ++i) { var c = args.columns[i]; var lambda_i = i;//局部闭包 var hs = c.ordering != null && c.ordering != "" ? new ListItemplateHeader(c.header, true, c.ordering, (s, a) => { orderingconfigs[lambda_i] = a.orderingname; UpdateData(); }) : new ListItemplateHeader(c.header); hs.AllFontSize = c.fontsize ?? 18; headers[i] = hs; } ListHeader.SetChildren(gridlength, headers); }
public override ReportHeader GetReportHeaders(IRptParams filter) { //int columnFilter = Convert.ToInt32(filter.FilterParameter.CustomFilter["F_TL_Combo"]); ReportHeader header = new ReportHeader(); //header.AddChild("FNUM1", new LocaleValue("序号", this.Context.UserLocale.LCID)); header.AddChild("FNAME", new LocaleValue(ColumnShowFilter(filter), this.Context.UserLocale.LCID)); ListHeader header2 = header.AddChild(); header2.Caption = new LocaleValue("汇总", this.Context.UserLocale.LCID); if ((columnFilter != 4) && (columnFilter != 5)) { header2.AddChild("FSTOCKNUM", new LocaleValue("进货数量", this.Context.UserLocale.LCID), SqlStorageType.SqlInt); header2.AddChild("FSALENUM", new LocaleValue("销售数量", this.Context.UserLocale.LCID), SqlStorageType.SqlInt); header2.AddChild("FRETURNNUM", new LocaleValue("返货数量", this.Context.UserLocale.LCID), SqlStorageType.SqlInt); } header2.AddChild("FSTOCKQUOTA", new LocaleValue("进货额", this.Context.UserLocale.LCID), SqlStorageType.SqlMoney); header2.AddChild("FSALEQUOTA", new LocaleValue("销售额", this.Context.UserLocale.LCID), SqlStorageType.SqlMoney); header2.AddChild("FRETURNQUOTA", new LocaleValue("返货额", this.Context.UserLocale.LCID), SqlStorageType.SqlMoney); header2.AddChild("FSALEPER", new LocaleValue("销售占比", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar); header2.AddChild("FRETURNPER", new LocaleValue("返货率", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar); ListHeader header3 = header.AddChild(); header3.Caption = new LocaleValue("去年同期", this.Context.UserLocale.LCID); if ((columnFilter != 4) && (columnFilter != 5)) { header3.AddChild("FSTOCKNUM_LAST", new LocaleValue("进货数量", this.Context.UserLocale.LCID), SqlStorageType.SqlInt); header3.AddChild("FSALENUM_LAST", new LocaleValue("销售数量", this.Context.UserLocale.LCID), SqlStorageType.SqlInt); header3.AddChild("FRETURNNUM_LAST", new LocaleValue("返货数量", this.Context.UserLocale.LCID), SqlStorageType.SqlInt); } header3.AddChild("FSTOCKQUOTA_LAST", new LocaleValue("进货额", this.Context.UserLocale.LCID), SqlStorageType.SqlMoney); header3.AddChild("FSALEQUOTA_LAST", new LocaleValue("销售额", this.Context.UserLocale.LCID), SqlStorageType.SqlMoney); header3.AddChild("FRETURNQUOTA_LAST", new LocaleValue("返货额", this.Context.UserLocale.LCID), SqlStorageType.SqlMoney); header3.AddChild("FSALEPER_LAST", new LocaleValue("销售占比", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar); header3.AddChild("FRETURNPER_LAST", new LocaleValue("返货率", this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar); header.AddChild("FSALEQUOTAPER", new LocaleValue("销售额同比成长", this.Context.UserLocale.LCID)); return(header); }
private void addObjectList_Click(object sender, EventArgs e) { List <ListHeader> newHeaderList = internalFile.mapData[mapListCB.SelectedIndex].headers.ToList(); ObjectEntry[] newObjectList = new ObjectEntry[1]; newObjectList[0] = new ObjectEntry(); ListHeader newListHeader = new ListHeader(); newListHeader.headerBytes = new byte[36]; newListHeader.objects = newObjectList; newHeaderList.Add(newListHeader); internalFile.mapData[mapListCB.SelectedIndex].headers = newHeaderList.ToArray(); objectListCB.BeginUpdate(); objectListCB.Items.Add("New " + objectListCB.Items.Count); objectListCB.EndUpdate(); objectListCB.SelectedIndex = objectListCB.Items.Count - 1; }
public override ReportHeader GetReportHeaders(IRptParams filter) { ReportHeader header = new ReportHeader(); header.AddChild("FLINENAME", new LocaleValue("线路", this.Context.UserLocale.LCID)); header.AddChild("FDELIVIRYROUND", new LocaleValue("配送周期", this.Context.UserLocale.LCID), SqlStorageType.SqlInt); header.AddChild("FCUSTOMER", new LocaleValue("未按配送周期客户", this.Context.UserLocale.LCID)); header.AddChild("BZPS", new LocaleValue("标准配送次数", this.Context.UserLocale.LCID)); header.AddChild("HJPSS", new LocaleValue("按标准配送次数", this.Context.UserLocale.LCID)); header.AddChild("WPSCS", new LocaleValue("未按标准配送次数", this.Context.UserLocale.LCID)); //header.AddChild("FWBZ", new LocaleValue("未按标准配送次数", this.Context.UserLocale.LCID)); //header.AddChild("FBL", new LocaleValue("比例%", this.Context.UserLocale.LCID)); ListHeader header1 = header.AddChild(); header1.Caption = new LocaleValue("配送周期", this.Context.UserLocale.LCID); for (int i = 0; i < day.Count; i++) { header1.AddChild(string.Format("f{0}", i), new LocaleValue(day[i], this.Context.UserLocale.LCID), SqlStorageType.Sqlvarchar); } return(header); }
/// <summary>All profiles on this interface</summary> /// <returns>A list of profile Informations</returns> public WlanProfileInfo[] GetProfiles() { IntPtr profileListPtr; SystemInterface.WlanGetProfileList(client.clientHandle, info.interfaceGuid, IntPtr.Zero, out profileListPtr); ListHeader header = (ListHeader)Marshal.PtrToStructure(profileListPtr, typeof(ListHeader)); WlanProfileInfo[] profileInfos = new WlanProfileInfo[header.numberOfItems]; // By the standard this is the correction start position long profileListIterator = profileListPtr.ToInt64() + Marshal.SizeOf(header); for (int i = 0; i < header.numberOfItems; ++i) { WlanProfileInfo profileInfo = (WlanProfileInfo)Marshal.PtrToStructure(new IntPtr(profileListIterator), typeof(WlanProfileInfo)); profileInfos[i] = profileInfo; profileListIterator += Marshal.SizeOf(profileInfo); } return(profileInfos); }
private ReportHeader ReportHeadersDeal(IRptParams filter) { int childCount = 0; ReportHeader header = new ReportHeader(); header.AddChild("FDEPTORG", new LocaleValue(ResManager.LoadKDString("预算组织", "0032055000021891", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); header.AddChild("FYEAR", new LocaleValue(ResManager.LoadKDString("预算年度", "0032055000021893", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); header.AddChild("FPERIOD", new LocaleValue(ResManager.LoadKDString("预算期间", "0032055000021894", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); header.AddChild("FBUSINESSTYPE", new LocaleValue(ResManager.LoadKDString("预算业务类型", "0032055000021880", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); header.AddChild("FDATATYPE", new LocaleValue(ResManager.LoadKDString("项目数据类型", "0032055000021881", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); this.GetDimensionHeader(header); if (this.filterParameter.IsStandardCurrency) { ListHeader header2 = header.AddChild(); childCount = header.GetChildCount(); header2.ColIndex = childCount + 1; header2.Caption = new LocaleValue(ResManager.LoadKDString("原币", "0032055000022021", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID); header2.AddChild("FCURRENCY", new LocaleValue(ResManager.LoadKDString("币别", "0032055000022022", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); header2.AddChild("FVALUE", new LocaleValue(ResManager.LoadKDString("预算数", "0032055000021888", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID), SqlStorageType.SqlDecimal, true); ListHeader header3 = header.AddChild(); childCount = header.GetChildCount(); header3.ColIndex = childCount + 1; header3.Caption = new LocaleValue(ResManager.LoadKDString("本位币", "0032055000022023", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID); header3.AddChild("FBWBCURRENCY", new LocaleValue(ResManager.LoadKDString("币别", "0032055000022022", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); header3.AddChild("FBASEVALUE", new LocaleValue(ResManager.LoadKDString("预算数", "0032055000021888", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID), SqlStorageType.SqlDecimal, true); } else { header.AddChild("FCURRENCY", new LocaleValue(ResManager.LoadKDString("币别", "0032055000022022", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); header.AddChild("FVALUE", new LocaleValue(ResManager.LoadKDString("预算数", "0032055000021888", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID), SqlStorageType.SqlDecimal, true); } if (this.filterParameter.IsShowAdjustDetaildata) { header.AddChild("FADJUSTTYPE", new LocaleValue(ResManager.LoadKDString("数据类型", "0032055000022024", SubSystemType.FIN, new object[0]), base.Context.UserLocale.LCID)); } return(header); }
private void addMapListButton_Click(object sender, EventArgs e) { List <MapListing> newMapData = internalFile.mapData.ToList(); ObjectEntry[] newObjectList = new ObjectEntry[1]; newObjectList[0] = new ObjectEntry(); ListHeader newListHeader = new ListHeader(); newListHeader.headerBytes = new byte[36]; newListHeader.objects = newObjectList; MapListing newMapListing = new MapListing(); newMapListing.headers = new ListHeader[] { newListHeader }; newMapData.Add(newMapListing); internalFile.mapData = newMapData.ToArray(); mapListCB.BeginUpdate(); mapListCB.Items.Add(internalFile.mapData[mapListCB.Items.Count - 1].mapNumber); mapListCB.EndUpdate(); mapListCB.SelectedIndex = mapListCB.Items.Count - 1; }
public override ReportHeader GetReportHeaders(IRptParams filter) { ReportHeader header = new ReportHeader(); int width = 80; //序号列不需要自己去构建,采用系统标准的 //ListHeader headChild1 = header.AddChild("FSEQ", new LocaleValue("序号")); //headChild1.Width = width; //headChild1.Mergeable = false; //headChild1.Visible = true; ListHeader headChild2 = header.AddChild("FCUSTNUM", new LocaleValue("客户编码")); headChild2.Width = width; headChild2.Mergeable = false; headChild2.Visible = true; ListHeader headChild3 = header.AddChild("FCUSTNAME", new LocaleValue("客户名称")); headChild3.Width = width; headChild3.Mergeable = false; headChild3.Visible = true; ListHeader headChild4 = header.AddChild("FCUSTTYPE", new LocaleValue("客户类别")); headChild4.Width = width; headChild4.Mergeable = false; headChild4.Visible = true; ListHeader headChild5 = header.AddChild("FRECCONDITION", new LocaleValue("账期")); headChild5.Width = width; headChild5.Mergeable = false; headChild5.Visible = true; //循环加入日期列 ListHeader[] listHeader = new ListHeader[months]; for (int i = 0; i < months; i++) { DateTime yearAndMonth = beginDate.AddMonths(i); //年-月 列 string columnName = string.Format("F{0}_{1}", yearAndMonth.Year, yearAndMonth.Month); string title = string.Format("{0}年{1}月", yearAndMonth.Year, yearAndMonth.Month); listHeader[i] = header.AddChild(); listHeader[i].Caption = new LocaleValue(title); listHeader[i].Width = width * 3; ListHeader headChild11 = listHeader[i].AddChild(string.Format("{0}_SO", columnName), new LocaleValue("接单"), SqlStorageType.SqlDecimal); headChild11.Width = width; headChild11.Mergeable = true; ListHeader headChild12 = listHeader[i].AddChild(string.Format("{0}_Del", columnName), new LocaleValue("出货"), SqlStorageType.SqlDecimal); headChild12.Width = width; headChild12.Mergeable = true; ListHeader headChild13 = listHeader[i].AddChild(string.Format("{0}_Rec", columnName), new LocaleValue("收汇"), SqlStorageType.SqlDecimal); headChild13.Width = width; headChild13.Mergeable = true; } ListHeader headChildEnd = header.AddChild(); headChildEnd.Caption = new LocaleValue("累计($:万元)"); headChildEnd.Width = width * 3; ListHeader headChildEnd11 = headChildEnd.AddChild("FTOTALSOAMT", new LocaleValue("接单"), SqlStorageType.SqlDecimal); headChildEnd11.Width = width; headChildEnd11.Mergeable = true; ListHeader headChildEnd12 = headChildEnd.AddChild("FTOTALDELAMT", new LocaleValue("出货"), SqlStorageType.SqlDecimal); headChildEnd12.Width = width; headChildEnd12.Mergeable = true; ListHeader headChildEnd13 = headChildEnd.AddChild("FTOTALRECAMT", new LocaleValue("收汇"), SqlStorageType.SqlDecimal); headChildEnd13.Width = width; headChildEnd13.Mergeable = true; return(header); }
/// <summary> /// Visits the <c>listheader</c> documentation element. /// </summary> /// public override void VisitListHeader(ListHeader header) { base.VisitListHeader(header); }
public override ReportHeader GetReportHeaders(IRptParams filter) { ReportHeader header = new ReportHeader(); header.Mergeable = true; //ListHeader deptName = header.AddChild(); //deptName.Caption = new LocaleValue("销售部门"); //deptName.AddChild("deptName", new LocaleValue("销售部门")); //deptName.Mergeable = true; header.AddChild("deptName", new LocaleValue("销售部门")); header.AddChild("empName", new LocaleValue("销售员")); header.AddChild("rowTypeText", new LocaleValue("类型")); header.AddChild("salesQuota", new LocaleValue("目标"), SqlStorageType.SqlInt); header.AddChild("total", new LocaleValue("合计"), SqlStorageType.SqlInt); ListHeader month_1 = header.AddChild(); month_1.Caption = new LocaleValue("1月"); month_1.AddChild("actual_1", new LocaleValue("实际"), SqlStorageType.SqlInt); month_1.AddChild("percent_1", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_2 = header.AddChild(); month_2.Caption = new LocaleValue("2月"); month_2.AddChild("actual_2", new LocaleValue("实际"), SqlStorageType.SqlInt); month_2.AddChild("percent_2", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_3 = header.AddChild(); month_3.Caption = new LocaleValue("3月"); month_3.AddChild("actual_3", new LocaleValue("实际"), SqlStorageType.SqlInt); month_3.AddChild("percent_3", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_4 = header.AddChild(); month_4.Caption = new LocaleValue("4月"); month_4.AddChild("actual_4", new LocaleValue("实际"), SqlStorageType.SqlInt); month_4.AddChild("percent_4", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_5 = header.AddChild(); month_5.Caption = new LocaleValue("5月"); month_5.AddChild("actual_5", new LocaleValue("实际"), SqlStorageType.SqlInt); month_5.AddChild("percent_5", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_6 = header.AddChild(); month_6.Caption = new LocaleValue("6月"); month_6.AddChild("actual_6", new LocaleValue("实际"), SqlStorageType.SqlInt); month_6.AddChild("percent_6", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_7 = header.AddChild(); month_7.Caption = new LocaleValue("7月"); month_7.AddChild("actual_7", new LocaleValue("实际"), SqlStorageType.SqlInt); month_7.AddChild("percent_7", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_8 = header.AddChild(); month_8.Caption = new LocaleValue("8月"); month_8.AddChild("actual_8", new LocaleValue("实际"), SqlStorageType.SqlInt); month_8.AddChild("percent_8", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_9 = header.AddChild(); month_9.Caption = new LocaleValue("9月"); month_9.AddChild("actual_9", new LocaleValue("实际"), SqlStorageType.SqlInt); month_9.AddChild("percent_9", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_10 = header.AddChild(); month_10.Caption = new LocaleValue("10月"); month_10.AddChild("actual_10", new LocaleValue("实际"), SqlStorageType.SqlInt); month_10.AddChild("percent_10", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_11 = header.AddChild(); month_11.Caption = new LocaleValue("11月"); month_11.AddChild("actual_11", new LocaleValue("实际"), SqlStorageType.SqlInt); month_11.AddChild("percent_11", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); ListHeader month_12 = header.AddChild(); month_12.Caption = new LocaleValue("12月"); month_12.AddChild("actual_12", new LocaleValue("实际"), SqlStorageType.SqlInt); month_12.AddChild("percent_12", new LocaleValue("完成百分比"), SqlStorageType.Sqlvarchar); return(header); }
private void GroupProjectsByStatus() { var listWork = Items.OrderBy(x => x.TaskScheduleCurrentState).ToList(); List <ListHeader> PositionsForInsert = new List <ListHeader>(); int previousState = -1; int TotalCurrent = 0; int TotalBehind = 0; int TotalFuture = 0; int TotalCompleted = 0; for (int x = 0; x < listWork.Count(); x++) { if (listWork[x].TaskScheduleCurrentState == 1) { TotalCurrent++; } else if (listWork[x].TaskScheduleCurrentState == 2) { TotalBehind++; } else if (listWork[x].TaskScheduleCurrentState == 3) { TotalFuture++; } else if (listWork[x].TaskScheduleCurrentState == 4) { TotalCompleted++; } if (x <= listWork.Count() - 1) { if (listWork[x].TaskScheduleCurrentState != previousState) { ListHeader header = new ListHeader(); header.Position = x; header.TaskScheduleCurrentState = listWork[x].TaskScheduleCurrentState; PositionsForInsert.Add(header); previousState = listWork[x].TaskScheduleCurrentState; } } } int counter = 0; foreach (ListHeader header in PositionsForInsert) { TaskListItem head = new TaskListItem(); //head.Icon = "Arrow_right.png"; head.Icon = "Arrow_down.png"; head.IsHeader = true; //head.IsVisible = true; head.IsItemVisible = false; head.IsExpanded = true; head.Line2Color = ConvertColorToHex((Color)Application.Current.Resources["BlackTextColor"]); switch ((TaskScheduleCurrentState)header.TaskScheduleCurrentState) { case TaskScheduleCurrentState.Current: head.Title = "Current (" + TotalCurrent + ")"; //head.Icon = "Arrow_down.png"; head.IsExpanded = true; head.TaskScheduleCurrentState = (int)TaskScheduleCurrentState.Current;; if (TotalCurrent > 0) { listWork.Insert(header.Position + counter, head); counter++; } break; case TaskScheduleCurrentState.Behind: head.Title = "Behind (" + TotalBehind + ")"; head.TaskScheduleCurrentState = (int)TaskScheduleCurrentState.Behind;; if (TotalBehind > 0) { listWork.Insert(header.Position + counter, head); counter++; } break; case TaskScheduleCurrentState.Future: head.Title = "Future (" + TotalFuture + ")"; head.TaskScheduleCurrentState = (int)TaskScheduleCurrentState.Future;; if (TotalFuture > 0) { listWork.Insert(header.Position + counter, head); counter++; } break; case TaskScheduleCurrentState.Completed: head.Title = "Completed (" + TotalCompleted + ")"; head.TaskScheduleCurrentState = (int)TaskScheduleCurrentState.Completed; if (TotalCompleted > 0) { listWork.Insert(header.Position + counter, head); counter++; } break; } } foreach (TaskListItem item in listWork) { //if (!item.IsHeader) //{ // if (item.TaskScheduleCurrentState == 1) // item.IsItemVisible = true; // else // item.IsItemVisible = false; //} CurrentItems.Add(item); } }
public void LoadWaveData(string assetPath, out float startTime, out float endTime) { WavHeader theHeader = new WavHeader(); CueHeader theCueHeader = new CueHeader(); //CuePoint theCuePoint = new CuePoint(); ListHeader theListHeader = new ListHeader(); //LabelChunk theLabelChunk = new LabelChunk(); ArrayList markerTimeList = new ArrayList(); //List<short> lDataList = new List<short>(); //List<short> rDataList = new List<short>(); startTime = -1.0f; endTime = -1.0f; uint riffProgress = 0; //using (FileStream fs = new FileStream("/Users/msweet/Desktop/Chimes_with_marker_24.wav", System.IO.FileMode.Open, System.IO.FileAccess.Read)) using (FileStream fs = new FileStream(assetPath, System.IO.FileMode.Open, System.IO.FileAccess.Read)) using (BinaryReader br = new BinaryReader(fs)) { try { OIMSDebug("Trying to load the WAV data: " + assetPath); theHeader.chunkID = br.ReadBytes(4); //riff riffProgress += 4; theHeader.size = br.ReadUInt32(); //size of the total file! riffProgress += 4; theHeader.typeID = br.ReadBytes(4); //wave or something else riffProgress += 4; //if the file is not riff and wave - then we should exit here if (System.Text.Encoding.ASCII.GetString(theHeader.chunkID) != "RIFF") { OIMSDebug("The file is not RIFF encoded!! " + System.Text.Encoding.ASCII.GetString(theHeader.chunkID) + " " + assetPath); return; } if (System.Text.Encoding.ASCII.GetString(theHeader.typeID) != "WAVE") { OIMSDebug("The file is not WAVE encoded!! " + System.Text.Encoding.ASCII.GetString(theHeader.typeID) + " " + assetPath); return; } OIMSDebug("We have a wave file - continuing on to parse the wave data."); //next we need to parse the wave data theHeader.fmtID = br.ReadBytes(4); //should equal 'fmt ' with the trailing space riffProgress += 4; theHeader.fmtSize = br.ReadUInt32(); //not sure what this should be? but equals 16 - remaining chunk length after header? riffProgress += 4; theHeader.format = br.ReadUInt16(); //not sure what this is? but equals 1? i think this defines pcm or adpcm riffProgress += 2; theHeader.channels = br.ReadUInt16(); //1 for mono, 2 for stereo etc. riffProgress += 2; theHeader.sampleRate = br.ReadUInt32(); //22050, 44100, 48000, etc. riffProgress += 4; theHeader.bytePerSec = br.ReadUInt32(); //Bytes per second = (Sample Rate * BitsPerSample * Channels) / 8. riffProgress += 4; theHeader.blockSize = br.ReadUInt16(); //Block align = (BitsPerSample * Channels) / 8 this is 1 if 8 bit mono, this is 6 if 24 bit stereo, this is 2 if 16 bit mono riffProgress += 2; theHeader.bit = br.ReadUInt16(); //bit rate e.g. 8, 16, 24 riffProgress += 2; theHeader.dataID = br.ReadBytes(4); //this should be 'data' riffProgress += 4; theHeader.dataSize = br.ReadUInt32(); //this is how much data we have riffProgress += 4; // OIMSDebug("theHeader.typeID: " + System.Text.Encoding.ASCII.GetString(theHeader.typeID)); // OIMSDebug("theHeader.fmtID: " + System.Text.Encoding.ASCII.GetString(theHeader.fmtID)); // OIMSDebug("theHeader.fmtSize: " + theHeader.fmtSize); // OIMSDebug("theHeader.format: " + theHeader.format); // OIMSDebug("theHeader.channels: " + theHeader.channels); // OIMSDebug("theHeader.sampleRate: " + theHeader.sampleRate); // OIMSDebug("theHeader.bytePerSec: " + theHeader.bytePerSec); // OIMSDebug("theHeader.blockSize: " + theHeader.blockSize); // OIMSDebug("theHeader.bit: " + theHeader.bit); // OIMSDebug("theHeader.dataID: " + System.Text.Encoding.ASCII.GetString(theHeader.dataID)); // OIMSDebug("theHeader.dataSize: " + theHeader.dataSize); for (int i = 0; i < theHeader.dataSize / theHeader.blockSize; i++) { //byte[] x = br.ReadBytes(theHeader.blockSize); br.ReadBytes(theHeader.blockSize); riffProgress = riffProgress + theHeader.blockSize; //lDataList.Add((short)br.ReadUInt16()); //rDataList.Add((short)br.ReadUInt16()); //OIMSDebug("i: " + theHeader.blockSize + " " + i); } // THEN THINGS GET WEIRD - it could be any type of chunk next, and we have to look at then one at a time bool done = false; while (!done && riffProgress <= theHeader.size) { OIMSDebug("riffProgress: " + riffProgress + " out of the full file size:" + theHeader.size + " = " + (theHeader.size - riffProgress) + " left."); //lets look at the next chunk byte[] chunkID = br.ReadBytes(4); riffProgress += 4; OIMSDebug("The chunk id is: " + System.Text.Encoding.ASCII.GetString(chunkID)); bool chunkThatWeRecognize = false; OIMSDebug("System.Text.Encoding.ASCII.GetString(chunkID).Length = " + System.Text.Encoding.ASCII.GetString(chunkID).Length); //what is it? 'bext' or 'cue ' or something else if (System.Text.Encoding.ASCII.GetString(chunkID).Substring(0, 3) == "cue") { //yay it's a cue! I know how to do that! OIMSDebug("Found cue chunk!"); theCueHeader.size = br.ReadUInt32(); //the size riffProgress += 4; theCueHeader.numberOfCuePoints = br.ReadUInt32(); //number of cue points riffProgress += 4; //OIMSDebug("1theCueHeader.chunkID: " + System.Text.Encoding.ASCII.GetString(theCueHeader.chunkID)); OIMSDebug("1theCueHeader.size: " + theCueHeader.size); OIMSDebug("1theCueHeader.numberOfCuePoints: " + theCueHeader.numberOfCuePoints); //next iterate through the cue points for (int i = 0; i < theCueHeader.numberOfCuePoints; i++) { CuePoint thisCuePoint = new CuePoint(); thisCuePoint.dataID = br.ReadUInt32(); riffProgress += 4; thisCuePoint.position = br.ReadUInt32(); riffProgress += 4; thisCuePoint.dataChunkID = br.ReadUInt32(); riffProgress += 4; thisCuePoint.chunkStart = br.ReadUInt32(); riffProgress += 4; thisCuePoint.blockStart = br.ReadUInt32(); riffProgress += 4; thisCuePoint.sampleOffset = br.ReadUInt32(); riffProgress += 4; OIMSDebug("thisCuePoint.sampleOffset: " + thisCuePoint.sampleOffset); float sampleOffset = (float)thisCuePoint.sampleOffset / (float)theHeader.sampleRate * 1000.0f; OIMSDebug("thisCuePoint.sampleOffset in msec is: " + sampleOffset); markerTimeList.Add(sampleOffset); } chunkThatWeRecognize = true; } if (System.Text.Encoding.ASCII.GetString(chunkID) == "LIST") { OIMSDebug("Found list chunk!"); theListHeader.size = br.ReadUInt32(); //the size riffProgress += 4; theListHeader.typeID = br.ReadBytes(4); //should be 'adlt' riffProgress += 4; //then we need to iterate through the data int j = 0; int k = 0; while (j < theListHeader.size) { LabelChunk thisLabelChunk = new LabelChunk(); thisLabelChunk.chunkID = br.ReadBytes(4); //should be 'labl' riffProgress += 4; OIMSDebug("thisLabelChunk.chunkID: " + System.Text.Encoding.ASCII.GetString(thisLabelChunk.chunkID)); j += 4; thisLabelChunk.size = br.ReadUInt32(); //the size riffProgress += 4; j += 4; thisLabelChunk.cuePointID = br.ReadUInt32(); riffProgress += 4; j += 4; thisLabelChunk.text = br.ReadBytes((int)thisLabelChunk.size - 4); riffProgress = riffProgress + thisLabelChunk.size - 4; OIMSDebug("thisLabelChunk.text: " + System.Text.Encoding.ASCII.GetString(thisLabelChunk.text)); string tempString = System.Text.Encoding.ASCII.GetString(thisLabelChunk.text).Trim().ToLower(); OIMSDebug("tempString: " + tempString); OIMSDebug("the length of tempString is: " + tempString.Length); if (tempString.Length > 5) { if (String.Equals(tempString.Substring(0, 5), "start")) { OIMSDebug("START TIME RETRIEVED!"); if (markerTimeList[k] != null) { startTime = (float)markerTimeList[k]; } } } if (tempString.Length > 3) { if (String.Equals(tempString.Substring(0, 3), "end")) { OIMSDebug("END TIME RETRIEVED!"); if (markerTimeList[k] != null) { endTime = (float)markerTimeList[k]; } } } j += (int)thisLabelChunk.size; k++; } chunkThatWeRecognize = true; } if (System.Text.Encoding.ASCII.GetString(chunkID) == "bext") { OIMSDebug("Found bext chunk!"); uint size = br.ReadUInt32(); riffProgress += 4; for (int i = 0; i < size; i++) { //byte[] x = br.ReadBytes(1); br.ReadBytes(1); riffProgress += 1; } chunkThatWeRecognize = true; } if (System.Text.Encoding.ASCII.GetString(chunkID) == "JUNK") { OIMSDebug("Found JUNK chunk!"); uint size = br.ReadUInt32(); riffProgress += 4; for (int i = 0; i < size; i++) { //byte[] x = br.ReadBytes(1); br.ReadBytes(1); riffProgress += 1; } chunkThatWeRecognize = true; } if (System.Text.Encoding.ASCII.GetString(chunkID) == "MLo2") { OIMSDebug("Found MLo2 chunk!"); uint size = br.ReadUInt32(); riffProgress += 4; for (int i = 0; i < size; i++) { //byte[] x = br.ReadBytes(1); br.ReadBytes(1); riffProgress += 1; } chunkThatWeRecognize = true; } if (System.Text.Encoding.ASCII.GetString(chunkID) == "acid") { OIMSDebug("Found acid chunk!"); uint size = br.ReadUInt32(); riffProgress += 4; for (int i = 0; i < size; i++) { //byte[] x = br.ReadBytes(1); br.ReadBytes(1); riffProgress += 1; } chunkThatWeRecognize = true; } if (System.Text.Encoding.ASCII.GetString(chunkID) == "dpas") { OIMSDebug("Found dpas chunk!"); uint size = br.ReadUInt32(); riffProgress += 4; for (int i = 0; i < size; i++) { //byte[] x = br.ReadBytes(1); br.ReadBytes(1); riffProgress += 1; } chunkThatWeRecognize = true; } if (System.Text.Encoding.ASCII.GetString(chunkID) == "dprn") { OIMSDebug("Found dprn chunk!"); uint size = br.ReadUInt32(); riffProgress += 4; for (int i = 0; i < size; i++) { //byte[] x = br.ReadBytes(1); br.ReadBytes(1); riffProgress += 1; } chunkThatWeRecognize = true; } if (System.Text.Encoding.ASCII.GetString(chunkID) == "fact") { OIMSDebug("Found fact chunk!"); uint size = br.ReadUInt32(); riffProgress += 4; for (int i = 0; i < size; i++) { //byte[] x = br.ReadBytes(1); br.ReadBytes(1); riffProgress += 1; } chunkThatWeRecognize = true; } if (!chunkThatWeRecognize) { done = true; } } OIMSDebug("FINAL riffProgress: " + riffProgress + " out of the full file size:" + theHeader.size + " = " + (theHeader.size - riffProgress) + " left."); } //Finally block is useful for running any code that must execute even if there is an exception. //Control is passed to the Finally block regardless of how the Try ... Catch block exits finally { if (br != null) //binary reader { br.Close(); } if (fs != null) //file stream { fs.Close(); } } } OIMSDebug("WAV File opened."); //OIMSDebug(); //Processing would happen here (passing for the time being) }
/// <summary> /// Visits the <c>listheader</c> documentation element. /// </summary> public virtual void VisitListHeader(ListHeader header) { VisitContainer(header); }
/// <summary> /// See <see cref="Visitor.VisitListHeader"/>. /// </summary> public override void VisitListHeader(ListHeader header) { if (delegates.VisitListHeader != null) delegates.VisitListHeader(header); base.VisitListHeader(header); }
/// <summary> /// Reads all supported documentation elements. /// </summary> private static IEnumerable<Element> ReadContent(XElement xml) { foreach (var node in xml.Nodes()) { var element = default(Element); switch (node.NodeType) { case System.Xml.XmlNodeType.Element: var elementNode = (XElement)node; switch (elementNode.Name.LocalName) { case "summary": element = new Summary(ReadContent(elementNode)); break; case "remarks": element = new Remarks(ReadContent(elementNode)); break; case "example": element = new Example(ReadContent(elementNode)); break; case "para": element = new Para(ReadContent(elementNode)); break; case "param": element = new Param(FindAttribute(elementNode, "name"), ReadContent(elementNode)); break; case "paramref": element = new ParamRef(FindAttribute(elementNode, "name")); break; case "typeparam": element = new TypeParam(FindAttribute(elementNode, "name"), ReadContent(elementNode)); break; case "typeparamref": element = new TypeParamRef(FindAttribute(elementNode, "name")); break; case "code": element = new Code(TrimCode(elementNode.Value)); break; case "c": element = new C(elementNode.Value); break; case "see": element = new See(FindAttribute(elementNode, "cref"), FindAttribute(elementNode, "langword"), elementNode.Value, ReadContent(elementNode)); break; case "seealso": element = new SeeAlso(FindAttribute(elementNode, "cref"), elementNode.Value, ReadContent(elementNode)); break; case "list": element = new List(FindAttribute(elementNode, "type"), ReadContent(elementNode)); break; case "listheader": element = new ListHeader(ReadContent(elementNode)); break; case "term": element = new Term(ReadContent(elementNode)); break; case "description": element = new Description(ReadContent(elementNode)); break; case "item": element = new Item(ReadContent(elementNode)); break; case "exception": element = new Exception(FindAttribute(elementNode, "cref"), ReadContent(elementNode)); break; case "value": element = new Value(ReadContent(elementNode)); break; case "returns": element = new Returns(ReadContent(elementNode)); break; default: element = new UnknownElement(elementNode, ReadContent(elementNode)); break; } break; case System.Xml.XmlNodeType.Text: element = new Text(TrimText(((XText)node).Value)); break; default: break; } if (element != null) { element.SetLineInfo(xml as IXmlLineInfo); yield return element; } } }