public bool Save(bool isServerCall = false) { try { CompanyDetail d = toList.Where(x => x.Id == Id).FirstOrDefault(); int i = 0; if (d == null) { d = new CompanyDetail(); toList.Add(d); } this.toCopy <CompanyDetail>(d); if (isServerCall == false) { i = FMCGHubClient.FMCGHub.Invoke <int>("CompanyDetail_Save", this).Result; d.Id = i; } return(i != 0); } catch (Exception ex) { return(false); } }
public static bool Login(string AccYear, String CompanyName, String LoginId, String Password) { var ua = FMCGHubClient.FMCGHub.Invoke <UserAccount>("UserAccount_Login", AccYear, CompanyName, LoginId, Password).Result; if (ua.Id != 0) { User = ua; Company = CompanyDetail.toList.Where(x => x.Id == ua.CompanyId).FirstOrDefault(); Type = UserType.toList.Where(x => x.Id == ua.UserTypeId).FirstOrDefault(); TypeDetails = UserTypeDetail.ToList.Where(x => x.UserTypeId == ua.UserTypeId).ToList(); } return(ua.Id != 0); }