public void MasterTransfer(int mode, DateTime date) { if (Card == null) { return; } UStatus.UpdateValue(2); CollectedBits = UStatus.Value; SaveUserStatus(); //CardObject CO = (CardObject)card; int m = Int32.Parse(mode.ToString()); if (mode == 0) // Give to Employer { Employer.AddCardTransfer(Card, date); Card.EmployerName = Employer.FullName; CardMaster.ReturnCard(Card, date); SaveEmployers(); SaveCardManager(); } else if (mode == 1) // back from Employer { CardMaster.AddCard(Card, date); Card.EmployerName = "Master"; Employer.ReturnCard(Card, date); SaveEmployers(); SaveCardManager(); } //Card = null; }
public void TransferCardFrom(string cardNumber, string EmployerFrom, DateTime date) { foreach (EmployerObject EO in Employers) { foreach (CardObject CO in EO.HandledCards) { if (CO.Number == cardNumber) { Card = CO; break; } } } foreach (EmployerObject EOFrom in Employers) { if (EOFrom.FullName == EmployerFrom) { if (!Card.IsCardReturned()) { EOFrom.ReturnCard(Card, date); } Employer.AddCardTransfer(Card, date); Card.EmployerName = Employer.FullName; SaveEmployers(); break; } } Card = null; }
public void MasterTransfer(int mode, DateTime date) { //CardObject CO = (CardObject)card; int m = Int32.Parse(mode.ToString()); if (m == 0) // Give to Employer { CardMaster.RemodeCard(Card); Employer.ReturnCard(Card, date); Employer.AddCardTransfer(Card, date); Card.EmployerName = Employer.FullName; SaveEmployers(); } else if (m == 1) // back from Employer { //SaveEmployers(); } //Card = null; }