Example #1
0
        public void Update(Interface.IpostNo postNumber)
        {
            using (LMCdatabaseDataContext dbContext = new LMCdatabaseDataContext(this.connectionString))
            {
                tblPostNo postNo = dbContext.tblPostNos.SingleOrDefault(x => x.ID == postNumber.Id);
                postNo.city   = postNumber.City;
                postNo.postNo = postNumber.PostNumber;

                dbContext.SubmitChanges();
            }
        }
Example #2
0
 public PrivateCustomer(PrivateCustomer obj)
 {
     this.active             = obj.active;
     this.altPhoneNo         = obj.altPhoneNo;
     this.email              = obj.email;
     this.homeAddress        = obj.homeAddress;
     this.name               = obj.name;
     this.phoneNo            = obj.phoneNo;
     this.postNo             = obj.postNo;
     this.privateCustomersNo = obj.privateCustomersNo;
     this.surname            = obj.surname;
 }
Example #3
0
 public PrivateCustomer(bool active, string altPhoneNo, string email, string homeAddress, string name,
                        string phoneNo, Interface.IpostNo postNo, int privateCustomersNo, string surname)
 {
     this.active             = active;
     this.altPhoneNo         = altPhoneNo;
     this.email              = email;
     this.homeAddress        = homeAddress;
     this.name               = name;
     this.phoneNo            = phoneNo;
     this.postNo             = postNo;
     this.privateCustomersNo = privateCustomersNo;
     this.surname            = surname;
 }
Example #4
0
 public CompanyCustomer(CompanyCustomer obj)
 {
     this.active             = obj.active;
     this.address            = obj.address;
     this.altPhoneNo         = obj.altPhoneNo;
     this.companyCustomersNo = obj.companyCustomersNo;
     this.contactPerson      = obj.contactPerson;
     this.cvrNo   = obj.cvrNo;
     this.email   = obj.email;
     this.name    = obj.name;
     this.phoneNo = obj.phoneNo;
     this.postNo  = obj.postNo;
 }
Example #5
0
 public Worker(Worker obj)
 {
     this.active       = obj.active;
     this.address      = obj.address;
     this.altPhoneNo   = obj.altPhoneNo;
     this.email        = obj.email;
     this.name         = obj.name;
     this.phoneNo      = obj.phoneNo;
     this.postNo       = obj.postNo;
     this.surname      = obj.surname;
     this.workerStatus = obj.workerStatus;
     this.workNo       = obj.workNo;
 }
Example #6
0
 public Department(Department obj)
 {
     this.active         = obj.active;
     this.address        = obj.address;
     this.altPhoneNo     = obj.altPhoneNo;
     this.companyName    = obj.companyName;
     this.cvrNo          = obj.cvrNo;
     this.department     = obj.department;
     this.departmentHead = obj.departmentHead;
     this.email          = obj.email;
     this.phoneNo        = obj.phoneNo;
     this.postNo         = obj.postNo;
 }
Example #7
0
 public CompanyCustomer(bool active, string address, string altPhoneNo, string contactPerson,
                        int companyCustomersNo, int cvrNo, string email, string name, string phoneNo, Interface.IpostNo postNo)
 {
     this.active             = active;
     this.address            = address;
     this.altPhoneNo         = altPhoneNo;
     this.contactPerson      = contactPerson;
     this.companyCustomersNo = companyCustomersNo;
     this.cvrNo   = cvrNo;
     this.email   = email;
     this.name    = name;
     this.phoneNo = phoneNo;
     this.postNo  = postNo;
 }
Example #8
0
        public void Add(Interface.IpostNo postNumber)
        {
            using (LMCdatabaseDataContext dbContext = new LMCdatabaseDataContext(this.connectionString))
            {
                tblPostNo newPostNumber = new tblPostNo
                {
                    postNo = postNumber.PostNumber,
                    city   = postNumber.City
                };

                dbContext.tblPostNos.InsertOnSubmit(newPostNumber);
                dbContext.SubmitChanges();
            }
        }
Example #9
0
 public Worker(bool active, string address, string altPhoneNo, string email, string name, string phoneNo,
               Interface.IpostNo postNo, string surname, WorkerStatus workerStatus, int workNo)
 {
     this.active       = active;
     this.address      = address;
     this.altPhoneNo   = altPhoneNo;
     this.email        = email;
     this.name         = name;
     this.phoneNo      = phoneNo;
     this.postNo       = postNo;
     this.surname      = surname;
     this.workerStatus = workerStatus;
     this.workNo       = workNo;
 }
Example #10
0
 public Department(bool active, string address, string altPhoneNo, string companyName, int cvrNo,
                   int department, Worker departmentHead, string email, string phoneNo, Interface.IpostNo postNo)
 {
     this.active         = active;
     this.address        = address;
     this.altPhoneNo     = altPhoneNo;
     this.companyName    = companyName;
     this.cvrNo          = cvrNo;
     this.department     = department;
     this.departmentHead = departmentHead;
     this.email          = email;
     this.phoneNo        = phoneNo;
     this.postNo         = postNo;
 }
Example #11
0
        public void Delete(Interface.IpostNo postNumber)
        {
            using (LMCdatabaseDataContext dbContext = new LMCdatabaseDataContext(this.connectionString))
            {
                tblPostNo postNo = dbContext.tblPostNos.SingleOrDefault(x => x.ID == postNumber.Id);
                dbContext.tblPostNos.DeleteOnSubmit(postNo);

                var deleteItem = new StringBuilder();
                deleteItem.Append("[tblPostNo] { ");
                deleteItem.Append("ID = " + postNo.ID + ", ");
                deleteItem.Append("postNo = " + postNo.postNo + ", ");
                deleteItem.Append("city = " + postNo.city);
                deleteItem.Append("} ");

                tblDeleteItem newDelete = new tblDeleteItem
                {
                    itemInfo   = deleteItem.ToString(),
                    deleteDate = DateTime.Now,
                    restored   = false
                };

                dbContext.SubmitChanges();
            }
        }