public void AutoIssueTicketSave(Common.AutoIssueTicketViewModel vm) { if (vm == null) { throw new CustomException(500, "设置信息失败!"); } vm.Code = AuthManager.GetCurrentUser().Code; string path = System.AppDomain.CurrentDomain.BaseDirectory + "AutoIssueTicket\\" + vm.Code + ".xml"; BPiaoBao.Common.XmlHelper.XmlSerializeToFile(vm, path, Encoding.Default); }
public Common.AutoIssueTicketViewModel GetAutoIssueTicket() { var currentCode = AuthManager.GetCurrentUser().Code; string path = System.AppDomain.CurrentDomain.BaseDirectory + "AutoIssueTicket\\" + currentCode + ".xml"; if (File.Exists(path)) { return(Common.XmlHelper.XmlDeserializeFromFile <BPiaoBao.Common.AutoIssueTicketViewModel>(path, Encoding.Default)); } BPiaoBao.Common.AutoIssueTicketViewModel vm = new Common.AutoIssueTicketViewModel(); BPiaoBao.Common.ExtHelper.GetCarryInfos().ForEach(p => vm.IssueTickets.Add(new BPiaoBao.Common.IssueTicketModel { CarrayCode = p.AirCode, CarrayName = p.Carry.AirShortName, Account = string.Empty, Pwd = string.Empty, ContactName = string.Empty, Phone = string.Empty })); return(vm); }