/// <summary> /// Добовление нового наряда /// </summary> /// <param name="data"></param> /// <returns></returns> public bool AddAttire(Attire data) { bool result = false; ListAttire.Add(data); if (isAvaibleHash(data.ID)) { result = true; } return(result); }
/// <summary> /// Поиск наряда по ID /// </summary> /// <param name="ID">ID Hash</param> /// <returns></returns> public Attire FindAttire(string ID) { Attire result = null; foreach (var item in ListAttire) { if (item.ID == ID) { result = item; } } return(result); }
/// <summary> /// Проверка наличия наряда в базе по ID /// </summary> /// <param name="ID">ID Hash</param> /// <returns></returns> public bool isAvaibleHash(string ID) { bool result = false; Attire temp = FindAttire(ID); if (temp != null) { if (temp.ID == ID) { result = true; } } return(result); }
/// <summary> /// Удаление наряда по ID /// </summary> /// <param name="id">Уникальный номер</param> /// <returns></returns> public bool DeleteNotVerifyedAttire(string id) { bool result = false; Attire temp = FindAttire(id); if (temp != null) { if (ListAttire.Remove(temp)) { result = true; } else { result = false; } } return(result); }
/// <summary> /// Продление наряда /// </summary> /// <param name="ID">ID наряда</param> /// <param name="DateOut">Продлить от даты</param> /// <param name="Days">Кол-во дней</param> /// <returns></returns> public bool ExtendAttire(string ID, DateTime DateOut, int Days) { bool result = false; Attire temp = FindAttire(ID); if (temp != null) { temp.isExtend = true; if (Days > 15) { Days = 15; } temp.Date_Time_End_Extend = DateOut.AddDays(Days); result = true; } else { result = false; } return(result); }
public Attire(Attire data) { this.ID = data.ID; this.ResponseManager = data.ResponseManager; this.ForePerson = data.ForePerson; this.Team.Clear(); foreach (var item in data.Team) { this.Team.Add(item); } this.Estr = data.Estr; this.Date_Time_Begin = data.Date_Time_Begin; this.Date_Time_End = data.Date_Time_End; this.isExtend = data.isExtend; this.Date_Time_End_Extend = data.Date_Time_End_Extend; this.Sec_Meas = data.Sec_Meas; this.Spec_Insrtrucion = data.Spec_Insrtrucion; this.Date_Time_Give = data.Date_Time_Give; this.GiveAttire = data.GiveAttire; this.Count = data.Count; this.isClosed = data.isClosed; }