public Order(int id_, string name, string phone) { items = new List <OrderDetails>(); ClientNumber = phone; this.Myid = id_; string str; if (Myid < 10) { str = "00" + Myid; } else if (Myid < 100) { str = "0" + Myid; } else { str = Myid.ToString(); } this.ClientName = name; DateTime time = new DateTime(); time = DateTime.Now; this.ID = (time.Year).ToString() + time.Month + time.Day + str; }
public Order(int id_, string name) { this.Myid = id_; string str; if (Myid < 10) { str = "00" + Myid; } else if (Myid < 100) { str = "0" + Myid; } else { str = Myid.ToString(); } this.ClientName = name; DateTime time = new DateTime(); time = DateTime.Now; this.ID = (time.Year).ToString() + time.Month + time.Day + str; }
/// <summary> /// 输出TR /// </summary> /// <param name="Wtype"></param> /// <param name="id"></param> /// <param name="x"></param> /// <param name="a"></param> /// <param name="alist"></param> /// <param name="blist"></param> /// <returns></returns> private string addTr(int Wtype, int id, int x, int a, ArrayList alist, out ArrayList blist) { ArrayList clist = new ArrayList(); List <lgk.Model.tb_user> li = new List <lgk.Model.tb_user>(); for (int i = 0; i < id; i++) { string[] fx = alist[i].ToString().Split(','); lgk.Model.tb_user fd = us.GetModel(int.Parse(fx[1])); if (fd != null) { fd.User005 = x.ToString(); li.Add(fd); for (int j = 1; j < a + 1; j++) { int Myid; if (use.Exist(int.Parse(fx[1]), j, out Myid)) { clist.Add("0," + Myid.ToString()); } else { if (fd.IsOpend >= 2) { clist.Add("0,-1," + fx[1] + "," + j); } else if (fd.IsOpend == 0 || fd.IsOpend == 1) { clist.Add("2,-1," + fx[1] + "," + j); } } } } else { if (fx[0] == "0")//父节点已开通 { if (us.GetModel(" isopend>=2 and Location=1 and ParentID=" + int.Parse(fx[2])) == null) { if (int.Parse(fx[3]) == 2) { fd = new lgk.Model.tb_user(); fd.User005 = x.ToString(); fd.UserCode = "[空位]"; li.Add(fd); } else { fd = new lgk.Model.tb_user(); fd.User005 = x.ToString(); fd.UserCode = "[注册]"; fd.ParentID = int.Parse(fx[2]); fd.Location = int.Parse(fx[3]); li.Add(fd); } } else { fd = new lgk.Model.tb_user(); fd.User005 = x.ToString(); fd.UserCode = "[注册]"; fd.ParentID = int.Parse(fx[2]); fd.Location = int.Parse(fx[3]); li.Add(fd); } } else { if (fx[0] == "2")//父节点未开通 { if (int.Parse(fx[3]) == 2) { fd = new lgk.Model.tb_user(); fd.User005 = x.ToString(); fd.UserCode = "[空位]"; li.Add(fd); } else { //fd = new lgk.Model.tb_user(); //fd.User005 = x.ToString(); //fd.UserCode = "[注册]"; //fd.ParentID = int.Parse(fx[2]); //fd.Location = int.Parse(fx[3]); //li.Add(fd); fd = new lgk.Model.tb_user(); fd.User005 = x.ToString(); fd.UserCode = "[空位]"; li.Add(fd); } } else { fd = new lgk.Model.tb_user(); fd.User005 = x.ToString(); fd.UserCode = "[空位]"; li.Add(fd); } } for (int j = 0; j < a; j++) { clist.Add("1,-1"); } } } blist = clist; return(Aid(li, Wtype, a)); }