Beispiel #1
0
        public bool DepartmentsAdd(string address, string altPhoneno, string companyName, int cvrNo,
                                   int deparmentHead, string email, string phoneNo, int zip)
        {
            var rdg = new RDGs.RDGtblDepartment(this.session.ConnectionString);

            try
            {
                rdg.Add(new InterfaceAdaptor.Department()
                {
                    Active        = true,
                    Address       = address,
                    AltPhoneNo    = altPhoneno,
                    CompanyName   = companyName,
                    CvrNo         = cvrNo,
                    DeparmentHead = new InterfaceAdaptor.Worker()
                    {
                        WorkNo = deparmentHead
                    },
                    Email   = email,
                    PostNo  = this.postNumbers.GetAtPostNumber(zip),
                    PhoneNo = phoneNo,
                });
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        private void Filddepartments(bool?active)
        {
            this.departments.Clear();

            var rdg = new RDGs.RDGtblDepartment(this.session.ConnectionString);

            foreach (var item in rdg.Get(active))
            {
                this.departments.Add(item);
            }
        }
Beispiel #3
0
        public List <string> ListOfDepartments()
        {
            var list = new List <string>();

            var rdg = new RDGs.RDGtblDepartment(this.session.ConnectionString);

            foreach (var item in rdg.Get(true))
            {
                list.Add("#" + item.Deparment + " " + item.CompanyName);
            }

            return(list);
        }
Beispiel #4
0
        public bool DepartmentsRemove(int id)
        {
            var rdg = new RDGs.RDGtblDepartment(this.session.ConnectionString);

            try
            {
                rdg.Delete(id);
            }
            catch (Exception)
            {
                return(false);
            }

            return(true);
        }