Track it don't lose it - programming code

Page 1

PROGRAMMING CODE Erasmus+ Project 2017-1-FR01-KA219-037185_1


Data Access Layer using using using using using using using

System; System.Collections.Generic; System.Diagnostics; System.Linq; System.Windows.Forms; System.IO; MySql.Data.MySqlClient;

namespace WorkingAssests { /// <summary> /// Data Access Layer (DAL). All function related with database. /// </summary> public static class DAL { private static string _connectionString; public static string ConnectionString { get { return _connectionString; } set { _connectionString = value; } } public static bool Login(string username, string password) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var user = (from c in context.users where c.Username == username && c.Password == password select c).FirstOrDefault(); if(user == null) { return false; } else { Parameters.Login = true; Parameters.Firstname = user.FirstName; Parameters.Lastname = user.LastName; Parameters.UserName = user.Username; Parameters.Privilages = user.Privileges.Trim(); Parameters.UserId = user.UserId; return true; } } } catch(Exception ex) {


using (StreamWriter sw = new StreamWriter(Properties.Settings.Default.LogDirectory)) { sw.WriteLine(ex.ToString()); } return false; } } public static int InsertAsset(asset a) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; asset newasset = new asset(); newasset.AssetCategoryId = a.AssetCategoryId; newasset.AssetDescription = a.AssetDescription; newasset.BarcodeNumber = a.BarcodeNumber; newasset.ClassId = a.ClassId; newasset.Comments = a.Comments; newasset.DateAcquired = a.DateAcquired; newasset.DateDiscarted = a.DateDiscarted; newasset.ModelNumber = a.ModelNumber; newasset.NextSchedMaint = a.NextSchedMaint; newasset.Photo = a.Photo; newasset.PurchasePrice = a.PurchasePrice; newasset.SerialNumber = a.SerialNumber; newasset.StatusId = a.StatusId; newasset.StckCardNo = a.StckCardNo; newasset.VendorId = a.VendorId; newasset.active = a.active; newasset.userid = a.userid; context.assets.Add(newasset); return (context.SaveChanges() > 0) ? 1 : 0; ; } } catch(Exception ex) { Debug.WriteLine(ex.ToString()); return 0; } } public static int UpdateAsset(asset a, bool newimage) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newasset = (from c in context.assets where c.AssetId == a.AssetId select c).First(); newasset.AssetCategoryId = a.AssetCategoryId; newasset.AssetDescription = a.AssetDescription; newasset.BarcodeNumber = a.BarcodeNumber;


newasset.ClassId = a.ClassId; newasset.Comments = a.Comments; newasset.DateAcquired = a.DateAcquired; newasset.DateDiscarted = a.DateDiscarted; newasset.ModelNumber = a.ModelNumber; newasset.NextSchedMaint = a.NextSchedMaint; if(newimage == true) newasset.Photo = a.Photo; newasset.PurchasePrice = a.PurchasePrice; newasset.SerialNumber = a.SerialNumber; newasset.StatusId = a.StatusId; newasset.StckCardNo = a.StckCardNo; newasset.VendorId = a.VendorId; newasset.active = a.active; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static bool AssetExist(int assetid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currentasset = (from c in context.assets where c.AssetId == assetid select c).FirstOrDefault(); if (currentasset == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return false; } } public static int InsertVendor(vendor v) { try { using (var context = new workingassetsEntities()) {


context.Database.Connection.ConnectionString = ConnectionString; vendor newvendor = new vendor(); newvendor.ContactFirstName = v.ContactFirstName; newvendor.ContactLastName = v.ContactLastName; newvendor.VendorName = v.VendorName; newvendor.Title = v.Title; newvendor.PostalCode = v.PostalCode; newvendor.PhoneNumber = v.PhoneNumber; newvendor.MobileNumber = v.MobileNumber; newvendor.FaxNumber = v.FaxNumber; newvendor.Country = v.Country; newvendor.City = v.City; newvendor.Address = v.Address; context.vendors.Add(newvendor); return (context.SaveChanges() > 0) ? 1 : 0; } } catch(Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int UpdateVendor(vendor v) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newvendor = (from c in context.vendors where c.VendorId == v.VendorId select c).First(); newvendor.ContactFirstName = v.ContactFirstName; newvendor.ContactLastName = v.ContactLastName; newvendor.VendorName = v.VendorName; newvendor.Title = v.Title; newvendor.PostalCode = v.PostalCode; newvendor.PhoneNumber = v.PhoneNumber; newvendor.MobileNumber = v.MobileNumber; newvendor.FaxNumber = v.FaxNumber; newvendor.Country = v.Country; newvendor.City = v.City; newvendor.Address = v.Address; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } }


