예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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 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);
        }
예제 #5
0
 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;
 }
예제 #6
0
 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;
 }
예제 #7
0
        public AddEditLPU(LpuRR lpuRR)
        {
            InitializeComponent();

            this.lpuRR = lpuRR;

            lpuList = new LpuList();

            loadSFLPU();
        }
예제 #8
0
        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;
        }
예제 #9
0
        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);
        }
예제 #10
0
        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();
        }
예제 #11
0
 public void Add(LpuRR lpuRR)
 {
     base.Add(lpuRR);
 }
예제 #12
0
        private bool IsLpuUsed(LpuRR lpuRR)
        {
            UserLpuRRList userLpuRRList = UserLpuRRList.GetUniqueInstance();

            return(userLpuRRList.IsInList(lpuRR, DateTime.Today.Year));
        }
예제 #13
0
        private bool IsUserLpu(LpuRR lpuRR, User user)
        {
            UserLpuRRList userLpuRRList = UserLpuRRList.GetUniqueInstance();

            return(userLpuRRList.IsInList(lpuRR, user));
        }
예제 #14
0
 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);
 }
예제 #15
0
 public bool IsInList(LpuRR lpuRR)
 {
     var list = List.Select(item => item as UserLpuRR).ToList();
     return list.Exists(item => item.LpuRR == lpuRR);
 }
예제 #16
0
 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);
 }
예제 #17
0
        public bool IsInList(LpuRR lpuRR)
        {
            var list = List.Select(item => item as UserLpuRR).ToList();

            return(list.Exists(item => item.LpuRR == lpuRR));
        }
예제 #18
0
        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();
        }
예제 #19
0
        private bool IsUserLpu(LpuRR lpuRR, User user)
        {
            UserLpuRRList userLpuRRList = UserLpuRRList.GetUniqueInstance();

            return userLpuRRList.IsInList(lpuRR, user);
        }
예제 #20
0
        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));
        }
예제 #21
0
 public void Add(LpuRR lpuRR)
 {
     base.Add(lpuRR);
 }
예제 #22
0
        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));
        }
예제 #23
0
        private bool IsLpuUsed(LpuRR lpuRR)
        {
            UserLpuRRList userLpuRRList = UserLpuRRList.GetUniqueInstance();

            return userLpuRRList.IsInList(lpuRR, DateTime.Today.Year);
        }