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); }
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); } }
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); }
public bool DepartmentsRemove(int id) { var rdg = new RDGs.RDGtblDepartment(this.session.ConnectionString); try { rdg.Delete(id); } catch (Exception) { return(false); } return(true); }