private void NewTerminalNo() { var no = DateTime.Now.ToString("yyyyMMdd"); // 查找当前日期中比1号更大的终端号码并倒叙排列 var ter = TerminalInstance.FindList <TB_Terminal>(f => f.Number.StartsWith(no) && f.Delete == false, "Number", true).FirstOrDefault(); if (null != ter) { no = (ParseInt(ter.Number) + 1).ToString(); } else { no += "01"; } txtNumber.Value = no; NewSimNo(); }
private void NewSimNo() { var auto = int.Parse(ConfigurationManager.AppSettings["AutoSimCardNumber"]); if (auto > 0) { var tmp = TerminalInstance.FindList <TB_Terminal>(f => f.Sim.Contains("89000"), "Sim", true).FirstOrDefault(); if (null != tmp) { var s = int.Parse(tmp.Sim); txtSimcard.Value = (s + 1).ToString(); } else { txtSimcard.Value = "89000001"; } } }
protected void btDelete_Click(object sender, EventArgs e) { if (!HasSessionLose) { if ("" != hidID.Value) { var ids = GetIdList(hidID.Value.Split(new char[] { ',' })); var list = TerminalInstance.FindList(f => ids.Contains(f.id) && f.Delete == false); foreach (var terminal in list) { terminal.Delete = true; Update(terminal); SaveHistory(new TB_AccountHistory { ActionId = ActionInstance.Find(f => f.Name.Equals("DeleteTerminal")).id, ObjectA = TerminalInstance.ToString(terminal) }); } ShowNotification("./terminal_list.aspx", "Success: You have delete " + ids.Count() + " terminal(s)."); } } }