private static void AddModelTypes() { ListData ListRec = new ListData(); ListRec.ListType = "ITEMTYPE"; ListRec.ListDesc = "HELICOPTER"; int iItemID = App.Database.SaveListRec(ListRec); // ListRec = new ListData(); ListRec.ListType = "ITEMTYPE"; ListRec.ListDesc = "AIRPLANE"; iItemID = App.Database.SaveListRec(ListRec); // ListRec = new ListData(); ListRec.ListType = "ITEMTYPE"; ListRec.ListDesc = "QUADCOPTER"; iItemID = App.Database.SaveListRec(ListRec); // ListRec = new ListData(); ListRec.ListType = "ITEMTYPE"; ListRec.ListDesc = "CAR"; iItemID = App.Database.SaveListRec(ListRec); // ListRec = new ListData(); ListRec.ListType = "ITEMTYPE"; ListRec.ListDesc = "TRUCK"; iItemID = App.Database.SaveListRec(ListRec); }
/// <summary> /// Displays all stored queries for the user's currently selected project. /// </summary> /// <returns></returns> public ActionResult StoredQueries() { ListData data = new ListData(); ViewData["CurrentQueryId"] = Guid.Empty; return View(data); }
/// <summary> /// Searches TFS using the query provided by the 'q' parameter. /// </summary> public override ActionResult Index(string q, string sortBy, bool? desc, int? page, int? pageSize, string title, string assignedTo, string startDate, string endDate, string status) { IList<WorkItemSummary> summaries = new List<WorkItemSummary>(); ListData data = new ListData(); if (!string.IsNullOrEmpty(q)) { SearchManager manager = new SearchManager(); if (manager.IsId(q)) { // For single work item ids (that exist), redirect straight to their view page int id = int.Parse(q); QueryManager queryManager = new QueryManager(); WorkItemSummary summary = queryManager.ItemById(id); if (summary != null) { return Redirect(SpruceSettings.SiteUrl + "/" + summary.Controller + "/View/" + id); } } else { data.WorkItems = manager.Search(q).ToList(); PageList(data, sortBy, desc, page, pageSize); ViewData["search"] = q; } } return View(data); }
public ListDataListView (string sType, bool isDataEditable) { InitializeComponent(); _sListType = sType; labelListTypeAndMode.Text = "List Type: " + _sListType; // If the user is allowed to edit the data then add the menu options. if (isDataEditable) { ToolbarItem tbi = null; if (Device.OS == TargetPlatform.iOS) { ListData ListRec = new ListData(); tbi = new ToolbarItem("+", null, () => { // create a new details for a specific type. var view = new ListDataDetailsView(_sListType, ListRec); //// tell the navigator to show the new view Navigation.PushAsync(view); }, 0, 0); ToolbarItems.Add(tbi); // tbi = new ToolbarItem("Edit", null, () => { SetListTypeAndMode(); }, 0, 0); ToolbarItems.Add(tbi); } if (Device.OS == TargetPlatform.Android) { // BUG: Android doesn't support the icon being null tbi = new ToolbarItem("+", "plus", () => { ListData ListRec = new ListData(); // create a new details for a specific type. var view = new ListDataDetailsView(_sListType, ListRec); //// tell the navigator to show the new view Navigation.PushAsync(view); }, 0, 0); ToolbarItems.Add(tbi); // tbi = new ToolbarItem("Edit", null, () => { SetListTypeAndMode(); }, 0, 0); ToolbarItems.Add(tbi); } // } }
public ListDataDetailsView(string sType, ListData model) { Model = model; // InitializeComponent (); // // Save Button btnSaveLD.Clicked += (sender, e) => { // If a new List record then insert it. if (Model.ID == 0) { ListData ListRec = new ListData(); ListRec.ListType = sType; ListRec.ListDesc = Model.ListDesc; App.Database.SaveListRec(ListRec); } else { // Else update the existing record. App.Database.SaveListRec(Model); } Navigation.PopAsync(); }; // // Cancel Button btnCancelLD.Clicked += (sender, e) => { Navigation.PopAsync(); }; // // Delete button btnDeleteLD.Clicked += (sender, e) => { if (Model.ID != 0) { App.Database.DeleteListRec(Model.ID); Navigation.PopAsync(); } }; }
protected void Save_Click(object sender, EventArgs e) { ListData ttx = addresses.Find(delegate(ListData i) { return(i.Title == Address.SelectedValue); }); if (ttx == null) { return; } int ttxId = ttx.Id; if (Category.Text == " ") { Msg.Text = "Внимание! Вы забыли выбрать вид работ."; return; } using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString())) { conn.Open(); SqlCommand cmd = new SqlCommand(); DateTime date = DateTime.Now; if (Uslugy.SelectedValue == "Эксплуатация лифтов") { cmd = new SqlCommand("insert into Zayavky " + "(TtxId, LiftId, UserId, [Text], Category, [From], [Start]) " + "values (@ttxId, @liftId, (select UserId from Users where UserName=@user), @text, @c, @f, @s)", conn); cmd.Parameters.AddWithValue("ttxId", ttxId); cmd.Parameters.AddWithValue("liftId", Lift.SelectedValue); cmd.Parameters.AddWithValue("user", User.Identity.Name); cmd.Parameters.AddWithValue("text", Text.Text); if (_role == "ODS_tsg") { cmd.Parameters.AddWithValue("c", Category.SelectedValue); } else { cmd.Parameters.AddWithValue("c", "заявка"); } if (_role == "ODS_tsg") { cmd.Parameters.AddWithValue("f", "ОДС"); } else { cmd.Parameters.AddWithValue("f", "менеджер"); } cmd.Parameters.AddWithValue("s", date); cmd.ExecuteNonQuery(); cmd = new SqlCommand("select z.Id from Zayavky z " + "join Users u on z.UserId=u.UserId " + "where u.UserName=@user and z.LiftId=@liftId and [Start]=@s", conn); cmd.Parameters.AddWithValue("liftId", Lift.SelectedValue); cmd.Parameters.AddWithValue("user", User.Identity.Name); cmd.Parameters.AddWithValue("s", date); id = int.Parse(cmd.ExecuteScalar().ToString()); } //Блок записи в базу событий //подготовка cmd = new SqlCommand("select ui.Family, ui.IO from UserInfo ui " + "join Users u on u.UserId=ui.UserId where u.UserName=@userName", conn); cmd.Parameters.AddWithValue("userName", User.Identity.Name); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { fam = dr[0].ToString(); } io = dr[1].ToString(); dr.Close(); cmd = new SqlCommand("select LiftId, IdU, IdM from Lifts " + "where LiftId=@lift", conn); cmd.Parameters.AddWithValue("lift", Lift.SelectedValue); dr = cmd.ExecuteReader(); if (dr.Read()) { u = dr[1].ToString(); m = dr[2].ToString(); } dr.Close(); // запись события в базу string s = ""; if (Uslugy.SelectedValue == "Эксплуатация лифтов" & Workers.SelectedValue != " ") { s = "insert into Events (EventId, RegistrId, DataId, ZayavId, Sourse, Family, IO, TypeId, IdU, IdM, LiftId, ToApp, DateToApp, Address) " + "values (@text, @reg, @s, @id, @f, @fam, @io, @c, @u, @m, @liftid, @toapp, @ta, @adr)"; } else if (Uslugy.SelectedValue == "Эксплуатация лифтов" & Workers.SelectedValue == " ") { s = "insert into Events (EventId, RegistrId, DataId, ZayavId, Sourse, Family, IO, TypeId, IdU, IdM, LiftId, ToApp, Address) " + "values (@text, @reg, @s, @id, @f, @fam, @io, @c, @u, @m, @liftid, @toapp, @adr)"; } else if (Uslugy.SelectedValue != "Эксплуатация лифтов" & (!string.IsNullOrEmpty(Text2.Text))) { s = "insert into Events (EventId, RegistrId, DataId, Sourse, Family, IO, TypeId, IdU, IdM, LiftId, ToApp, DateToApp, Address) " + "values (@text, @reg, @s, @f, @fam, @io, @c, @u, @m, @liftid, @toapp, @ta, @adr)"; } else if (Uslugy.SelectedValue != "Эксплуатация лифтов" & (string.IsNullOrEmpty(Text2.Text))) { s = "insert into Events (EventId, RegistrId, DataId, Sourse, Family, IO, TypeId, IdU, IdM, LiftId, ToApp, Address) " + "values (@text, @reg, @s, @f, @fam, @io, @c, @u, @m, @liftid, @toapp, @adr)"; } cmd = new SqlCommand(s, conn); cmd.Parameters.AddWithValue("text", Text.Text); cmd.Parameters.AddWithValue("s", date); if (Uslugy.SelectedValue == "Эксплуатация лифтов") { cmd.Parameters.AddWithValue("toapp", Workers.SelectedValue); } else { cmd.Parameters.AddWithValue("toapp", Text2.Text); } if (Text2.Text != " " || Workers.SelectedValue != " ") { cmd.Parameters.AddWithValue("ta", date); } cmd.Parameters.AddWithValue("f", Text1.Text); cmd.Parameters.AddWithValue("id", id); cmd.Parameters.AddWithValue("fam", User.Identity.Name); cmd.Parameters.AddWithValue("reg", Uslugy.SelectedValue); cmd.Parameters.AddWithValue("io", FIO.SelectedValue); cmd.Parameters.AddWithValue("c", Category.SelectedValue); cmd.Parameters.AddWithValue("adr", Address.SelectedValue); cmd.Parameters.AddWithValue("u", u); cmd.Parameters.AddWithValue("m", m); if (Uslugy.SelectedValue == "Эксплуатация лифтов") { cmd.Parameters.AddWithValue("liftId", Lift.SelectedValue); } else { cmd.Parameters.AddWithValue("liftId", TextArea.Text); } cmd.ExecuteNonQuery(); // номер записанного события cmd = new SqlCommand("select e.Id from Events e" + " where e.ZayavId=@i", conn); cmd.Parameters.AddWithValue("i", id); SqlDataReader de = cmd.ExecuteReader(); while (de.Read()) { _wz = de[0].ToString(); } dr.Close(); _nev = _wz; _id = id.ToString(); try { //Сообщения на Email и почту KOS.App_Code.Mail mail = new Mail(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); mail.SendMsg(Lift.SelectedValue, int.Parse(id.ToString())); } catch { Msg.Text = "Сбой почтовой службы! Регистрация услуг ТСЖ выполнена. "; } // sms if (Category.SelectedValue == "застревание" || Category.SelectedValue == "останов") { pr = "2345"; string wn = "9269338001"; string str = User.Identity.Name; if (str == "ODS_Emica") { wn = "9269338001"; } else if (str == "ODS13" || Address.Text == "пр. Вернадского, 94 -1" || Address.Text == "пр. Вернадского, 94 -2" || Address.Text == "пр. Вернадского, 94 -3" || Address.Text == "пр. Вернадского, 94 -4" || Address.Text == "пр. Вернадского, 94 -5") { wn = "9268976775"; } else if (str == "ODS14" || Address.Text == "пр. Вернадского, 92") { wn = "9253135718"; } else if (str == "ODS21" || Address.Text == "ул. Никольская, д.12") { wn = "9264610904"; } else if (str == "ODS22" || Address.Text == "ул. Никольская, д.10") { wn = "9296758809"; } else if (str == "ODS25" || Address.Text == "Хилков пер. 1") { wn = "9264610904"; } else if (str == "ODS41" || Address.Text == "ул. Ясная, д. 7" || Address.Text == "ул. Жасминовая, д. 7") { wn = "9267270995"; } else if (str == "ODS42" || Address.Text == "ул. Ясная, д. 5" || Address.Text == "ул. Жасминовая, д. 5" || Address.Text == "ул. Ясная, д. 6" || Address.Text == "ул. Жасминовая, д. 6") { wn = "9629908871"; } else if (str == "ODS_test") { wn = "9264062614"; } string nomer = wn; string TextSms = Category.SelectedValue + "-адрес:" + Address.SelectedItem.Value + "-" + "лифт №:" + Lift.SelectedValue + ", отправьте " + pr + " " + _wz + " на 89037676333 о принятии"; // отправка смс SMS.ru- string myApiKey = "27B482E1-14AE-ACFB-C500-CCEC9C763C99"; // API ключ SmsRu.SmsRu sms = new SmsRu.SmsRu(myApiKey); // Основная рассылка var response = sms.Send(nomer, TextSms); // отправка смс ЛоджикТелеком CookieContainer cookie = new CookieContainer(); TelAccess soapclient = new TelAccess(); soapclient.CookieContainer = cookie; // Init session InputLogon Param1 = new InputLogon(); Param1.userName = "******"; Param1.password = "******"; ReturnValueBase rv1 = soapclient.logon(Param1); if (rv1.errorCode != 0) { throw new Exception(rv1.errorDescription); } // Send simple sms InputSendSimpleSms Param2 = new InputSendSimpleSms(); Param2.sender = "ClientInfo"; Param2.phone = "79269338001"; Param2.text = TextSms; Param2.allowSince = 0; Param2.allowSinceSpecified = false; Param2.allowTill = 0; Param2.allowTillSpecified = false; Param2.usePhoneTimeSpecified = false; ReturnValueString rv2 = soapclient.sendSimpleSms(Param2); if (rv2.errorCode != 0) { throw new Exception(rv2.errorDescription); } else { Msg.Text = "СМС отправлено id: " + rv2.strResult; } // Close session soapclient.logoff(); // конец блока отправки смс ЛоджикТелеком // Msg.Text = AsyncMethod.GetPost().ToString(); // Task.Run(() => PostRequestAsync()); // Msg.Text = GetPostSms().ToString(); } Msg.Text = "Регистрация выполнена, отправлено сообщение на e-mail Менеджеру и СМС Дежурному механику. "; // + Для связи с Дежурной службой нажмите кнопку сайтофона. Response.Redirect("~/Reg_tsg.aspx"); } }
/// <summary> /// Displays an RSS feed containing the current issues for the user's currently selected project. /// </summary> public ActionResult Rss(string projectName, string areaPath, string iterationPath, string filter) { ListData data = FilterAndPage <IssueSummary>(new FilterOptions(), projectName, "CreatedDate", true, 1, 10000); return(Rss(data.WorkItems, "Issues", projectName, areaPath, iterationPath, filter)); }
/// <summary> /// Attempts to parse a list item marker (bullet or enumerated). /// On success, returns length of the marker, and populates /// data with the details. On failure, returns 0. /// </summary> /// <remarks>Original: int parse_list_marker(string ln, int pos, ref ListData dataptr)</remarks> private static int ParseListMarker(string ln, int pos, bool interruptsParagraph, out ListData data) { char c; int startpos; data = null; var len = ln.Length; startpos = pos; c = ln[pos]; if (c == '+' || c == '•' || ((c == '*' || c == '-') && 0 == Scanner.scan_thematic_break(ln, pos, len))) { pos++; if (pos == len || !Utilities.IsWhitespace(ln[pos])) { return(0); } if (interruptsParagraph && Scanner.scan_spacechars(ln, pos + 1, ln.Length) == ln.Length - pos - 1) { return(0); } data = new ListData(); data.BulletChar = c; data.Start = 1; } else if (c >= '0' && c <= '9') { int start = c - '0'; while (pos < len - 1) { c = ln[++pos]; // We limit to 9 digits to avoid overflow, This also seems to be the limit for 'start' in some browsers. if (c >= '0' && c <= '9' && start < 100000000) { start = start * 10 + (c - '0'); } else { break; } } if (pos >= len - 1 || (c != '.' && c != ')')) { return(0); } pos++; if (pos == len || !Utilities.IsWhitespace(ln[pos])) { return(0); } if (interruptsParagraph && (start != 1 || Scanner.scan_spacechars(ln, pos + 1, ln.Length) == ln.Length - pos - 1)) { return(0); } data = new ListData(); data.ListType = ListType.Ordered; data.BulletChar = '\0'; data.Start = start; data.Delimiter = (c == '.' ? ListDelimiter.Period : ListDelimiter.Parenthesis); } else { return(0); } return(pos - startpos); }
public UISmartObjectListWithCheckboxIcons(SmartObject smartObject, ListData listData, BoolInputSig enableJoin, BoolInputSig visibleJoin) : base(smartObject, listData, enableJoin, visibleJoin) { }
private void LoadDataIntoGridView() { ListData.LoadDataIntoDataGridView(StudentDataGridView, "usp_StudentGetStudent"); }
private void LoadData() { ListData.LoadData(EmployeesDataGridView, "Employees_GetAllEmployees"); }
public bool Parse(ParserContext context, Subject subject) { var saved = subject.Save(); var indent = subject.AdvanceWhile(' ', 3); var ok = false; var spacesAfterMarker = 0; var data = new ListData(); var length = 0; if (subject.Char == '*' || subject.Char == '+' || subject.Char == '-') { data.Type = "Bullet"; data.BulletChar = subject.Char; subject.Advance(); length += 1; ok = true; } else if (Patterns.Digits.Contains(subject.Char)) { var start = subject.TakeWhile(c => Patterns.Digits.Contains(c)); length += start.Length; if (subject.Char == '.' || subject.Char == ')') { data.Type = "Ordered"; data.Start = int.Parse(start); data.Delimiter = subject.Char; subject.Advance(); length += 1; ok = true; } } spacesAfterMarker = subject.AdvanceWhile(' '); if (!ok || spacesAfterMarker == 0 && !subject.EndOfString) { saved.Restore(); return(false); } data.Padding = length + spacesAfterMarker; if (spacesAfterMarker >= 5 || spacesAfterMarker < 1 || subject.EndOfString) { data.Padding = data.Padding - spacesAfterMarker + 1; } saved.Restore(); subject.AdvanceToFirstNonSpace(data.Padding); // list item data.MarkerOffset = indent; var list = context.Container as List; // add the list if needed if (list == null || !list.Data.Matches(data)) { context.AddBlock(new List { Data = data }); } // add the list item context.AddBlock(new ListItem { Data = data }); return(true); }
protected void SaveData() { this.Data.Objects.ClearData(this.obj); foreach (Control ctrl in this.controls) { Field field = (Field)ctrl.Tag; switch (field.FieldType) { case FieldType.Boolean: KryptonCheckBox check = (KryptonCheckBox)ctrl; this.obj[field] = check.Checked; break; case FieldType.Date: KryptonDateTimePicker date = (KryptonDateTimePicker)ctrl; if (date.Checked) { this.obj[field] = date.Value; } else { this.obj[field] = DateTime.MinValue; } break; case FieldType.Image: if (ctrl is ImageSelectBase) { this.obj[field] = ((ImageSelectBase)ctrl).CreateImageData(); } break; case FieldType.List: ListData ld = (ListData)this.obj[field]; foreach (ObjectData od in ((ListBoxControl)ctrl).ListData) { ld.Objects.Add(od); } break; case FieldType.Memo: KryptonTextBox memo = (KryptonTextBox)ctrl; this.obj[field] = memo.Text; break; case FieldType.Number: TextBoxNumber num = (TextBoxNumber)ctrl; this.obj[field] = num.Value; break; case FieldType.Rating: TextBoxNumber raiting = (TextBoxNumber)ctrl; this.obj[field] = raiting.Value; break; case FieldType.Reference: KryptonComboBox box = (KryptonComboBox)ctrl; if (box.SelectedIndex == -1) { this.obj[field] = 0; } else { this.obj[field] = (ObjectData)box.SelectedItem; } break; case FieldType.Select: KryptonComboBox selectBox = ctrl as KryptonComboBox; this.obj[field] = selectBox.SelectedIndex; break; case FieldType.Text: KryptonTextBox text = ctrl as KryptonTextBox; this.obj[field] = text.Text; break; case FieldType.Url: KryptonTextBox url = ctrl as KryptonTextBox; this.obj[field] = url.Text; break; case FieldType.Table: this.obj[field] = ((TableControl)ctrl).CreateTableData(); break; } } foreach (Field f in this.updatedFields.Keys) { this.obj[f] = this.updatedFields[f]; } if (obj.IsNew) { database.Objects.Add(this.obj); } else { database.Objects.Update(this.obj); } }
public void Apply(ListTable rglst) { _writer.WriteStartElement("w", "numbering", OpenXmlNamespaces.WordprocessingML); for (int i = 0; i < rglst.Count; i++) { ListData lstf = rglst[i]; //start abstractNum _writer.WriteStartElement("w", "abstractNum", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "abstractNumId", OpenXmlNamespaces.WordprocessingML, i.ToString()); //nsid _writer.WriteStartElement("w", "nsid", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, String.Format("{0:X8}", lstf.lsid)); _writer.WriteEndElement(); //multiLevelType _writer.WriteStartElement("w", "multiLevelType", OpenXmlNamespaces.WordprocessingML); if (lstf.fHybrid) { _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, "hybridMultilevel"); } else if (lstf.fSimpleList) { _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, "singleLevel"); } else { _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, "multilevel"); } _writer.WriteEndElement(); //template _writer.WriteStartElement("w", "tmpl", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, String.Format("{0:X8}", lstf.tplc)); _writer.WriteEndElement(); //writes the levels for (int j = 0; j < lstf.rglvl.Length; j++) { ListLevel lvl = lstf.rglvl[j]; _writer.WriteStartElement("w", "lvl", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "ilvl", OpenXmlNamespaces.WordprocessingML, j.ToString()); //starts at _writer.WriteStartElement("w", "start", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, lvl.iStartAt.ToString()); _writer.WriteEndElement(); //number format _writer.WriteStartElement("w", "numFmt", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, GetNumberFormat(lvl.nfc)); _writer.WriteEndElement(); //suffix _writer.WriteStartElement("w", "suff", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, lvl.ixchFollow.ToString()); _writer.WriteEndElement(); //style //The style id is used for a reverse reference. //It can happen that the reference points to the wrong style. Int16 styleIndex = lstf.rgistd[j]; if (styleIndex != ListData.ISTD_NIL) { _writer.WriteStartElement("w", "pStyle", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, StyleSheetMapping.MakeStyleId(_ctx.Doc.Styles.Styles[styleIndex])); _writer.WriteEndElement(); } //Number level text _writer.WriteStartElement("w", "lvlText", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, getLvlText(lvl.xst)); _writer.WriteEndElement(); //jc _writer.WriteStartElement("w", "lvlJc", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, ((LevelJustification)lvl.jc).ToString()); _writer.WriteEndElement(); //pPr lvl.grpprlPapx.Convert(new ParagraphPropertiesMapping(_writer, _ctx, _parentDoc, null)); //rPr lvl.grpprlChpx.Convert(new CharacterPropertiesMapping(_writer, _parentDoc, new RevisionData(lvl.grpprlChpx), lvl.grpprlPapx, false)); _writer.WriteEndElement(); } //end abstractNum _writer.WriteEndElement(); } //write the overrides for (int i = 0; i < _ctx.Doc.ListFormatOverrideTable.Count; i++) { ListFormatOverride lfo = _ctx.Doc.ListFormatOverrideTable[i]; //start num _writer.WriteStartElement("w", "num", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "numId", OpenXmlNamespaces.WordprocessingML, (i + 1).ToString()); int index = FindIndexbyId(rglst, lfo.lsid); _writer.WriteStartElement("w", "abstractNumId", OpenXmlNamespaces.WordprocessingML); _writer.WriteAttributeString("w", "val", OpenXmlNamespaces.WordprocessingML, index.ToString()); _writer.WriteEndElement(); _writer.WriteEndElement(); } _writer.WriteEndElement(); _writer.Flush(); }
public void DoClearList(object itemString) { ListData.Clear(); }
private void LoadData() { ListData.LoadData(BranchesDataGridView, "Branches_GetAllBranches"); }
protected virtual void VisitList(ListData listData, Block firstChild) { Accept(firstChild); }
private void LoadDataIntoGridView() { ListData.LoadDataIntoGridView(EmployeesDataGridView, "usp_EmployeesGetEmployee"); }
public int SaveListRec(ListData ListRec) { lock (locker) { if (ListRec.ID != 0) { database.Update(ListRec); return ListRec.ID; } else { return database.Insert(ListRec); } } }
public void Add(ListData <K, V> data) { Add(data.Cursor, data.Value); }
public void Dispose() { _tasksLiveQuery.Stop(); ListData.Clear(); }
public async void init() { try { if (listdata != null) { listdata.Clear(); } SongListView.Items.Clear(); SongListView.ItemsSource = null; } catch (Exception) { } try { SongListView.ItemClick -= SongListView_ItemClick; } catch (Exception) { } Class.MediaControl.GetCurrent().CurrentStateChanged += MediaCurrentChanged; list = await Class.Model.PlayList.GetPlayList(); if (list != null) { switch (list.cyc) { case Class.Model.PlayList.cycling.单曲循环: Cyc_Btn.Icon = new SymbolIcon(Symbol.RepeatOne); break; case Class.Model.PlayList.cycling.列表循环: Cyc_Btn.Icon = new SymbolIcon(Symbol.RepeatAll); break; case Class.Model.PlayList.cycling.随机播放: Cyc_Btn.Icon = new SymbolIcon(Symbol.Shuffle); break; default: break; } if (list.SongList != null) { if (list.SongList.Count > 0) { listdata = new List <ListData>(); listdata.Clear(); SongListView.Items.Clear(); SongListView.ItemsSource = null; for (int i = 0; i < list.SongList.Count; i++) { var data = new ListData() { singername = list.SongList[i].singername, songname = list.SongList[i].title, num = (i + 1).ToString() }; if (list.nowplay == i) { data.isplay = "Visible"; } else { data.isplay = "Collapsed"; } listdata.Add(data); SongListView.Items.Add(data); } SongListView.SelectedIndex = list.nowplay; SongListView.IsItemClickEnabled = true; SongListView.ItemClick += SongListView_ItemClick; } } } }
public void OnGUI() { // Create our data if we have none. if (_listData == null) { //Debug.Log("no asset file found, need to reload"); _listData = AssetDatabase.LoadAssetAtPath(_listDataAssetPath, typeof(ListData)) as ListData; if (_listData == null) { //Debug.Log("no asset file found, could not reload"); _listData = ScriptableObject.CreateInstance(typeof(ListData)) as ListData; System.IO.Directory.CreateDirectory(Application.dataPath + _listDataDirectory); AssetDatabase.CreateAsset(_listData, _listDataAssetPath); GUI.changed = true; } } // display the filter fields string[] owners = new string[_listData.owners.Count + 1]; string[] ownersToSelect = new string[_listData.owners.Count]; owners[0] = "All Tasks"; for (int i = 0; i < _listData.owners.Count; i++) { owners[i + 1] = _listData.owners[i].name; ownersToSelect[i] = _listData.owners[i].name; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Show tasks:", EditorStyles.boldLabel); _currentOwnerIndex = EditorGUILayout.Popup(_currentOwnerIndex, owners); EditorGUILayout.EndHorizontal(); // display the list GUIStyle itemStyle = new GUIStyle(EditorStyles.wordWrappedMiniLabel); itemStyle.alignment = TextAnchor.UpperLeft; _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition); int displayCount = 0; for (int i = 0; i < _listData.items.Count; i++) { ListItem item = _listData.items[i]; ListItemOwner owner = item.owner; if (_currentOwnerIndex == 0) { itemStyle.normal.textColor = owner.color; if (item.isComplete == false) { displayCount++; EditorGUILayout.BeginHorizontal(); if (EditorGUILayout.Toggle(item.isComplete, GUILayout.Width(20)) == true) { _listData.items[i].isComplete = true; } _listData.items[i].task = EditorGUILayout.TextField(item.task, itemStyle); int newOwnerIndex = EditorGUILayout.Popup(owner.index, ownersToSelect, GUILayout.Width(60)); if (newOwnerIndex != owner.index) { item.owner = _listData.owners[newOwnerIndex]; _listData.items[i] = item; } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } } else { int adjustedIndex = _currentOwnerIndex - 1; owner = _listData.owners[adjustedIndex]; if (owner.name == item.owner.name) { itemStyle.normal.textColor = owner.color; if (item.isComplete == false) { displayCount++; EditorGUILayout.BeginHorizontal(); if (EditorGUILayout.Toggle(item.isComplete, GUILayout.Width(20)) == true) { _listData.items[i].isComplete = true; } _listData.items[i].task = EditorGUILayout.TextField(item.task, itemStyle); int newOwnerIndex = EditorGUILayout.Popup(adjustedIndex, ownersToSelect, GUILayout.Width(60)); if (newOwnerIndex != adjustedIndex) { item.owner = _listData.owners[newOwnerIndex]; _listData.items[i] = item; } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } } } } if (displayCount == 0) { EditorGUILayout.LabelField("No tasks currently", EditorStyles.largeLabel); } if ((showCompletedTasks) && (_currentOwnerIndex == 0)) { itemStyle.normal.textColor = Color.grey; for (int i = 0; i < _listData.items.Count; i++) { if (_listData.items[i].isComplete == true) { ListItem item = _listData.items[i]; EditorGUILayout.BeginHorizontal(); if (EditorGUILayout.Toggle(item.isComplete, GUILayout.Width(20)) == false) { _listData.items[i].isComplete = false; } EditorGUILayout.LabelField(item.task, itemStyle); if (GUILayout.Button("x", GUILayout.Width(23))) { _listData.items.RemoveAt(i); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } } } EditorGUILayout.EndScrollView(); // display our task creation area EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Create Task:", EditorStyles.boldLabel); _newTaskOwnerIndex = EditorGUILayout.Popup(_newTaskOwnerIndex, ownersToSelect, GUILayout.Width(60)); EditorGUILayout.EndHorizontal(); _newTask = EditorGUILayout.TextField(_newTask, GUILayout.Height(40)); if ((GUILayout.Button("Create Task") && _newTask != "")) { // create new task ListItemOwner newOwner = _listData.owners[_newTaskOwnerIndex]; _listData.AddTask(newOwner, _newTask); //EditorUtility.DisplayDialog("Task created for " + newOwner.name, _newTask, "Sweet"); _newTask = ""; GUI.FocusControl(null); } if (GUI.changed) { //Debug.Log("Save Data: " + _listData.items.Count); EditorUtility.SetDirty(_listData); AssetDatabase.SaveAssets(); AssetDatabase.SaveAssets(); } }
/// <summary> /// Displays a list of <see cref="WorkItemSummary"/> objects for the stored query with the given id. This /// action also pages and sorts an existing list. /// </summary> public ActionResult StoredQuery(Guid? id, string sortBy, bool? desc, int? page, int? pageSize) { if (!id.HasValue) return RedirectToAction("StoredQueries"); Guid queryId = id.Value; QueryManager manager = new QueryManager(); ListData data = new ListData(); data.WorkItems = manager.StoredQuery(queryId); PageList(data, sortBy, desc, page, pageSize); ViewData["CurrentQueryId"] = queryId; return View("StoredQueries", data); }
public void AddListItem(ListData listData) { listDatas.Add(listData); listData.index = listDatas.Count - 1; InitList(); }
public ListObjectTreeItem CreateListTreeItem(params ObjectTreeItem[] children) { var data = new ListData("tn", children.Select(c => c.Source).ToArray()); return(new ListObjectTreeItem(null, "pn", data, depth: 0)); }
public ListInfo(ListData listData, int columnIndex) { ListData = listData; ColumnIndex = columnIndex; }
public bool Matches(ListData other) { return other.Type == Type && other.Delimiter == Delimiter && other.BulletChar == BulletChar; }
protected void Save_Click(object sender, EventArgs e) { ListData ttx = addresses.Find(delegate(ListData i) { return(i.Title == Address.SelectedValue); }); if (ttx == null) { return; } int ttxId = ttx.Id; if (Category.Text == " ") { Msg.Text = "Внимание! Вы забыли выбрать вид работ."; return; } using (SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString())) { conn.Open(); DateTime date = DateTime.Now; SqlCommand cmd = new SqlCommand("insert into Zayavky " + "(TtxId, LiftId, UserId, [Text], Category, [From], [Start]) " + "values (@ttxId, @liftId, (select UserId from Users where UserName=@user), @text, @c, @f, @s)", conn); cmd.Parameters.AddWithValue("ttxId", ttxId); cmd.Parameters.AddWithValue("liftId", Lift.SelectedValue); cmd.Parameters.AddWithValue("user", User.Identity.Name); cmd.Parameters.AddWithValue("text", Text.Text); if (_role == "ODS") { cmd.Parameters.AddWithValue("c", Category.SelectedValue); } else { cmd.Parameters.AddWithValue("c", "заявка"); } if (_role == "ODS") { cmd.Parameters.AddWithValue("f", "ОДС"); } else { cmd.Parameters.AddWithValue("f", "менеджер"); } cmd.Parameters.AddWithValue("s", date); cmd.ExecuteNonQuery(); cmd = new SqlCommand("select z.Id from Zayavky z " + "join Users u on z.UserId=u.UserId " + "where u.UserName=@user and z.LiftId=@liftId and [Start]=@s", conn); cmd.Parameters.AddWithValue("liftId", Lift.SelectedValue); cmd.Parameters.AddWithValue("user", User.Identity.Name); cmd.Parameters.AddWithValue("s", date); int id = int.Parse(cmd.ExecuteScalar().ToString()); //Блок записи в базу событий cmd = new SqlCommand("select ui.Family, ui.IO from UserInfo ui " + "join Users u on u.UserId=ui.UserId where u.UserName=@userName", conn); cmd.Parameters.AddWithValue("userName", User.Identity.Name); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { fam = dr[0].ToString(); } io = dr[1].ToString(); dr.Close(); cmd = new SqlCommand("select LiftId, IdU, IdM from Lifts " + "where LiftId=@lift", conn); cmd.Parameters.AddWithValue("lift", Lift.SelectedValue); dr = cmd.ExecuteReader(); if (dr.Read()) { u = dr[1].ToString(); m = dr[2].ToString(); } dr.Close(); cmd = new SqlCommand("insert into Events" + "(EventId, RegistrId, DataId, ZayavId, Sourse, Family, IO, TypeId, IdU, IdM, LiftId, Address) " + "values (@text, @reg, @s, @id, @f, @fam, @io, @c, @u, @m, @liftid, @adr)", conn); cmd.Parameters.AddWithValue("text", Text.Text); cmd.Parameters.AddWithValue("reg", "Эксплуатация лифтов"); cmd.Parameters.AddWithValue("s", date); cmd.Parameters.AddWithValue("id", id); if (_role == "ODS") { cmd.Parameters.AddWithValue("f", "оператор ОДС"); } else { cmd.Parameters.AddWithValue("f", "менеджер"); } cmd.Parameters.AddWithValue("fam", fam); cmd.Parameters.AddWithValue("io", io); cmd.Parameters.AddWithValue("c", Category.SelectedValue); cmd.Parameters.AddWithValue("u", u); cmd.Parameters.AddWithValue("m", m); cmd.Parameters.AddWithValue("liftId", Lift.SelectedValue); cmd.Parameters.AddWithValue("adr", Address.SelectedValue); cmd.ExecuteNonQuery(); KOS.App_Code.Mail mail = new Mail(WebConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()); mail.SendMsg(Lift.SelectedValue, int.Parse(id.ToString())); // SMail.SendMail("smtp.office365.ru","*****@*****.**", "pass","*****@*****.**", "фото", "Фото в присоединенном файле.", "C:\\temp\\uploads\\1.jpg"); //sms response string wn = ""; string str = User.Identity.Name; if (str == "ODS11" || str == "ODS12" || str == "ODS15") { wn = "9253135718"; } else if (str == "ODS21" || str == "ODS22" || str == "ODS23" || str == "ODS31" || str == "ODS32") { wn = "9264610904"; } else if (str == "ODS13") { wn = "9268976775"; } else if (str == "ODS14") { wn = "9253135718"; } else if (str == "ODS41" || str == "ODS42") { wn = "9629908871"; } //else if (str == "Cadry" || str == "Emica") wn = "9624062614"; string nomer = wn; string TextSms = Category.SelectedValue + "-адрес:" + Address.SelectedItem.Value + "-" + "лифт№:" + Lift.SelectedValue + "-" + Text.Text + "-отправил: " + User.Identity.Name; string myApiKey = "27B482E1-14AE-ACFB-C500-CCEC9C763C99"; //Ваш API ключ SmsRu.SmsRu sms = new SmsRu.SmsRu(myApiKey); // Основная рассылка var response = sms.Send(nomer, TextSms); /* string wn2 = ""; * if (str == "ODS11" || str == "ODS12" || str == "ODS15") wn2 = "9684495099"; * else if (str == "ODS21" || str == "ODS22" || str == "ODS23" || str == "ODS24" || str == "ODS31" || str == "ODS32") wn2 = "9296758809"; * else if (str == "ODS13") wn2 = "9689534417"; * else if (str == "ODS14") wn2 = "9684495099"; * else if (str == "ODS41" || str == "ODS42") wn2 = "9267270995"; * string nomer2 = wn2; * string TextSms2 = "#" + Category.SelectedValue + "-адрес:" + Address.SelectedItem.Value + "-" + "лифт№:" + Lift.SelectedValue + "-" + Text.Text + "-отправил: " + User.Identity.Name; * SmsRu.SmsRu sms2 = new SmsRu.SmsRu(myApiKey);// Дублирующая рассылка * var response2 = sms2.Send(nomer2, TextSms2); */ Msg.Text = "Регистрация выполнена, отправлено сообщение на e-mail менеджеру и СМС Дежурному механику. Для связи с Дежурной службой нажмите кнопку сайтофона."; Response.Redirect("~/Reg_ods.aspx"); } } // конец блока регистрации *****
public void Interpret(Data d, SQLiteConnection conn) { if (d.Type != ECollectorType.Ping) { return; } if (d is ListData <PingResult> ) { ListData <PingResult> data = d as ListData <PingResult>; Dictionary <string, string> ip_to_name_map = new Dictionary <string, string>(); string sql = "SELECT IPAddress, Name FROM Devices WHERE DateDisabled IS NULL;"; using (SQLiteCommand command = new SQLiteCommand(sql, conn)) using (SQLiteDataReader reader = command.ExecuteReader()) { while (reader.Read()) { if (reader.IsDBNull(0) == false) { ip_to_name_map[reader.GetString(0)] = reader.GetString(1); } } } foreach (PingResult result in data.Data) { try { string ip = result.Address.ToString(); string name = ip; if (ip_to_name_map.ContainsKey(ip)) { name = ip_to_name_map[ip]; } sql = $"SELECT IPAddress FROM NetworkStatus WHERE IPAddress = '{ip}';"; Changer changer = null; bool existing = false; using (SQLiteCommand command = new SQLiteCommand(sql, conn)) using (SQLiteDataReader reader = command.ExecuteReader()) { if (reader.Read()) { // It already exists--update the status and name in case it's been changed existing = true; changer = new Updater("NetworkStatus", $"IPAddress = '{ip}'", conn); } else { changer = new Inserter("NetworkStatus", conn); changer.Set("IPAddress", ip, false); } if (changer != null) { changer.Set("Name", name, false); changer.Set("SuccessfulPing", result.IsPingable ? 1 : 0); changer.Set("DatePingAttempted", data.CollectedAt); if (result.IsPingable) { changer.Set("DateSuccessfulPingOccurred", data.CollectedAt); } else if (!existing) { // It's new, and wasn't pingable, so we need to report that. We'll do that by // having an empty date/time changer.Set("DateSuccessfulPingOccurred", "", false, false); } // else it exists, but isn't pingable, so leave the DateSuccessfulPingOccurred alone } } if (changer != null) { changer.Execute(); } } catch (Exception e) { ApplicationEventLog log = new ApplicationEventLog(); log.LogError($"PingInterpreter -- {result.Address.ToString()}"); log.Log(e); } } } else { throw new Exception("PingInterpreter: data type is wrong"); } }
public override void Data_DataChange(ListData listData, ListDataChangeEventArgs args) { if (args.EventType == eListDataChangeEventType.IsStartingToLoad) { this.Disable(); this.Buttons[1].Title = "Loading..."; this.Buttons[1].Icon = "Info"; this.NumberOfItems = 1; if (LoadingSubPageOverlay != null) { LoadingSubPageOverlay.BoolValue = true; } } else if (args.EventType == eListDataChangeEventType.HasCleared) { for (uint item = 1; item <= this.NumberOfItems; item++) { this.Buttons[item].Feedback = false; } this.NumberOfItems = 0; } else if (args.EventType == eListDataChangeEventType.HasLoaded) { ushort listSize; if (listData.Count > this.MaxNumberOfItems) { listSize = this.MaxNumberOfItems; } else { listSize = (ushort)listData.Count; } this.NumberOfItems = listSize; for (uint item = 1; item <= listSize; item++) { int listDataIndex = (int)item - 1; this.Buttons[item].Title = listData[listDataIndex].Title; if (listData[listDataIndex].IsSelected) { this.Buttons[item].Icon = UIMediaIcons.CheckboxChecked; } else { this.Buttons[item].Icon = UIMediaIcons.CheckboxOff; } this.Buttons[item].LinkedObject = listData[listDataIndex].DataObject; } this.Enable(); if (LoadingSubPageOverlay != null) { LoadingSubPageOverlay.BoolValue = false; } } else if (args.EventType == eListDataChangeEventType.ItemSelectionHasChanged) { for (uint item = 1; item <= this.NumberOfItems; item++) { int listDataIndex = (int)item - 1; if (listData[listDataIndex].IsSelected) { this.Buttons[item].Icon = UIMediaIcons.CheckboxChecked; } else { this.Buttons[item].Icon = UIMediaIcons.CheckboxOff; } } } }
private void ShowInformation(ListViewItem item, string key) { selectedData = null; selectedListData = null; ListData data = item.Tag as ListData; selectedListData = data; bool isRequireDownload = false; SettingData settingData = null; //추후에 if (data.dataList.ContainsKey(key)) { settingData = data.dataList[key]; if (!settingData.isInit) { isRequireDownload = true; } } else { isRequireDownload = true; } if (isRequireDownload) { using (WebClient client = new WebClient()) { Stream stream = client.OpenRead(DATA_PATH + data.path + "/" + key + "/info.txt"); using (StreamReader reader = new StreamReader(stream)) { if (settingData == null) { settingData = new SettingData(); } settingData.Init(key, data.path, reader.ReadToEnd()); } } } if (settingData != null && settingData.isInit) { lbTitleResult.Text = settingData.GetTitle(); SetLinkLabel(lbLinkShop, settingData.GetShop()); SetLinkLabel(lbLinkExtra, settingData.GetExtraLink()); tbInformation.Text = settingData.GetInformation(); selectedData = settingData; //DB나 설정 파일이 없으면 링크로 대체 string settingPath = selectedData.GetSettingPath(); string dbPath = selectedData.GetDBPath(); if (string.IsNullOrEmpty(settingPath) && string.IsNullOrEmpty(dbPath)) { btApplay.Text = "다운로드 사이트로 이동"; } else { btApplay.Text = "적용"; } } else { selectedData = null; selectedListData = null; lbTitleResult.Text = "에러!"; } }
/// <summary> /// Downloads an Excel filename containing the current issues for the user's currently selected project. /// </summary> public ActionResult Excel() { ListData data = FilterAndPage <IssueSummary>(GetIssueFilterOptions(), "", "CreatedDate", true, 1, 10000); return(Excel(data.WorkItems, "issues.xml")); }
//------------------------------------------------------------------------------- // private bool UpdateList() { try { ListData = FrmMain.Twitter.lists_update(slug: _list_id, name: txtListName.Text, isPrivate: rdbUnPublic.Checked, description: txtDescription.Text, owner_id: FrmMain.Twitter.ID); } catch (TwitterAPIException) { return false; } return true; }
public async void init() { try { if(listdata != null) { listdata.Clear(); } SongListView.Items.Clear(); SongListView.ItemsSource = null; } catch (Exception) { } try { SongListView.ItemClick -= SongListView_ItemClick; } catch (Exception) { } Class.MediaControl.GetCurrent().CurrentStateChanged += MediaCurrentChanged; list = await Class.Model.PlayList.GetPlayList(); if(list!=null) { switch (list.cyc) { case Class.Model.PlayList.cycling.单曲循环: Cyc_Btn.Icon = new SymbolIcon(Symbol.RepeatOne); break; case Class.Model.PlayList.cycling.列表循环: Cyc_Btn.Icon = new SymbolIcon(Symbol.RepeatAll); break; case Class.Model.PlayList.cycling.随机播放: Cyc_Btn.Icon = new SymbolIcon(Symbol.Shuffle); break; default: break; } if (list.SongList != null) { if(list.SongList.Count>0) { listdata = new List<ListData>(); listdata.Clear(); SongListView.Items.Clear(); SongListView.ItemsSource = null; for (int i = 0; i < list.SongList.Count; i++) { var data = new ListData() { singername = list.SongList[i].singername, songname = list.SongList[i].title ,num=(i+1).ToString()}; if (list.nowplay == i) { data.isplay = "Visible"; } else { data.isplay = "Collapsed"; } listdata.Add(data); SongListView.Items.Add(data); } SongListView.SelectedIndex = list.nowplay; SongListView.IsItemClickEnabled = true; SongListView.ItemClick += SongListView_ItemClick; } } } }
public void OnGUI() { // Create our data if we have none. if(_listData == null) { //Debug.Log("no asset file found, need to reload"); _listData = AssetDatabase.LoadAssetAtPath( _listDataAssetPath, typeof(ListData)) as ListData; if(_listData == null) { //Debug.Log("no asset file found, could not reload"); _listData = ScriptableObject.CreateInstance(typeof(ListData)) as ListData; System.IO.Directory.CreateDirectory(Application.dataPath + _listDataDirectory); AssetDatabase.CreateAsset(_listData, _listDataAssetPath ); GUI.changed = true; } } // display the filter fields string[] owners = new string[_listData.owners.Count + 1]; string[] ownersToSelect = new string[_listData.owners.Count]; owners[0] = "All Tasks"; for(int i = 0; i < _listData.owners.Count; i++) { owners[i+1] = _listData.owners[i].name; ownersToSelect[i] = _listData.owners[i].name; } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Show tasks:", EditorStyles.boldLabel); _currentOwnerIndex = EditorGUILayout.Popup(_currentOwnerIndex, owners); EditorGUILayout.EndHorizontal(); // display the list GUIStyle itemStyle = new GUIStyle(EditorStyles.wordWrappedMiniLabel); itemStyle.alignment = TextAnchor.UpperLeft; _scrollPosition = EditorGUILayout.BeginScrollView(_scrollPosition); int displayCount = 0; for( int i = 0; i < _listData.items.Count; i++) { ListItem item = _listData.items[i]; ListItemOwner owner = item.owner; if(_currentOwnerIndex == 0) { itemStyle.normal.textColor = owner.color; if(item.isComplete == false) { displayCount++; EditorGUILayout.BeginHorizontal(); if(EditorGUILayout.Toggle(item.isComplete, GUILayout.Width(20)) == true) { _listData.items[i].isComplete = true; } _listData.items[i].task = EditorGUILayout.TextField(item.task, itemStyle); int newOwnerIndex = EditorGUILayout.Popup(owner.index, ownersToSelect,GUILayout.Width(60)); if(newOwnerIndex != owner.index) { item.owner = _listData.owners[newOwnerIndex]; _listData.items[i] = item; } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } }else{ int adjustedIndex = _currentOwnerIndex - 1; owner = _listData.owners[adjustedIndex]; if(owner.name == item.owner.name) { itemStyle.normal.textColor = owner.color; if(item.isComplete == false) { displayCount++; EditorGUILayout.BeginHorizontal(); if(EditorGUILayout.Toggle(item.isComplete, GUILayout.Width(20)) == true) { _listData.items[i].isComplete = true; } _listData.items[i].task = EditorGUILayout.TextField(item.task, itemStyle); int newOwnerIndex = EditorGUILayout.Popup(adjustedIndex, ownersToSelect,GUILayout.Width(60)); if(newOwnerIndex != adjustedIndex) { item.owner = _listData.owners[newOwnerIndex]; _listData.items[i] = item; } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } } } } if(displayCount == 0) { EditorGUILayout.LabelField("No tasks currently", EditorStyles.largeLabel); } if((showCompletedTasks) && (_currentOwnerIndex == 0)) { itemStyle.normal.textColor = Color.grey; for( int i = 0; i < _listData.items.Count; i++) { if(_listData.items[i].isComplete == true) { ListItem item = _listData.items[i]; EditorGUILayout.BeginHorizontal(); if(EditorGUILayout.Toggle(item.isComplete, GUILayout.Width(20)) == false) { _listData.items[i].isComplete = false; } EditorGUILayout.LabelField(item.task, itemStyle); if(GUILayout.Button("x",GUILayout.Width(23))) { _listData.items.RemoveAt(i); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } } } EditorGUILayout.EndScrollView(); // display our task creation area EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Create Task:", EditorStyles.boldLabel); _newTaskOwnerIndex = EditorGUILayout.Popup(_newTaskOwnerIndex, ownersToSelect,GUILayout.Width(60)); EditorGUILayout.EndHorizontal(); _newTask = EditorGUILayout.TextField(_newTask, GUILayout.Height(40)); if( ( GUILayout.Button("Create Task") && _newTask != "" ) ) { // create new task ListItemOwner newOwner = _listData.owners[_newTaskOwnerIndex]; _listData.AddTask(newOwner, _newTask); //EditorUtility.DisplayDialog("Task created for " + newOwner.name, _newTask, "Sweet"); _newTask = ""; GUI.FocusControl(null); } if(GUI.changed) { //Debug.Log("Save Data: " + _listData.items.Count); EditorUtility.SetDirty(_listData); EditorApplication.SaveAssets(); AssetDatabase.SaveAssets(); } }
private static void AddActivityTypes() { ListData ListRec = new ListData(); ListRec.ListType = "ACTIVITYTYPE"; ListRec.ListDesc = "TIME TRACKING REPORT"; int iItemID = App.Database.SaveListRec(ListRec); // ListRec = new ListData(); ListRec.ListType = "ACTIVITYTYPE"; ListRec.ListDesc = "CRASH REPORT"; iItemID = App.Database.SaveListRec(ListRec); // ListRec = new ListData(); ListRec.ListType = "ACTIVITYTYPE"; ListRec.ListDesc = "MAINTENANCE/REPAIR REPORT"; iItemID = App.Database.SaveListRec(ListRec); }
public abstract void SetData(ListData data);
/** * * @param numbered true if the list should be numbered; false if it should be * bulleted. * @param styleSheet The document's stylesheet. */ public HWPFList(bool numbered, StyleSheet styleSheet) { _listData = new ListData((int)(new Random((int)DateTime.Now.Ticks).Next(0, 100) / 100 * DateTime.Now.Millisecond), numbered); _override = new ListFormatOverride(_listData.GetLsid()); _styleSheet = styleSheet; }
public ListData drillTable(string table, string fk, List <string> parentMembers) { if (string.IsNullOrEmpty(table)) { table = this.table.name; } if (string.IsNullOrEmpty(fk)) { fk = this.primaryKey; } EasyUiGridData grid = new EasyUiGridData(); StringBuilder sql = new StringBuilder(); //纬度表 sql.Append("Select "); sql.Append(this.primaryKey); sql.Append(" Into #t "); sql.Append(" From "); sql.Append(this.table.name); int memberPathCount; StringBuilder sbWhere = getDrillWhere(parentMembers, out memberPathCount); if (sbWhere.Length > 0) { sql.Append(" Where "); sql.Append(sbWhere); } sql.Append(" Group By "); sql.Append(primaryKey); sql.Append(";"); //事实表 sql.Append(" Select "); sql.Append(table); sql.Append(".* From "); sql.Append(table); sql.Append(","); sql.Append("#t"); sql.Append(" Where "); sql.Append(table); sql.Append("."); sql.Append(fk); sql.Append("=#t."); sql.Append(primaryKey); ListData ret = new ListData(); DatabaseAdmin dba = DatabaseAdmin.getInstance(this.table.connection); DataTable tb = dba.executeTable(sql.ToString()); ret.total = tb.Rows.Count; ret.rows = new List <ListDataRow>(); foreach (DataRow dRow in tb.Rows) { ListDataRow row = new ListDataRow(); foreach (DataColumn col in tb.Columns) { row.Add(col.ColumnName, dRow[col].ToString()); } ret.rows.Add(row); } return(ret); }
//------------------------------------------------------------------------------- // private bool MakeList() { try { ListData = FrmMain.Twitter.lists_create(txtListName.Text, rdbUnPublic.Checked, txtDescription.Text); } catch (TwitterAPIException) { return false; } return true; }
[MenuItem("Window/Generate AssetBundle and List", false, 1)] static void GenerateAssetBundleAndList() { /* * assetBundleResource1, assetBundleResource2に、 * ResourcesからResourceを読み出す */ var assetBundleResource1 = Resources.Load(bundleResourceName1); if (assetBundleResource1 != null) { Debug.Log("assetBundleResource1:" + assetBundleResource1.name); } var assetBundleResource2 = Resources.Load(bundleResourceName2); if (assetBundleResource2 != null) { Debug.Log("assetBundleResource2:" + assetBundleResource2.name); } // ターゲットプラットフォームの設定(現在のエディタの環境のものを読み込んで使用しています) BuildTarget targetPlatform = EditorUserBuildSettings.activeBuildTarget; // AssetBundleそれ自体のファイル名を加えたパス(この場合、PROJECT_FOLDER/outputBasePath2/bundleName) var assetBundleOutputPath = Path.Combine(outputBasePath2, bundleName); uint crc; // assetBundleResource1, assetBundleResource2 を含んだAssetBundleを、assetBundleOutputPathに出力します BuildPipeline.BuildAssetBundle( assetBundleResource1, new UnityEngine.Object[] { assetBundleResource2 }, assetBundleOutputPath, out crc, BuildAssetBundleOptions.None, targetPlatform ); Debug.Log("crc:" + crc); if (File.Exists(assetBundleOutputPath)) { Debug.Log("AssetBundle generated:" + assetBundleOutputPath); } else { Debug.Log("failed to generate AssetBundle."); } // リストを作成します。 // 次のようなJSONで出力するつもりなので、使用するパラメータを取得します。 /* * { * "res_ver": 1, * "assetBundles": [ * { * "bundleName": "SampleAssetBundle.unity3d", * "size": 100, * "version": 1, * "crc": 100, * "resourceNames": ["sushi", "udon"] * } * ] * } */ FileInfo fileInfo = new FileInfo(assetBundleOutputPath); var size = (int)fileInfo.Length; /* * JSON化するデータを作成 */ // 含まれているassetの名前一覧を用意。 var bundledAssetNames = new string[] { bundleResourceName1, bundleResourceName2 }; // このデモコードではこのAssetBundleのバージョンを1に指定している。 var version = 1; // AssetBundleのデータを用意。 var bundleData = new BundleData(bundleName, size, version, crc, bundledAssetNames); /* * このAssetBundleを入れるリストを作成する。 */ // リストのバージョンを1に指定 var res_ver = "1"; // 含むAssetBundleのリストを作成 var assetBundlesList = new List <BundleData> { bundleData }; // リストデータを作成。 var listData = new ListData(res_ver, assetBundlesList); // json化 var jsonStr = JsonUtility.ToJson(listData); // output var listOutputPath = Path.Combine(outputBasePath2, listName); using (StreamWriter file = new StreamWriter(listOutputPath)) { file.WriteLine(jsonStr); } if (File.Exists(listOutputPath)) { Debug.Log("list generated:" + listOutputPath); } else { Debug.Log("failed to generate list."); } }
//void CheckedSelectedItems() //{ // foreach (RepeaterItem item in rep.Items) // { // CheckBox chk = (CheckBox)item.FindControl("chk"); // HiddenField hidProductID = (HiddenField)item.FindControl("hidProductID"); // if (chk.Checked) // { // if (!pgc.SelectedIDs.Contains(int.Parse(hidProductID.Value))) // { // pgc.SelectedIDs.Add(int.Parse(hidProductID.Value)); // //ProductMachineItems.Add(prepareCartRecord(item)); // } // } // else // { // if (pgc.SelectedIDs.Contains(int.Parse(hidProductID.Value))) // { // pgc.SelectedIDs.Remove(int.Parse(hidProductID.Value)); // //ProductMachineItems.Remove(prepareCartRecord(item)); // } // } // } //} void PopulateGrid() { ListData res = new ListData(1, 1, 1); dsProduct.ProductDataTable tbl = da.Product_Search(txtSearchCode.Text, txtSearchName.Text, (int.Parse(rdRecon.SelectedValue) == 1 ? 0 : 1), DateTime.Now, (rdIsPromotion.SelectedValue == "1" ? true : false), out res, pgc.CurrentPage); pgc.Populate(res); byte[] ls = new byte[tbl.Rows.Count]; rep.DataSource = ls; rep.DataBind(); for (int i = 0; i <= ls.Length - 1; i++) { dsProduct.ProductRow drProduct = (dsProduct.ProductRow)tbl.Rows[i]; RepeaterItem item = (RepeaterItem)rep.Items[i]; HtmlTableRow tr = (HtmlTableRow)item.FindControl("trRow"); tr.Attributes.Add("class", (i % 2 == 0) ? "gridData" : "gridDataAlt"); HiddenField hidProductID = (HiddenField)item.FindControl("hidProductID"); hidProductID.Value = drProduct.ID.ToString(); CheckBox chk = (CheckBox)item.FindControl("chk"); LinkButton lnkDetails = (LinkButton)item.FindControl("lnkDetails"); lnkDetails.Text = drProduct.Name; lnkDetails.CommandArgument = drProduct.ID.ToString(); Literal litCode = (Literal)item.FindControl("litCode"); litCode.Text = drProduct.Code; Button btnAddToCart = (Button)item.FindControl("btnAddToCart"); btnAddToCart.CommandArgument = i.ToString(); int quantity = 1; string price = "0.00 (Unknown Tier)"; dsPOProductItem _dsPOProductItem = new dsPOProductItem(); dsPOProductItem.POProductItemRow drPOProductItem = da.POProductItem_GetPOQuantity(WebLib.LoggedInUser.DealerUserID, new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1), DateTime.Now); if (drPOProductItem != null && drPOProductItem.Quantity > 0) quantity = drPOProductItem.Quantity + 1; dsProductPriceTier _dsProductPriceTier = new dsProductPriceTier(); dsProductPriceTier.ProductPriceTierRow drProductPriceTier = da.ProductPriceTier_Get(drProduct.ID, quantity); if (drProductPriceTier != null) { switch (drProductPriceTier.TierName) { case "Tier1": //price = drProductPriceTier.Price.ToString(WebLib.CurrencyFormat) + " (Tier 1)"; price = drProductPriceTier.Price.ToString(WebLib.CurrencyFormat) + " (Normal)"; break; case "Tier2": //price = drProductPriceTier.Price.ToString(WebLib.CurrencyFormat) + " (Tier 2)"; price = drProductPriceTier.Price.ToString(WebLib.CurrencyFormat) + " (Normal)"; break; case "Tier3": //price = drProductPriceTier.Price.ToString(WebLib.CurrencyFormat) + " (Tier 3)"; price = drProductPriceTier.Price.ToString(WebLib.CurrencyFormat) + " (Normal)"; break; case "NoTier": //price = drProductPriceTier.Price.ToString(WebLib.CurrencyFormat) + " (No Tier)"; price = drProductPriceTier.Price.ToString(WebLib.CurrencyFormat) + " (Normal)"; break; } } Label lblPrice = (Label)item.FindControl("lblPrice"); lblPrice.Text = price; TextBox txtPrice = (TextBox)item.FindControl("txtPrice"); txtPrice.Text = "0.00"; RadioButtonList rdOrderType = (RadioButtonList)item.FindControl("rdOrderType"); rdOrderType.Attributes.Add("onClick", "javascript:CheckedOrderType('" + rdOrderType.ClientID + "','" + lblPrice.ClientID + "','" + txtPrice.ClientID + "');"); //if (pgc.SelectedIDs.Contains(drProduct.ID)) //{ // chk.Checked = true; //} //else //{ // chk.Checked = false; //} } }
private static bool ListsMatch(ListData listData, ListData itemData) { return(listData.ListType == itemData.ListType && listData.Delimiter == itemData.Delimiter && listData.BulletChar == itemData.BulletChar); }