/// <summary> /// a func to update guest request /// </summary> /// <param name="gsKey"></param> /// <param name="stat"></param> public void updateCustomerReq(long gsKey, statusGusReq stat) { if (!(dal.getGuestRequestList().Any(gs1 => (gs1.GuestRequestKey == gsKey)))) { throw new System.ArgumentException("request dont exist!"); } if (stat != statusGusReq.נסגר_כי_פג_תוקף && stat != statusGusReq.נסגר_על_ידי_האתר && stat != statusGusReq.פתוח) { throw new System.ArgumentException("dont have a status"); } dal.updateCustomerReq(gsKey, stat); }
/// <summary> /// a func that updates a status of a guest request /// </summary> /// <param name="gsKey"></param> /// <param name="stat"></param> public void updateCustomerReq(long gsKey, statusGusReq stat) { if (!CheckGuestReq(gsKey)) { throw new System.ArgumentException("request dont exist!"); } var new_gs = (from item in DS1.DataSource.GuestRequestList where gsKey == item.GuestRequestKey select item).FirstOrDefault(); if (stat != statusGusReq.נסגר_כי_פג_תוקף && stat != statusGusReq.נסגר_על_ידי_האתר && stat != statusGusReq.פתוח) { throw new System.ArgumentException("dont have a status"); } new_gs.Status = stat; }