public void UpdateSetting(Client c, string cid, string password) { if (c.Mail == "") { throw new Exception("The Email Filed Is Empty"); } if (c.Fname == "") { throw new Exception("The First Name Filed Is Empty"); } if (c.Lname == "") { throw new Exception("The Last Name Filed Is Empty"); } if (c.Address == "") { throw new Exception("The Billing Address Filed Is Empty"); } if (c.Suite == "") { throw new Exception("The Suite Field Is Empty"); } if (c.City == "") { throw new Exception("The Unit City Filed Is Empty"); } if (c.Zip == "") { throw new Exception("The Zip Code Filed Is Empty"); } if (c.MobileNum == "") { throw new Exception("The Mobile Phone Filed Is Empty"); } UserC u = new UserC(); User user = u.FindUser(c.Id); if (password != "") { user.Password = password; } user.Mail = c.Mail; user.MobileNum = c.MobileNum; user.Fname = c.Fname; user.Lname = c.Lname; u.UpdateUser(user); c.Id = cid; ClientGlobal global = new ClientGlobal(); c.SalesRep = global.FindClient(c.Id).SalesRep; global.UpdateClient(c); throw new Exception("The Update Was Successful"); }
public User userInformation(string uid) { UserC c = new UserC(); return(c.FindUser(uid)); }