public static List<vendor> GetAllVendors() { try { List<vendor> vendorlist = new List<vendor>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; vendorlist = (from c in context.vendors select c).ToList(); return vendorlist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static bool VendorExist(int vendorid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currentvendor = (from c in context.vendors where c.VendorId == vendorid select c).FirstOrDefault(); if(currentvendor == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return false; } } public static int InsertUser(user u) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; user newuser = new user();


newuser.FirstName = u.FirstName; newuser.LastName = u.LastName; newuser.Username = u.Username; newuser.Password = u.Password; newuser.Privileges = u.Privileges; context.users.Add(newuser); return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int UpdateUser(user u) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newuser = (from c in context.users where c.UserId == u.UserId select c).FirstOrDefault(); newuser.FirstName = u.FirstName; newuser.LastName = u.LastName; newuser.Username = u.Username; newuser.Password = u.Password; newuser.Privileges = u.Privileges; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static List<user> GetAllUsers() { try { List<user> userlist = new List<user>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; userlist = (from c in context.users select c).ToList(); return userlist; } } catch (Exception ex)


{ Debug.WriteLine(ex.ToString()); return null; } } public static bool UserExist(int userid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currentuser = (from c in context.users where c.UserId == userid select c).FirstOrDefault(); if (currentuser == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return false; } } public static List<title> GetAllTitles() { try { List<title> titlelist = new List<title>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; titlelist = (from c in context.titles select c).ToList(); return titlelist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static List<department> GetAllDepartments() { try { List<department> departmentlist = new List<department>();


using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; departmentlist = (from c in context.departments select c).ToList(); return departmentlist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static List<@class> GetAllClasses() { try { List<@class> classeslist = new List<@class>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; classeslist = (from c in context.classes select c).ToList(); return classeslist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static List<status> GetAllStatuses() { try { List<status> statuseslist = new List<status>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; statuseslist = (from c in context.status select c).ToList(); return statuseslist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static List<asset> GetAllAssets()


{ try { List<asset> assetslist = new List<asset>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; assetslist = (from c in context.assets select c).ToList(); return assetslist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static List<asset> GetAllAssets(int userid) { try { List<asset> assetslist = new List<asset>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; assetslist = (from c in context.assets where c.userid == userid select c).ToList(); return assetslist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static List<asset> GetAllAssets(bool active) { try { var status = (active == true) ? 1 : 0; List<asset> assetslist = new List<asset>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; assetslist = (from c in context.assets where c.active == status select c).ToList(); return assetslist; } } catch (Exception ex) {


Debug.WriteLine(ex.ToString()); return null; } } public static List<assetcategory> GetAllAssetCategories() { try { List<assetcategory> assetscategorylist = new List<assetcategory>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; assetscategorylist = (from c in context.assetcategories select c).ToList(); return assetscategorylist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static int GetAllActiveAssetInStock() { try { List<asset> activeassets = new List<asset>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; activeassets = (from c in context.assets where c.active == 1 select c).ToList(); return activeassets.Count; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return 0; } } public static List<assetcategory> GetAllCategories() { try { List<assetcategory> categorylist = new List<assetcategory>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString;


categorylist = (from c in context.assetcategories select c).ToList(); return categorylist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static List<staff> GetAllStaff() { try { List<staff> stafflist = new List<staff>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; stafflist = (from c in context.staffs select c).ToList(); return stafflist; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return null; } } public static bool CategoryExist(int categoryid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currentvendor = (from c in context.assetcategories where c.AssetCategoryId == categoryid select c).FirstOrDefault(); if (currentvendor == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return false; }


} public static int InsertCategory(assetcategory ac) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; assetcategory newcategory = new assetcategory(); newcategory.Category = ac.Category; context.assetcategories.Add(newcategory); return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int UpdateCategory(assetcategory ac) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newcategory = (from c in context.assetcategories where c.AssetCategoryId == ac.AssetCategoryId select c).FirstOrDefault(); newcategory.Category = ac.Category; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static bool TitleExist(int titleid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currenttitle = (from c in context.titles where c.TitleId == titleid


select c).FirstOrDefault(); if (currenttitle == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return false; } } public static int InsertTitle(title t) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; title newtitle = new title(); newtitle.Title1 = t.Title1; context.titles.Add(newtitle); return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int UpdateTitle(title t) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newtitle = (from c in context.titles where c.TitleId == t.TitleId select c).FirstOrDefault(); newtitle.Title1 = t.Title1; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString());


MessageBox.Show(ex.ToString()); return 0; } } public static bool StaffExist(int staffid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currentstaff = (from c in context.staffs where c.StaffId == staffid select c).FirstOrDefault(); if (currentstaff == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return false; } } public static int InsertStaff(staff s) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; staff newstaff = new staff(); newstaff.FirstName = s.FirstName; newstaff.LastName = s.LastName; newstaff.Title = s.Title; newstaff.Extension = s.Extension; newstaff.HomePhone = s.HomePhone; newstaff.MobilePhone = s.MobilePhone; newstaff.Specalization = s.Specalization; newstaff.DepartmentId = s.DepartmentId; context.staffs.Add(newstaff); return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString());


return 0; } } public static int UpdateStaff(staff s) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newstaff = (from c in context.staffs where c.StaffId == s.StaffId select c).FirstOrDefault(); newstaff.FirstName = s.FirstName; newstaff.LastName = s.LastName; newstaff.Title = s.Title; newstaff.Extension = s.Extension; newstaff.HomePhone = s.HomePhone; newstaff.MobilePhone = s.MobilePhone; newstaff.Specalization = s.Specalization; newstaff.DepartmentId = s.DepartmentId; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static bool DepartmentExist(int departmentid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currentdepartment = (from c in context.departments where c.departmentid == departmentid select c).FirstOrDefault(); if (currentdepartment == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString());


return false; } } public static int InsertDepartment(department d) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; department newdepartment = new department(); newdepartment.department1 = d.department1; context.departments.Add(newdepartment); return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int UpdateDepartment(department d) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newdepartment = (from c in context.departments where c.departmentid == d.departmentid select c).FirstOrDefault(); newdepartment.department1 = d.department1; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static bool StatusExist(int statusid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currentstatus = (from c in context.status


where c.StatusId == statusid select c).FirstOrDefault(); if (currentstatus == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return false; } } public static int InsertStatus(status s) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; status newstatus = new status(); newstatus.Status1 = s.Status1; context.status.Add(newstatus); return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int UpdateStatus(status s) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newstatus = (from c in context.status where c.StatusId == s.StatusId select c).FirstOrDefault(); newstatus.Status1 = s.Status1; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) {


Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static bool ClassExist(int classid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var currentclass = (from c in context.classes where c.ClassId == classid select c).FirstOrDefault(); if (currentclass == null) { return false; } else { return true; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); return false; } } public static int InsertClass(@class cl) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; @class newclass = new @class(); newclass.ClassNo = cl.ClassNo; newclass.StaffId = cl.StaffId; newclass.DepartmentId = cl.DepartmentId; context.classes.Add(newclass); return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int UpdateClass(@class cl) {


try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var newclass = (from c in context.classes where c.ClassId == cl.ClassId select c).FirstOrDefault(); newclass.ClassNo = cl.ClassNo; newclass.StaffId = cl.StaffId; newclass.DepartmentId = cl.DepartmentId; return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static List<asset> SearchAssets(string searchstring = null, string serialnumbersearch = null, string barcodenumbersearch = null, bool activeasset = false, string categoryid = null) { try { List<asset> resultset = new List<asset>(); List<asset> resultsetall = new List<asset>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; if(searchstring != "") { resultset = (from c in context.assets where c.AssetDescription.Contains(searchstring) select c).ToList(); resultsetall.AddRange(resultset); } if(serialnumbersearch != "") { resultset = (from c in context.assets where c.SerialNumber.Equals(serialnumbersearch) select c).ToList(); resultsetall.AddRange(resultset); } if(barcodenumbersearch != "") { resultset = (from c in context.assets where c.BarcodeNumber.Equals(barcodenumbersearch) select c).ToList();


resultsetall.AddRange(resultset); } if (activeasset != false) { resultset = (from c in context.assets where c.active == 1 select c).ToList(); resultsetall.AddRange(resultset); } if (categoryid != "") { var id = int.Parse(categoryid); resultset = (from c in context.assets where c.AssetCategoryId == id select c).ToList(); resultsetall.AddRange(resultset); } return resultsetall; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return null; } } public static List<asset> AssetsByActivation(int activationstate) { try { List<asset> resultset = new List<asset>(); using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; resultset = (from c in context.assets where c.active == activationstate select c).ToList(); return resultset; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return null; } } public static int DeleteAsset(int assetid) { try { using (var context = new workingassetsEntities()) {


context.Database.Connection.ConnectionString = ConnectionString; var result = (from c in context.assets where c.AssetId == assetid select c).FirstOrDefault(); if(result != null) { context.assets.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0; } else { return 0; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int DeleteVendor(int vendorid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var vendorassets = (from c in context.assets where c.VendorId == vendorid select c).FirstOrDefault(); if(vendorassets != null) { MessageBox.Show("The vendor exist in a related table (assets). The current vendor can not be deleted.", "Working Assests"); return 0; } var result = (from c in context.vendors where c.VendorId == vendorid select c).FirstOrDefault(); if (result != null) { context.vendors.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0; } else { return 0; } } } catch (Exception ex)


{ Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int DeleteStaff(int staffid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var staffclass = (from c in context.classes where c.StaffId == staffid select c).FirstOrDefault(); if (staffclass != null) { MessageBox.Show("The staff exist in a related table (classes). The current staff can not be deleted.", "Working Assests"); return 0; } var result = (from c in context.staffs where c.StaffId == staffid select c).FirstOrDefault(); if (result != null) { context.staffs.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0; } else { return 0; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int DeleteUser(int userid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString;


var userassets = (from c in context.assets where c.userid == userid select c).FirstOrDefault(); if (userassets != null) { MessageBox.Show("The user exist in a related table (assets). The current user can not be deleted.", "Working Assests"); return 0; } var result = (from c in context.users where c.UserId == userid select c).FirstOrDefault(); if (result != null) { context.users.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0; } else { return 0; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int DeleteClass(int classid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var classassets = (from c in context.assets where c.ClassId == classid select c).FirstOrDefault(); if (classassets != null) { MessageBox.Show("The class exist in a related table (assets). The current class can not be deleted.", "Working Assests"); return 0; } var result = (from c in context.classes where c.ClassId == classid select c).FirstOrDefault(); if (result != null) { context.classes.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0;


} else { return 0; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int DeleteDepartment(int departmentid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var classdepartments = (from c in context.classes where c.DepartmentId == departmentid select c).FirstOrDefault(); if (classdepartments != null) { MessageBox.Show("The department exist in a related table (assets). The current department can not be deleted.", "Working Assests"); return 0; } var result = (from c in context.departments where c.departmentid == departmentid select c).FirstOrDefault(); if (result != null) { context.departments.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0; } else { return 0; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int DeleteTitle(int titleid) {


try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var result = (from c in context.titles where c.TitleId == titleid select c).FirstOrDefault(); if (result != null) { context.titles.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0; } else { return 0; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int DeleteStatus(int statusid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var statusasstes = (from c in context.assets where c.StatusId == statusid select c).FirstOrDefault(); if (statusasstes != null) { MessageBox.Show("The status exist in a related table (assets). The current status can not be deleted.", "Working Assests"); return 0; } var result = (from c in context.status where c.StatusId == statusid select c).FirstOrDefault(); if (result != null) { context.status.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0; } else {


return 0; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int DeleteCategory(int categoryid) { try { using (var context = new workingassetsEntities()) { context.Database.Connection.ConnectionString = ConnectionString; var categoryasstes = (from c in context.assets where c.AssetCategoryId == categoryid select c).FirstOrDefault(); if (categoryasstes != null) { MessageBox.Show("The category exist in a related table (assets). The current category can not be deleted.", "Working Assests"); return 0; } var result = (from c in context.assetcategories where c.AssetCategoryId == categoryid select c).FirstOrDefault(); if (result != null) { context.assetcategories.Remove(result); return (context.SaveChanges() > 0) ? 1 : 0; } else { return 0; } } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static int ActivateAssets(List<asset> list) { try { using (var context = new workingassetsEntities())


{ context.Database.Connection.ConnectionString = ConnectionString; foreach(var item in list) { var result = (from c in context.assets where c.AssetId == item.AssetId select c).FirstOrDefault(); result.active = item.active;//activate asset } return (context.SaveChanges() > 0) ? 1 : 0; } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.ToString()); return 0; } } public static bool BackUpDB(string filepath) { try { string constring = ConnectionString; using (MySqlConnection conn = new MySqlConnection(constring)) { using (MySqlCommand cmd = new MySqlCommand()) { using (MySqlBackup mb = new MySqlBackup(cmd)) { cmd.Connection = conn; conn.Open(); mb.ExportInfo.AddCreateDatabase = true; mb.ExportInfo.ExportTableStructure = true; mb.ExportInfo.ExportRows = true; mb.ExportToFile(filepath + "\\backup" + DateTime.Now.ToString().Replace("/", "").Replace(":", "") + ".sql"); conn.Close(); } } } return true; } catch(Exception ex) { ex.ToString(); return false; } } public static bool RestoreDB(string filepath) { try { string constring = ConnectionString;


using (MySqlConnection conn = new MySqlConnection(constring)) { using (MySqlCommand cmd = new MySqlCommand()) { using (MySqlBackup mb = new MySqlBackup(cmd)) { cmd.Connection = conn; conn.Open(); //mb.ImportInfo.TargetDatabase = "workingassets"; mb.ImportFromFile(filepath); conn.Close(); } } } return true; } catch(Exception ex) { ex.ToString(); return false; } } } }


Assets Form using using using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Diagnostics; System.Drawing; System.IO; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms; WorkingAssests.Resources.res;

namespace WorkingAssests { public partial class AssetsForm : Form { public string AssetID { set; get; } public AssetsForm() { InitializeComponent(); } private void CloseCmd_Click(object sender, EventArgs e) { Close(); } private void browsephotobutton_Click(object sender, EventArgs e) { int size = -1; DialogResult result = openFileDialog1.ShowDialog(); // Show the dialog. if (result == DialogResult.OK) // Test result. { string file = openFileDialog1.FileName; try { Bitmap tmp = new Bitmap(file); assetphoto.Image = tmp; imagefilepathtxt.Text = file; } catch (IOException ex) { Debug.WriteLine(ex.ToString()); } } } private void AssetsForm_Load(object sender, EventArgs e) { DAL.ConnectionString = Properties.Settings.Default.MySQLConnectionString; if(Parameters.Privilages.Equals("Admin")) bindingSource1.DataSource = DAL.GetAllAssets();


else if (Parameters.Privilages.Equals("Reader")) bindingSource1.DataSource = DAL.GetAllAssets(true); else bindingSource1.DataSource = DAL.GetAllAssets(Parameters.UserId); assetcategoryidcombo.DataSource = DAL.GetAllAssetCategories(); assetcategoryidcombo.DisplayMember = "Category"; assetcategoryidcombo.ValueMember = "AssetCategoryId"; statuscombo.DataSource = DAL.GetAllStatuses(); statuscombo.DisplayMember = "Status1"; statuscombo.ValueMember = "StatusId"; vendoridcombo.DataSource = DAL.GetAllVendors(); vendoridcombo.DisplayMember = "VendorName"; vendoridcombo.ValueMember = "VendorId"; classidcombo.DataSource = DAL.GetAllClasses(); classidcombo.DisplayMember = "ClassNo"; classidcombo.ValueMember = "ClassId"; if (Parameters.Privilages == "Reader") { saveToolStripButton.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; bindingNavigatorAddNewItem.Enabled = false; } if (Parameters.Privilages == "Inputer") { bindingNavigatorDeleteItem.Enabled = false; } if (!Parameters.Privilages.Equals("Admin")) { chkactive.Enabled = false; } if(AssetID != null) { bindingSource1.DataSource = bindingSource1.List.OfType<asset>().ToList().Find(f => f.AssetId == int.Parse(AssetID)); } Resources.res.ViewResources.CultureChange += CultureChanged; this.CultureChanged(null, null); } private void CultureChanged(object sender, EventArgs e) { label2.Text = ViewResources.AssetDescriptionLabel; label3.Text = ViewResources.AssetCategoryIdLabel; label4.Text = ViewResources.StatusButton; label5.Text = ViewResources.VendorIdLabel; label6.Text = ViewResources.ModelNumberLabel; label7.Text = ViewResources.SerialNumberLabel; label8.Text = ViewResources.BarCodeNumberLabel; label9.Text = ViewResources.DateAcquiredLabel; label10.Text = ViewResources.DateDiscartedLabel; label17.Text = ViewResources.ActiveAssetsLabel; label11.Text = ViewResources.PurchasePriceLabel; label12.Text = ViewResources.CommentsLabel; label13.Text = ViewResources.NextScheduleMaintenanceLabel;


label14.Text = ViewResources.StockCardNoLabel; label15.Text = ViewResources.ClassIdLabel; label16.Text = ViewResources.PhotoLabel; refreshbutton.Text = ViewResources.RefreshButton; browsephotobutton.Text = ViewResources.BrowseButton; CloseCmd.Text = ViewResources.ExitButton; this.Text = ViewResources.AssetButton; groupBox1.Text = ViewResources.AssetDescriptionLabel; } private void saveToolStripButton_Click(object sender, EventArgs e) { if (!Parameters.Privilages.Equals("Reader")) { SaveAsset(); } } private void SaveAsset() { try { bool newimage = false; asset a = new asset(); a.AssetCategoryId = int.Parse(assetcategoryidcombo.SelectedValue.ToString()); a.AssetDescription = assetdescriptiontxt.Text; a.BarcodeNumber = barcodenumbertxt.Text; a.ClassId = int.Parse(classidcombo.SelectedValue.ToString()); a.Comments = commentstxt.Text; a.DateAcquired = dateaquired.Value.Date; if(datediscared.Value.Date > DateTime.Now.Date) a.DateDiscarted = datediscared.Value.Date; a.ModelNumber = modelnumbertxt.Text; if (nextschedulemaint.Value.Date > DateTime.Now.Date) a.NextSchedMaint = nextschedulemaint.Value.Date; if(!string.IsNullOrEmpty(imagefilepathtxt.Text)) { a.Photo = File.ReadAllBytes(imagefilepathtxt.Text); newimage = true; } a.PurchasePrice = purchasepricetxt.Text; a.SerialNumber = serialnumbertxt.Text; a.StatusId = int.Parse(statuscombo.SelectedValue.ToString()); a.StckCardNo = stockcardnotxt.Text; a.VendorId = int.Parse(vendoridcombo.SelectedValue.ToString()); if (Parameters.Privilages.Equals("Admin")) { if (chkactive.CheckState == CheckState.Checked) a.active = 1; else a.active = 0; }


else { a.active = 0; } a.userid = Parameters.UserId; if (((asset)bindingNavigator1.BindingSource.Current == null) || (DAL.AssetExist(((asset)bindingNavigator1.BindingSource.Current).AssetId) != true)) { if (DAL.InsertAsset(a) > 0) { if (Parameters.Privilages.Equals("Admin")) bindingSource1.DataSource = DAL.GetAllAssets(); else if (Parameters.Privilages.Equals("Reader")) bindingSource1.DataSource = DAL.GetAllAssets(true); else bindingSource1.DataSource = DAL.GetAllAssets(Parameters.UserId); MessageBox.Show("The Asset has been saved."); } else MessageBox.Show("The Asset has not been saved."); } else { a.AssetId = ((asset)bindingNavigator1.BindingSource.Current).AssetId; if (DAL.UpdateAsset(a, newimage) > 0) MessageBox.Show("The Asset has been updated."); else MessageBox.Show("The Asset has not been updated."); } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } } private void datediscared_ValueChanged(object sender, EventArgs e) { } private void nextschedulemaint_ValueChanged(object sender, EventArgs e) {


} private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { chkactive.Checked = false; assetidtxt.Text = "0"; }

private void refreshbutton_Click(object sender, EventArgs e) { } private void bindingNavigatorDeleteItem_Click(object sender, MouseEventArgs e) { if (DAL.DeleteAsset(((asset)bindingNavigator1.BindingSource.Current).AssetId) > 0) { if(DAL.GetAllAssets().Count() > 0) { if (Parameters.Privilages.Equals("Admin")) bindingSource1.DataSource = DAL.GetAllAssets(); else if (Parameters.Privilages.Equals("Reader")) bindingSource1.DataSource = DAL.GetAllAssets(true); else bindingSource1.DataSource = DAL.GetAllAssets(Parameters.UserId); } else bindingSource1.Clear(); MessageBox.Show("The Asset has been deleted."); } else MessageBox.Show("The Asset has not been deleted."); } private void imagefilepathtxt_TextChanged(object sender, EventArgs e) { //FileDownloadUpload.UploadFile(Properties.Settings.Default.ip, int.Parse(Properties.Settings.Default.port), Properties.Settings.Default.username, Properties.Settings.Default.password, Properties.Settings.Default.RemoteDirectory + Path.GetFileName(imagefilepathtxt.Text), imagefilepathtxt.Text); } } }


Staff Form using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms; WorkingAssests.Resources.res;

namespace WorkingAssests { public partial class StaffForm : Form { public StaffForm() { InitializeComponent(); } private void CloseCmd_Click(object sender, EventArgs e) { Close(); } private void StaffForm_Load(object sender, EventArgs e) { DAL.ConnectionString = Properties.Settings.Default.MySQLConnectionString; bindingSource1.DataSource = DAL.GetAllStaff(); titlecombo.DataSource = DAL.GetAllTitles(); titlecombo.DisplayMember = "Title1"; titlecombo.ValueMember = "TitleId"; departmentcombo.DataSource = DAL.GetAllDepartments(); departmentcombo.DisplayMember = "department1"; departmentcombo.ValueMember = "departmentid"; if (!Parameters.Privilages.Equals("Admin")) { saveToolStripButton.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; bindingNavigatorAddNewItem.Enabled = false; } Resources.res.ViewResources.CultureChange += CultureChanged; this.CultureChanged(null, null); } private void CultureChanged(object sender, EventArgs e) { label1.Text = ViewResources.StaffIdLabel; label2.Text = ViewResources.FirstNameLabel; label3.Text = ViewResources.LastNameLabel; label4.Text = ViewResources.TitleLabel; label5.Text = ViewResources.ExtensionLabel;


label6.Text = ViewResources.PhoneNumberLabel; label7.Text = ViewResources.MobileNumberLabel; label8.Text = ViewResources.SpecalizationLabel; label9.Text = ViewResources.DepartmentLabel; CloseCmd.Text = ViewResources.ExitButton; groupBox1.Text = ViewResources.PersonalInformationLabel; this.Text = ViewResources.StaffButton; } private void saveToolStripButton_Click(object sender, EventArgs e) { SaveStaff(); } private void SaveStaff() { try { staff s = new staff(); s.FirstName = firstnametextbox.Text; s.LastName = lastnametextbox.Text; s.Title = int.Parse(titlecombo.SelectedValue.ToString()); s.Extension = extensiontextbox.Text; s.HomePhone = homephonetextbox.Text; s.MobilePhone = mobilephonetextbox.Text; s.Specalization = specalizationtextbox.Text; s.DepartmentId = int.Parse(departmentcombo.SelectedValue.ToString()); if ((((staff)bindingNavigator1.BindingSource.Current) == null) || (DAL.StaffExist(((staff)bindingNavigator1.BindingSource.Current).StaffId) != true)) { if (DAL.InsertStaff(s) > 0) { bindingSource1.DataSource = DAL.GetAllStaff(); MessageBox.Show("The staff has been saved."); } else MessageBox.Show("The staff has not been saved."); } else { s.StaffId = ((staff)bindingNavigator1.BindingSource.Current).StaffId; if (DAL.UpdateStaff(s) > 0) MessageBox.Show("The staff has been updated."); else MessageBox.Show("The staff has not been updated."); } } catch (Exception ex) { ex.ToString();


} } private void bindingNavigatorMoveNextItem_Click(object sender, EventArgs e) { } private void bindingNavigatorMovePreviousItem_Click(object sender, EventArgs e) { } private void bindingNavigatorDeleteItem_MouseDown(object sender, MouseEventArgs e) { if (DAL.DeleteStaff(((staff)bindingNavigator1.BindingSource.Current).StaffId) > 0) { if(DAL.GetAllStaff().Count() > 0) bindingSource1.DataSource = DAL.GetAllStaff(); else bindingSource1.Clear(); MessageBox.Show("The staff has been deleted."); } else MessageBox.Show("The staff has not been deleted."); } private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { staffidtextbox.Text = "0"; } } }


Categories Form using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms; WorkingAssests.Resources.res;

namespace WorkingAssests { public partial class CategoriesForm : Form { public CategoriesForm() { InitializeComponent(); } private void CloseCmd_Click(object sender, EventArgs e) { Close(); } private void CategoriesForm_Load(object sender, EventArgs e) { try { //TopMost = true; DAL.ConnectionString = Parameters.ConnectionString; if(DAL.GetAllCategories() != null) { if (DAL.GetAllCategories().Count > 0) bindingSource1.DataSource = DAL.GetAllCategories(); } if(!Parameters.Privilages.Equals("Admin")) { saveToolStripButton.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; bindingNavigatorAddNewItem.Enabled = false; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } Resources.res.ViewResources.CultureChange += CultureChanged; this.CultureChanged(null, null); } private void CultureChanged(object sender, EventArgs e) {


this.Text = ViewResources.CategoriesButton; groupBox1.Text = ViewResources.CategoryInformationLabel; label3.Text = ViewResources.CategoriesButton; CloseCmd.Text = ViewResources.ExitButton; } private void saveToolStripButton_Click(object sender, EventArgs e) { SaveCategory(); } private void SaveCategory() { try { assetcategory c = new assetcategory(); c.Category = categorytxt.Text; if (((assetcategory)bindingNavigator1.BindingSource.Current == null) || (DAL.CategoryExist(((assetcategory)bindingNavigator1.BindingSource.Current ).AssetCategoryId) != true)) { if (DAL.InsertCategory(c) > 0) { if (DAL.GetAllCategories().Count > 0) bindingSource1.DataSource = DAL.GetAllCategories(); MessageBox.Show("The Category has been saved."); } else MessageBox.Show("The Category has not been saved."); } else { c.AssetCategoryId = ((assetcategory)bindingNavigator1.BindingSource.Current).AssetCategoryId; if (DAL.UpdateCategory(c) > 0) MessageBox.Show("The Category has been updated."); else MessageBox.Show("The Category has not been updated."); } } catch (Exception ex) { ex.ToString(); } } private void bindingNavigatorDeleteItem_MouseDown(object sender, MouseEventArgs e) { if(DAL.DeleteCategory(((assetcategory)bindingNavigator1.BindingSource.Curr ent).AssetCategoryId) > 0) {


if (DAL.GetAllCategories().Count > 0) bindingSource1.DataSource = DAL.GetAllCategories(); else bindingSource1.Clear(); MessageBox.Show("The Category has been deleted."); } else MessageBox.Show("The Category has not been deleted."); } private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { categoryidtxt.Text = "0"; } } }


Vendors Form using using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Diagnostics; System.Drawing; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms; WorkingAssests.Resources.res;

namespace WorkingAssests { public partial class VendorsForm : Form { public VendorsForm() { InitializeComponent(); } private void CloseCmd_Click(object sender, EventArgs e) { Close(); } private void saveToolStripButton_Click(object sender, EventArgs e) { if (!Parameters.Privilages.Equals("Reader")) { SaveVendor(); } } private void VendorsForm_Load(object sender, EventArgs e) { try { //TopMost = true; DAL.ConnectionString = Parameters.ConnectionString; bindingSource1.DataSource = DAL.GetAllVendors(); titletxt.DataSource = DAL.GetAllTitles(); titletxt.DisplayMember = "Title1"; titletxt.ValueMember = "TitleId"; if (!Parameters.Privilages.Equals("Admin")) { saveToolStripButton.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; bindingNavigatorAddNewItem.Enabled = false; } Resources.res.ViewResources.CultureChange += CultureChanged; this.CultureChanged(null, null); }


catch (Exception ex) { MessageBox.Show(ex.ToString()); } } private void CultureChanged(object sender, EventArgs e) { label1.Text = ViewResources.VendorIdLabel; label3.Text = ViewResources.FirstNameLabel; label4.Text = ViewResources.LastNameLabel; label5.Text = ViewResources.TitleLabel; label2.Text = ViewResources.VendorNameLabel; label6.Text = ViewResources.AddressLabel; label7.Text = ViewResources.CityLabel; label8.Text = ViewResources.CountryLabel; label9.Text = ViewResources.PostalCodeLabel; label10.Text = ViewResources.PhoneNumberLabel; label11.Text = ViewResources.MobileNumberLabel; label12.Text = ViewResources.FaxNumberLabel; this.Text = ViewResources.VendorsButton; CloseCmd.Text = ViewResources.ExitButton; groupBox1.Text = ViewResources.PersonalInformationLabel; groupBox2.Text = ViewResources.ContactInformationLabel; } private void SaveVendor() { try { vendor v = new vendor(); v.Title = int.Parse(titletxt.SelectedValue.ToString()); v.ContactFirstName = firstnametxt.Text; v.ContactLastName = lastnametxt.Text; v.Address = addresstxt.Text; v.City = citytxt.Text; v.Country = countrytxt.Text; v.FaxNumber = faxnumbertxt.Text; v.MobileNumber = mobilephonetxt.Text; v.PhoneNumber = phonenumbertxt.Text; v.VendorName = vendornametxt.Text; v.PostalCode = postalcodetxt.Text; if ((((vendor)bindingNavigator1.BindingSource.Current) == null) || (DAL.VendorExist(((vendor)bindingNavigator1.BindingSource.Current).VendorI d) != true)) { if (DAL.InsertVendor(v) > 0) { bindingSource1.DataSource = DAL.GetAllVendors(); MessageBox.Show("The Vendor has been saved."); } else MessageBox.Show("The Vendor has not been saved."); } else


{ v.VendorId = ((vendor)bindingNavigator1.BindingSource.Current).VendorId; if (DAL.UpdateVendor(v) > 0) MessageBox.Show("The Vendor has been updated."); else MessageBox.Show("The Vendor has not been updated."); } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } } private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { } private void bindingNavigatorDeleteItem_MouseDown(object sender, MouseEventArgs e) { if(DAL.DeleteVendor(((vendor)bindingNavigator1.BindingSource.Current).Vend orId) >0) { if(DAL.GetAllVendors().Count() > 0) bindingSource1.DataSource = DAL.GetAllVendors(); else bindingSource1.Clear(); MessageBox.Show("The Vendor has been deleted."); } else MessageBox.Show("The Vendors has not been deleted."); } } }


Users Form using using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Diagnostics; System.Drawing; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms; WorkingAssests.Resources.res;

namespace WorkingAssests { public partial class UserForm : Form { public UserForm() { InitializeComponent(); } private void CloseCmd_Click(object sender, EventArgs e) { Close(); } private void UserForm_Load(object sender, EventArgs e) { try { //TopMost = true; DAL.ConnectionString = Parameters.ConnectionString; bindingSource1.DataSource = DAL.GetAllUsers(); if (Parameters.Privilages != null && !Parameters.Privilages.Equals("Admin")) { saveToolStripButton.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; bindingNavigatorAddNewItem.Enabled = false; } else { return; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { Resources.res.ViewResources.CultureChange += CultureChanged; this.CultureChanged(null, null);


} } private void CultureChanged(object sender, EventArgs e) { this.Text = ViewResources.UsersButton; groupBox1.Text = ViewResources.UserInformationLabel; label4.Text = ViewResources.FirstNameLabel; label5.Text = ViewResources.LastNameLabel; label7.Text = ViewResources.PrevilagesLabel; label1.Text = ViewResources.UsernameLabel; label2.Text = ViewResources.PasswordLabel; label3.Text = ViewResources.RetypePasswordLabel; CloseCmd.Text = ViewResources.ExitButton; } private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { useridtxt.Text = "0"; } private void saveToolStripButton_Click(object sender, EventArgs e) { SaveUser(); } private void SaveUser() { try { user u = new user(); u.FirstName = firstnametxt.Text; u.LastName = lastnametxt.Text; u.Username = usernametxt.Text; u.Password = passwordtxt.Text; u.Privileges = privilagescombo.Text; if ((((user)bindingNavigator1.BindingSource.Current) == null) || (DAL.UserExist(((user)bindingNavigator1.BindingSource.Current).UserId) != true)) { if (passwordtxt.Text.Equals(retypepasswordtxt.Text) == false) { MessageBox.Show("The retype password does not matched!!!"); return; } if (DAL.InsertUser(u) > 0) { bindingSource1.DataSource = DAL.GetAllUsers(); MessageBox.Show("The User has been saved."); } else MessageBox.Show("The User has not been saved.");


} else { u.UserId = ((user)bindingNavigator1.BindingSource.Current).UserId; if (DAL.UpdateUser(u) > 0) MessageBox.Show("The User has been updated."); else MessageBox.Show("The Vendor has not been updated."); } } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } } private void bindingNavigatorDeleteItem_MouseDown(object sender, MouseEventArgs e) { if (DAL.DeleteUser(((user)bindingNavigator1.BindingSource.Current).UserId) > 0) { bindingSource1.DataSource = DAL.GetAllUsers(); MessageBox.Show("The User has been deleted."); } else MessageBox.Show("The User has not been deleted."); } } }


Classes Form using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms; WorkingAssests.Resources.res;

namespace WorkingAssests { public partial class ClassesForm : Form { public ClassesForm() { InitializeComponent(); } private void ClassesForm_Load(object sender, EventArgs e) { DAL.ConnectionString = Parameters.ConnectionString; bindingSource1.DataSource = DAL.GetAllClasses(); staffcombo.DataSource = DAL.GetAllStaff(); staffcombo.DisplayMember = "LastName"; staffcombo.ValueMember = "StaffId"; departmentcombo.DataSource = DAL.GetAllDepartments(); departmentcombo.DisplayMember = "department1"; departmentcombo.ValueMember = "departmentid"; if (!Parameters.Privilages.Equals("Admin")) { saveToolStripButton.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; bindingNavigatorAddNewItem.Enabled = false; } Resources.res.ViewResources.CultureChange += CultureChanged; this.CultureChanged(null, null); } private void CultureChanged(object sender, EventArgs e) { this.Text = ViewResources.ClassesButton; groupBox1.Text = ViewResources.ClassInformationLabel; label2.Text = ViewResources.ClassIdLabel; label3.Text = ViewResources.ClassNoLabel; label1.Text = ViewResources.StaffButton; label4.Text = ViewResources.DepartmentLabel; CloseCmd.Text = ViewResources.ExitButton; } private void CloseCmd_Click(object sender, EventArgs e) { Close();


} private void SaveClass() { try { @class cl = new @class(); cl.ClassNo = classnotextbox.Text; cl.StaffId = int.Parse(staffcombo.SelectedValue.ToString()); cl.DepartmentId = int.Parse(departmentcombo.SelectedValue.ToString()); if (((@class)bindingNavigator1.BindingSource.Current == null) || (DAL.ClassExist(((@class)bindingNavigator1.BindingSource.Current).ClassId) != true)) { if (DAL.InsertClass(cl) > 0) { bindingSource1.DataSource = DAL.GetAllClasses(); MessageBox.Show("The Class has been saved."); } else MessageBox.Show("The Class has not been saved."); } else { cl.ClassId = ((@class)bindingNavigator1.BindingSource.Current).ClassId; if (DAL.UpdateClass(cl) > 0) MessageBox.Show("The Class has been updated."); else MessageBox.Show("The Class has not been updated."); } } catch (Exception ex) { ex.ToString(); } } private void saveToolStripButton_Click(object sender, EventArgs e) { SaveClass(); } private void bindingNavigatorDeleteItem_MouseDown(object sender, MouseEventArgs e) { if (DAL.DeleteClass(((@class)bindingNavigator1.BindingSource.Current).ClassId ) > 0) { if (DAL.GetAllClasses().Count() > 0) bindingSource1.DataSource = DAL.GetAllClasses();


else bindingSource1.Clear(); MessageBox.Show("The class has been deleted."); } else MessageBox.Show("The class has not been deleted."); } private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { classidtextbox.Text = "0"; } } }


Titles form using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms; WorkingAssests.Resources.res;

namespace WorkingAssests { public partial class TitleForm : Form { public TitleForm() { InitializeComponent(); } private void CloseCmd_Click(object sender, EventArgs e) { Close(); } private void TitleForm_Load(object sender, EventArgs e) { try { //TopMost = true; DAL.ConnectionString = Parameters.ConnectionString; bindingSource1.DataSource = DAL.GetAllTitles(); if (!Parameters.Privilages.Equals("Admin")) { saveToolStripButton.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; bindingNavigatorAddNewItem.Enabled = false; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } Resources.res.ViewResources.CultureChange += CultureChanged; this.CultureChanged(null, null); } private void CultureChanged(object sender, EventArgs e) { this.Text = ViewResources.TitleButton; label3.Text = ViewResources.TitleLabel; groupBox1.Text = ViewResources.TitleInformationLabel; CloseCmd.Text = ViewResources.ExitButton; }


private void saveToolStripButton_Click(object sender, EventArgs e) { SaveTitle(); } private void SaveTitle() { try { title t = new title(); t.Title1 = textBox2.Text; if (((title)bindingNavigator1.BindingSource.Current == null) || (DAL.TitleExist(((title)bindingNavigator1.BindingSource.Current).TitleId) != true)) { if (DAL.InsertTitle(t) > 0) { bindingSource1.DataSource = DAL.GetAllTitles(); MessageBox.Show("The title has been saved."); } else MessageBox.Show("The title has not been saved."); } else { t.TitleId = ((title)bindingNavigator1.BindingSource.Current).TitleId; if (DAL.UpdateTitle(t) > 0) MessageBox.Show("The title has been updated."); else MessageBox.Show("The title has not been updated."); } } catch (Exception ex) { ex.ToString(); } } private void bindingNavigatorDeleteItem_MouseDown(object sender, MouseEventArgs e) { if(DAL.DeleteTitle(((title)bindingNavigator1.BindingSource.Current).TitleI d) >0) { if(DAL.GetAllTitles().Count() > 0) bindingSource1.DataSource = DAL.GetAllTitles(); else bindingSource1.Clear(); MessageBox.Show("The title has been deleted."); } else MessageBox.Show("The title has not been deleted."); }


private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { textBox1.Text = "0"; } } }


Departments Form using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms; WorkingAssests.Resources.res;

namespace WorkingAssests { public partial class DepartmentsForm : Form { public DepartmentsForm() { InitializeComponent(); } private void CloseCmd_Click(object sender, EventArgs e) { Close(); } private void DepartmentsForm_Load(object sender, EventArgs e) { //TopMost = true; DAL.ConnectionString = Parameters.ConnectionString; bindingSource1.DataSource = DAL.GetAllDepartments(); if (!Parameters.Privilages.Equals("Admin")) { saveToolStripButton.Enabled = false; bindingNavigatorDeleteItem.Enabled = false; bindingNavigatorAddNewItem.Enabled = false; } Resources.res.ViewResources.CultureChange += CultureChanged; this.CultureChanged(null, null); } private void CultureChanged(object sender, EventArgs e) { this.Text = ViewResources.DepartmentsButton; groupBox1.Text = ViewResources.DepartmentInformationLabel; label3.Text = ViewResources.DepartmentLabel; CloseCmd.Text = ViewResources.ExitButton; } private void SaveDepartment() { try { department d = new department(); d.department1 = departmenttextbox.Text;


if (((department)bindingNavigator1.BindingSource.Current == null) || (DAL.DepartmentExist(((department)bindingNavigator1.BindingSource.Current) .departmentid) != true)) { if (DAL.InsertDepartment(d) > 0) { bindingSource1.DataSource = DAL.GetAllDepartments(); MessageBox.Show("The Department has been saved."); } else MessageBox.Show("The Department has not been saved."); } else { d.departmentid = ((department)bindingNavigator1.BindingSource.Current).departmentid; if (DAL.UpdateDepartment(d) > 0) MessageBox.Show("The Department has been updated."); else MessageBox.Show("The Department has not been updated."); } } catch (Exception ex) { ex.ToString(); } } private void saveToolStripButton_Click(object sender, EventArgs e) { SaveDepartment(); } private void bindingNavigatorDeleteItem_MouseDown(object sender, MouseEventArgs e) { if(DAL.DeleteDepartment(((department)bindingNavigator1.BindingSource.Curre nt).departmentid) >0) { if(DAL.GetAllDepartments().Count() > 0) bindingSource1.DataSource = DAL.GetAllDepartments(); else bindingSource1.Clear(); MessageBox.Show("The department has been deleted."); } else MessageBox.Show("The department has not been deleted."); }


private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e) { departmentidtextbox.Text = "0"; } } }


LogIn Form using using using using using using using using using using

System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.IO; System.Linq; System.Text; System.Threading.Tasks; System.Windows.Forms;

namespace WorkingAssests { public partial class LoginForm : Form { public LoginForm() { InitializeComponent(); Parameters.ConnectionString = Properties.Settings.Default.MySQLConnectionString; } private void button1_Click(object sender, EventArgs e) { Close(); } private void button2_Click(object sender, EventArgs e) { try { DAL.ConnectionString = Parameters.ConnectionString; if (DAL.Login(textBox1.Text, textBox2.Text) == true) { Form1 f1 = new Form1(); f1.Show(); this.Close(); } else { MessageBox.Show("Wrong Username or Passoword!!!"); } } catch (Exception ex) { using (StreamWriter sw = new StreamWriter(Properties.Settings.Default.LogDirectory)) { sw.WriteLine(ex.ToString()); } } } private void LoginForm_Load(object sender, EventArgs e)


{ DAL.ConnectionString = Parameters.ConnectionString; var totalusers = DAL.GetAllUsers().Count(); if (totalusers < 1) { UserForm uf = new UserForm(); uf.Show(); this.Close(); } } } }


Global Parameters using using using using using

System; System.Collections.Generic; System.Linq; System.Text; System.Threading.Tasks;

namespace WorkingAssests { public static class Parameters { public static string ConnectionString { get; set; } public static bool Login { get; set; } public static string Firstname { get; set; } public static string Lastname { get; set; } public static string UserName { get; set; } public static string Privilages { get; set; } public static int UserId { get; set; } public static int DGRowHeight => 50; } }


Multilanguage using using using using using using using using

System; System.Collections.Generic; System.Linq; System.Text; System.Threading.Tasks; System; System.Collections.Generic; System.ComponentModel;

namespace WorkingAssests.Resources.res { public class ViewResources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; public static event EventHandler CultureChange = delegate { }; public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged; private static void NotifyStaticPropertyChanged(string propertyName) { if (StaticPropertyChanged != null) StaticPropertyChanged(null, new PropertyChangedEventArgs(propertyName)); } [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microso ft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal ViewResources() { } /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.Com ponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WorkingAssests.Resources.res.Vie wResources", typeof(ViewResources).Assembly);


resourceMan = temp; } return resourceMan; } } public static Object GetPropertyValue(string PropName) { if (string.IsNullOrEmpty(PropName)) return null; Type objType; objType = typeof(ViewResources); System.Reflection.PropertyInfo pInfo = objType.GetProperty(PropName); Object PropValue = null; if (pInfo != null) { PropValue = pInfo.GetValue(objType, System.Reflection.BindingFlags.GetProperty, null, null, null); } return PropValue; } /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.Com ponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { if (value != resourceCulture) { resourceCulture = value; CultureChange.Invoke(null, null); } } } /// <summary> /// Looks up a localized string similar to Add. /// </summary> /// private static string _ExitButton; public static string ExitButton { get { _ExitButton = ResourceManager.GetString("ExitButton", resourceCulture); if (string.IsNullOrEmpty(_ExitButton)) _ExitButton = "Exit"; return _ExitButton;


} } private static string _ActiveAssetsLabel; public static string ActiveAssetsLabel { get { _ActiveAssetsLabel = ResourceManager.GetString("ActiveAssetsLabel", resourceCulture); if (string.IsNullOrEmpty(_ActiveAssetsLabel)) _ActiveAssetsLabel = "Active Assets"; return _ActiveAssetsLabel; } } private static string _AssetButton; public static string AssetButton { get { _AssetButton = ResourceManager.GetString("AssetButton", resourceCulture); if (string.IsNullOrEmpty(_AssetButton)) _AssetButton = "Assets"; return _AssetButton; } } private static string _AssetsNewButton; public static string AssetsNewButton { get { _AssetsNewButton = ResourceManager.GetString("AssetsNewButton", resourceCulture); if (string.IsNullOrEmpty(_AssetsNewButton)) _AssetsNewButton = "New Assets"; return _AssetsNewButton; } } private static string _AssetCategoryLabel; public static string AssetCategoryLabel { get { _AssetCategoryLabel = ResourceManager.GetString("AssetCategoryLabel", resourceCulture); if (string.IsNullOrEmpty(_AssetCategoryLabel)) _AssetCategoryLabel = "Asset Category"; return _AssetCategoryLabel; } } private static string _AssetDescriptionLabel; public static string AssetDescriptionLabel { get { _AssetDescriptionLabel = ResourceManager.GetString("AssetDescriptionLabel", resourceCulture); if (string.IsNullOrEmpty(_AssetDescriptionLabel))


_AssetCategoryLabel = "Asset Description"; return _AssetDescriptionLabel; } } private static string _BarCodeNumberLabel; public static string BarCodeNumberLabel { get { _BarCodeNumberLabel = ResourceManager.GetString("BarCodeNumberLabel", resourceCulture); if (string.IsNullOrEmpty(_BarCodeNumberLabel)) _BarCodeNumberLabel = "Bar Code Number"; return _BarCodeNumberLabel; } } private static string _CategoriesButton; public static string CategoriesButton { get { _CategoriesButton = ResourceManager.GetString("CategoriesButton", resourceCulture); if (string.IsNullOrEmpty(_CategoriesButton)) _CategoriesButton = "Categories"; return _CategoriesButton; } } private static string _ClassesButton; public static string ClassesButton { get { _ClassesButton = ResourceManager.GetString("ClassesButton", resourceCulture); if (string.IsNullOrEmpty(_ClassesButton)) _ClassesButton = "Classes"; return _ClassesButton; } } private static string _DepartmentsButton; public static string DepartmentsButton { get { _DepartmentsButton = ResourceManager.GetString("DepartmentsButton", resourceCulture); if (string.IsNullOrEmpty(_DepartmentsButton)) _DepartmentsButton = "Departments"; return _DepartmentsButton; } } private static string _SearchButton; public static string SearchButton { get {


_SearchButton = ResourceManager.GetString("SearchButton", resourceCulture); if (string.IsNullOrEmpty(_SearchButton)) _SearchButton = "Search"; return _SearchButton; } } private static string _SearchFilters; public static string SearchFilters { get { _SearchFilters = ResourceManager.GetString("SearchFilters", resourceCulture); if (string.IsNullOrEmpty(_SearchFilters)) _SearchFilters = "Search Filters"; return _SearchFilters; } } private static string _SerialNumberLabel; public static string SerialNumberLabel { get { _SerialNumberLabel = ResourceManager.GetString("SerialNumberLabel", resourceCulture); if (string.IsNullOrEmpty(_SerialNumberLabel)) _SerialNumberLabel = "Serial Number"; return _SerialNumberLabel; } } private static string _StaffButton; public static string StaffButton { get { _StaffButton = ResourceManager.GetString("StaffButton", resourceCulture); if (string.IsNullOrEmpty(_StaffButton)) _StaffButton = "Staff"; return _StaffButton; } } private static string _StatusButton; public static string StatusButton { get { _StatusButton = ResourceManager.GetString("StatusButton", resourceCulture); if (string.IsNullOrEmpty(_StatusButton)) _StatusButton = "Status"; return _StatusButton; } } private static string _UsersButton; public static string UsersButton {


get { _UsersButton = ResourceManager.GetString("UsersButton", resourceCulture); if (string.IsNullOrEmpty(_UsersButton)) _UsersButton = "Users"; return _UsersButton; } } private static string _VendorsButton; public static string VendorsButton { get { _VendorsButton = ResourceManager.GetString("VendorsButton", resourceCulture); if (string.IsNullOrEmpty(_VendorsButton)) _VendorsButton = "Vendors"; return _VendorsButton; } } private static string _TitleButton; public static string TitleButton { get { _TitleButton = ResourceManager.GetString("TitleButton", resourceCulture); if (string.IsNullOrEmpty(_TitleButton)) _TitleButton = "Title"; return _TitleButton; } } private static string _UpdateButton; public static string UpdateButton { get { _UpdateButton = ResourceManager.GetString("UpdateButton", resourceCulture); if (string.IsNullOrEmpty(_UpdateButton)) _UpdateButton = "Update"; return _UpdateButton; } } private static string _ClearButton; public static string ClearButton { get { _ClearButton = ResourceManager.GetString("ClearButton", resourceCulture); if (string.IsNullOrEmpty(_ClearButton)) _ClearButton = "Clear"; return _ClearButton; } } private static string _RefreshButton;


public static string RefreshButton { get { _RefreshButton = ResourceManager.GetString("RefreshButton", resourceCulture); if (string.IsNullOrEmpty(_RefreshButton)) _RefreshButton = "Refresh"; return _RefreshButton; } } private static string _BrowseButton; public static string BrowseButton { get { _BrowseButton = ResourceManager.GetString("BrowseButton", resourceCulture); if (string.IsNullOrEmpty(_BrowseButton)) _BrowseButton = "Browse"; return _BrowseButton; } } private static string _AssetCategoryIdLabel; public static string AssetCategoryIdLabel { get { _AssetCategoryIdLabel = ResourceManager.GetString("AssetCategoryIdLabel", resourceCulture); if (string.IsNullOrEmpty(_AssetCategoryIdLabel)) _AssetCategoryIdLabel = "Asset Category Id"; return _AssetCategoryIdLabel; } } private static string _VendorIdLabel; public static string VendorIdLabel { get { _VendorIdLabel = ResourceManager.GetString("VendorIdLabel", resourceCulture); if (string.IsNullOrEmpty(_VendorIdLabel)) _VendorIdLabel = "Vendor Id"; return _VendorIdLabel; } } private static string _ModelNumberLabel; public static string ModelNumberLabel { get { _ModelNumberLabel = ResourceManager.GetString("ModelNumberLabel", resourceCulture); if (string.IsNullOrEmpty(_ModelNumberLabel)) _ModelNumberLabel = "Model Number"; return _ModelNumberLabel; }


} private static string _DateAcquiredLabel; public static string DateAcquiredLabel { get { _DateAcquiredLabel = ResourceManager.GetString("DateAcquiredLabel", resourceCulture); if (string.IsNullOrEmpty(_DateAcquiredLabel)) _DateAcquiredLabel = "Date Acquired"; return _DateAcquiredLabel; } } private static string _DateDiscartedLabel; public static string DateDiscartedLabel { get { _DateDiscartedLabel = ResourceManager.GetString("DateDiscartedLabel", resourceCulture); if (string.IsNullOrEmpty(_DateDiscartedLabel)) _DateDiscartedLabel = "Date Discarted"; return _DateDiscartedLabel; } } private static string _PurchasePriceLabel; public static string PurchasePriceLabel { get { _PurchasePriceLabel = ResourceManager.GetString("PurchasePriceLabel", resourceCulture); if (string.IsNullOrEmpty(_PurchasePriceLabel)) _PurchasePriceLabel = "Purchase Price"; return _PurchasePriceLabel; } } private static string _CommentsLabel; public static string CommentsLabel { get { _CommentsLabel = ResourceManager.GetString("CommentsLabel", resourceCulture); if (string.IsNullOrEmpty(_CommentsLabel)) _CommentsLabel = "Comments"; return _CommentsLabel; } } private static string _NextScheduleMaintenanceLabel; public static string NextScheduleMaintenanceLabel { get { _NextScheduleMaintenanceLabel = ResourceManager.GetString("NextScheduleMaintenanceLabel", resourceCulture); if (string.IsNullOrEmpty(_NextScheduleMaintenanceLabel))


_NextScheduleMaintenanceLabel = "Next Schedule Maintenance"; return _NextScheduleMaintenanceLabel; } } private static string _StockCardNoLabel; public static string StockCardNoLabel { get { _StockCardNoLabel = ResourceManager.GetString("StockCardNoLabel", resourceCulture); if (string.IsNullOrEmpty(_StockCardNoLabel)) _StockCardNoLabel = "Stock Card No"; return _StockCardNoLabel; } } private static string _ClassIdLabel; public static string ClassIdLabel { get { _ClassIdLabel = ResourceManager.GetString("ClassIdLabel", resourceCulture); if (string.IsNullOrEmpty(_ClassIdLabel)) _ClassIdLabel = "Class Id"; return _ClassIdLabel; } } private static string _PhotoLabel; public static string PhotoLabel { get { _PhotoLabel = ResourceManager.GetString("PhotoLabel", resourceCulture); if (string.IsNullOrEmpty(_PhotoLabel)) _PhotoLabel = "Photo"; return _PhotoLabel; } } private static string _TitleLabel; public static string TitleLabel { get { _TitleLabel = ResourceManager.GetString("TitleLabel", resourceCulture); if (string.IsNullOrEmpty(_TitleLabel)) _TitleLabel = "Title"; return _TitleLabel; } } private static string _VendorNameLabel; public static string VendorNameLabel { get {


_VendorNameLabel = ResourceManager.GetString("VendorNameLabel", resourceCulture); if (string.IsNullOrEmpty(_VendorNameLabel)) _VendorNameLabel = "Vendor Name"; return _VendorNameLabel; } } private static string _AddressLabel; public static string AddressLabel { get { _AddressLabel = ResourceManager.GetString("AddressLabel", resourceCulture); if (string.IsNullOrEmpty(_AddressLabel)) _AddressLabel = "Address"; return _AddressLabel; } } private static string _CityLabel; public static string CityLabel { get { _CityLabel = ResourceManager.GetString("CityLabel", resourceCulture); if (string.IsNullOrEmpty(_CityLabel)) _CityLabel = "City"; return _CityLabel; } } private static string _PostalCodeLabel; public static string PostalCodeLabel { get { _PostalCodeLabel = ResourceManager.GetString("PostalCodeLabel", resourceCulture); if (string.IsNullOrEmpty(_PostalCodeLabel)) _PostalCodeLabel = "Postal Code"; return _PostalCodeLabel; } } private static string _CountryLabel; public static string CountryLabel { get { _CountryLabel = ResourceManager.GetString("CountryLabel", resourceCulture); if (string.IsNullOrEmpty(_CountryLabel)) _CountryLabel = "Country"; return _CountryLabel; } } private static string _PhoneNumberLabel; public static string PhoneNumberLabel {


get { _PhoneNumberLabel = ResourceManager.GetString("PhoneNumberLabel", resourceCulture); if (string.IsNullOrEmpty(_PhoneNumberLabel)) _PhoneNumberLabel = "Phone Number"; return _PhoneNumberLabel; } } private static string _MobileNumberLabel; public static string MobileNumberLabel { get { _MobileNumberLabel = ResourceManager.GetString("MobileNumberLabel", resourceCulture); if (string.IsNullOrEmpty(_MobileNumberLabel)) _MobileNumberLabel = "Mobile Number"; return _MobileNumberLabel; } } private static string _FaxNumberLabel; public static string FaxNumberLabel { get { _FaxNumberLabel = ResourceManager.GetString("FaxNumberLabel", resourceCulture); if (string.IsNullOrEmpty(_FaxNumberLabel)) _FaxNumberLabel = "Fax Number"; return _FaxNumberLabel; } } private static string _FirstNameLabel; public static string FirstNameLabel { get { _FirstNameLabel = ResourceManager.GetString("FirstNameLabel", resourceCulture); if (string.IsNullOrEmpty(_FirstNameLabel)) _FirstNameLabel = "First Name"; return _FirstNameLabel; } } private static string _LastNameLabel; public static string LastNameLabel { get { _LastNameLabel = ResourceManager.GetString("LastNameLabel", resourceCulture); if (string.IsNullOrEmpty(_LastNameLabel)) _LastNameLabel = "Last Name"; return _LastNameLabel; } } private static string _PersonalInformation;


public static string PersonalInformationLabel { get { _PersonalInformation = ResourceManager.GetString("PersonalInformation", resourceCulture); if (string.IsNullOrEmpty(_PersonalInformation)) _PersonalInformation = "Personal Information"; return _PersonalInformation; } } private static string _ContactInformation; public static string ContactInformationLabel { get { _ContactInformation = ResourceManager.GetString("ContactInformation", resourceCulture); if (string.IsNullOrEmpty(_ContactInformation)) _ContactInformation = "Contact Information"; return _ContactInformation; } } private static string _StaffIdLabel; public static string StaffIdLabel { get { _StaffIdLabel = ResourceManager.GetString("StaffIdLabel", resourceCulture); if (string.IsNullOrEmpty(_ContactInformation)) _StaffIdLabel = "Staff Id"; return _StaffIdLabel; } } private static string _ExtensionLabel; public static string ExtensionLabel { get { _ExtensionLabel = ResourceManager.GetString("ExtensionLabel", resourceCulture); if (string.IsNullOrEmpty(_ExtensionLabel)) _ExtensionLabel = "Extension"; return _ExtensionLabel; } } private static string _SpecalizationLabel; public static string SpecalizationLabel { get { _SpecalizationLabel = ResourceManager.GetString("SpecalizationLabel", resourceCulture); if (string.IsNullOrEmpty(_SpecalizationLabel)) _SpecalizationLabel = "Specalization"; return _SpecalizationLabel; }


} private static string _DepartmentLabel; public static string DepartmentLabel { get { _DepartmentLabel = ResourceManager.GetString("DepartmentLabel", resourceCulture); if (string.IsNullOrEmpty(_DepartmentLabel)) _DepartmentLabel = "Department"; return _DepartmentLabel; } } private static string _ClassNoLabel; public static string ClassNoLabel { get { _ClassNoLabel = ResourceManager.GetString("ClassNoLabel", resourceCulture); if (string.IsNullOrEmpty(_ClassNoLabel)) _ClassNoLabel = "Class No"; return _ClassNoLabel; } } private static string _ClassInformationLabel; public static string ClassInformationLabel { get { _ClassInformationLabel = ResourceManager.GetString("ClassInformationLabel", resourceCulture); if (string.IsNullOrEmpty(_ClassInformationLabel)) _ClassInformationLabel = "Class Information"; return _ClassInformationLabel; } } private static string _DepartmentInformationLabel; public static string DepartmentInformationLabel { get { _DepartmentInformationLabel = ResourceManager.GetString("DepartmentInformationLabel", resourceCulture); if (string.IsNullOrEmpty(_DepartmentInformationLabel)) _DepartmentInformationLabel = "Department Information"; return _DepartmentInformationLabel; } } private static string _StatusInformationLabel; public static string StatusInformationLabel { get { _StatusInformationLabel = ResourceManager.GetString("StatusInformationLabel", resourceCulture); if (string.IsNullOrEmpty(_StatusInformationLabel))


_StatusInformationLabel = "Status Information"; return _StatusInformationLabel; } } private static string _StatusIdLabel; public static string StatusIdLabel { get { _StatusIdLabel = ResourceManager.GetString("StatusIdLabel", resourceCulture); if (string.IsNullOrEmpty(_StatusIdLabel)) _StatusIdLabel = "Status Id"; return _StatusIdLabel; } } private static string _TitleInformationLabel; public static string TitleInformationLabel { get { _TitleInformationLabel = ResourceManager.GetString("TitleInformationLabel", resourceCulture); if (string.IsNullOrEmpty(_TitleInformationLabel)) _TitleInformationLabel = "Title Information"; return _TitleInformationLabel; } } private static string _CategoryInformationLabel; public static string CategoryInformationLabel { get { _CategoryInformationLabel = ResourceManager.GetString("CategoryInformationLabel", resourceCulture); if (string.IsNullOrEmpty(_CategoryInformationLabel)) _CategoryInformationLabel = "Category Information"; return _CategoryInformationLabel; } } private static string _UserInformationLabel; public static string UserInformationLabel { get { _UserInformationLabel = ResourceManager.GetString("UserInformationLabel", resourceCulture); if (string.IsNullOrEmpty(_UserInformationLabel)) _UserInformationLabel = "User Information"; return _UserInformationLabel; } } private static string _PrevilagesLabel; public static string PrevilagesLabel { get {


_PrevilagesLabel = ResourceManager.GetString("PrevilagesLabel", resourceCulture); if (string.IsNullOrEmpty(_PrevilagesLabel)) _PrevilagesLabel = "Previlages"; return _PrevilagesLabel; } } private static string _UsernameLabel; public static string UsernameLabel { get { _UsernameLabel = ResourceManager.GetString("UsernameLabel", resourceCulture); if (string.IsNullOrEmpty(_UsernameLabel)) _UsernameLabel = "Username"; return _UsernameLabel; } } private static string _PasswordLabel; public static string PasswordLabel { get { _PasswordLabel = ResourceManager.GetString("PasswordLabel", resourceCulture); if (string.IsNullOrEmpty(_PasswordLabel)) _PasswordLabel = "Password"; return _PasswordLabel; } } private static string _RetypePasswordLabel; public static string RetypePasswordLabel { get { _RetypePasswordLabel = ResourceManager.GetString("RetypePasswordLabel", resourceCulture); if (string.IsNullOrEmpty(_RetypePasswordLabel)) _RetypePasswordLabel = "Retype Password"; return _RetypePasswordLabel; } } } }


Erasmus+ Projet 2017-1-FR01-KA219-037185_1 C' TECHNICAL SCHOOL OF LEMESOS, Limassol Cyprus Lycée des metiers Louis Blériot, Trappes, France Cooperativa de Ensino de V.N.Famalicão, CRL - E.P. Cior, V.N.Famalicão , Portugal


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.