public Task <DataTable> ToDataTableAsync(LpuRR lpuRR) { var task = new Task <DataTable>(() => { DataTable dt = new DataTable(); dt.Columns.Add("id"); dt.Columns.Add("Название"); var list = List.Select(item => item as LpuRR).ToList(); list = list.Where(item => (!item.IsInList || item == lpuRR) && item.StatusLPU == StatusLPU.Активен).OrderBy(item => item.Name).ToList(); dt.Rows.Add("0", "Прочие ЛПУ"); foreach (var item in list) { dt.Rows.Add(item.GetRow()); } return(dt); } ); task.Start(); return(task); }
public UserLpuRR(DataRow row) : base(row) { int idUser; int.TryParse(row[1].ToString(), out idUser); UserList userList = UserList.GetUniqueInstance(); _user = userList.GetItem(idUser) as User; int idLpuRR; int.TryParse(row[2].ToString(), out idLpuRR); LpuRRList lpuRRList = LpuRRList.GetUniqueInstance(); _lpuRR = lpuRRList.GetItem(idLpuRR) as LpuRR; int idSdiv; int.TryParse(row[3].ToString(), out idSdiv); _sdiv = (SDiv)idSdiv; int.TryParse(row[4].ToString(), out _year1); int.TryParse(row[5].ToString(), out _year2); }
public PersSalesReport(DataRow row) { LpuRRList lpuRRList = LpuRRList.GetUniqueInstance(); int idLpuRR; int.TryParse(row[0].ToString(), out idLpuRR); _lpuRR = lpuRRList.GetItem(idLpuRR) as LpuRR; UserList userList = UserList.GetUniqueInstance(); int idUser; int.TryParse(row[1].ToString(), out idUser); _user = userList.GetItem(idUser) as User; RegionRRList regionRRList = RegionRRList.GetUniqueInstance(); int idRegionRR; int.TryParse(row[2].ToString(), out idRegionRR); _regionRR = regionRRList.GetItem(idRegionRR) as RegionRR; int idSDiv; int.TryParse(row[3].ToString(), out idSDiv); _sdiv = (SDiv)idSDiv; int idRD; int.TryParse(row[4].ToString(), out idRD); _rd = userList.GetItem(idRD) as User; int.TryParse(row[5].ToString(), out _year); double.TryParse(row[6].ToString(), out _euro); double.TryParse(row[7].ToString(), out _rub); }
public UserLpuRR(User user, LpuRR lpuRR, SDiv sdiv) { _user = user; _lpuRR = lpuRR; _sdiv = sdiv; Name = string.Empty; _year1 = DateTime.Today.Year; _year2 = DateTime.Today.Year; }
public AddEditLPU(LpuRR lpuRR) { InitializeComponent(); this.lpuRR = lpuRR; lpuList = new LpuList(); loadSFLPU(); }
public DataTable ToDataTable(LpuRR lpuRR) { DataTable dt = new DataTable(); dt.Columns.Add("id"); dt.Columns.Add("Название"); var list = List.Select(item => item as LpuRR).ToList(); list = list.Where(item => (!item.IsInList || item == lpuRR) && item.StatusLPU == StatusLPU.Активен).OrderBy(item => item.Name).ToList(); dt.Rows.Add("0", "Прочие ЛПУ"); foreach (var item in list) dt.Rows.Add(item.GetRow()); return dt; }
private void btnAdd_Click(object sender, EventArgs e) { RegionRR regionRR = GetRegionRR(); LpuRR lpuRR = new LpuRR(regionRR); AddEditLPU aeLPU = new AddEditLPU(lpuRR); if (aeLPU.ShowDialog() == System.Windows.Forms.DialogResult.OK) loadData1(); }
public void Add(LpuRR lpuRR) { base.Add(lpuRR); }
private bool IsLpuUsed(LpuRR lpuRR) { UserLpuRRList userLpuRRList = UserLpuRRList.GetUniqueInstance(); return(userLpuRRList.IsInList(lpuRR, DateTime.Today.Year)); }
private bool IsUserLpu(LpuRR lpuRR, User user) { UserLpuRRList userLpuRRList = UserLpuRRList.GetUniqueInstance(); return(userLpuRRList.IsInList(lpuRR, user)); }
public bool IsInList(LpuRR lpuRR, int year) { var list = List.Select(item => item as UserLpuRR).ToList(); return list.Exists(item => item.LpuRR == lpuRR && item.YearEnd == year); }
public bool IsInList(LpuRR lpuRR) { var list = List.Select(item => item as UserLpuRR).ToList(); return list.Exists(item => item.LpuRR == lpuRR); }
public bool IsInList(LpuRR lpuRR, User user) { var list = List.Select(item => item as UserLpuRR).ToList(); return list.Exists(item => item.LpuRR == lpuRR && item.User == user && item.YearEnd >= DateTime.Today.Year); }
public bool IsInList(LpuRR lpuRR) { var list = List.Select(item => item as UserLpuRR).ToList(); return(list.Exists(item => item.LpuRR == lpuRR)); }
private string CreatePreDeleteMessage(LpuRR lpuRR) { StringBuilder sb = new StringBuilder(); sb.AppendLine("Удалить ЛПУ?"); sb.Append("Сокр. наим.: "); sb.AppendLine(lpuRR.Name); sb.Append("Полное наим.: "); sb.AppendLine(lpuRR.FullName); sb.Append("Номер: "); sb.AppendLine(lpuRR.ID.ToString()); return sb.ToString(); }
private bool IsUserLpu(LpuRR lpuRR, User user) { UserLpuRRList userLpuRRList = UserLpuRRList.GetUniqueInstance(); return userLpuRRList.IsInList(lpuRR, user); }
public bool IsInList(LpuRR lpuRR, User user) { var list = List.Select(item => item as UserLpuRR).ToList(); return(list.Exists(item => item.LpuRR == lpuRR && item.User == user && item.YearEnd >= DateTime.Today.Year)); }
public bool IsInList(LpuRR lpuRR, int year) { var list = List.Select(item => item as UserLpuRR).ToList(); return(list.Exists(item => item.LpuRR == lpuRR && item.YearEnd == year)); }
private bool IsLpuUsed(LpuRR lpuRR) { UserLpuRRList userLpuRRList = UserLpuRRList.GetUniqueInstance(); return userLpuRRList.IsInList(lpuRR, DateTime.Today.Year); }