public static List <BsRegTimeSpan> GetTimeSpanIDs(DateTime time) { var lstbsRegTimeSpan = new List <BsRegTimeSpan>(); var bsRegTimeSpan = UtilsLocCache.GetCacheAll <BsRegTimeSpan>().FindAll(t => t.IsActive);//Orm.Config.Service.DBClientService.GetAllList<BsRegTimeSpan>(); //CacheHelper.GetCacheList<BsRegTimeSpan>(); string timeStr = time.ToShortTimeString(); if (bsRegTimeSpan.Count > 0) { lstbsRegTimeSpan = bsRegTimeSpan.FindAll(t => DateTime.Compare(Convert.ToDateTime(timeStr), Convert.ToDateTime(t.TimeBegin)) >= 0 && DateTime.Compare(Convert.ToDateTime(timeStr), Convert.ToDateTime(t.TimeEnd)) <= 0); } return(lstbsRegTimeSpan); }
////���� ///// <summary> ///// ��ȡҽ��������� ///// </summary> ///// <param name="itemId"></param> ///// <param name="tallyGroupId"></param> ///// <param name="memo"></param> ///// <returns></returns> //public static string GetYbDesc(int itemId, int tallyGroupId, string memo) //{ // List<Model.BsItemYb> lst; // if (Convert.ToBoolean(GetSystemSetting("IsAllShowItemYbMemo"))) // lst = Orm.Config.Service.DBClientService.GetList<Model.BsItemYb>("ItemId = @0", itemId); // else // lst = Orm.Config.Service.DBClientService.GetList<Model.BsItemYb>("ItemId = @0 && TallyGroupId = @1",itemId, tallyGroupId); // if (lst.Count > 0) // { // if (lst[0].LsYbType == 2) // { // } // if (lst[0].LsYbType >= 3) return memo; // memo += string.Format("��{0}", lst[0].LsYbType == 1 ? "����" : "����"); // if (lst[0].YBType != null) // if (lst[0].YBType != null) // memo += string.Format("��{0}", lst[0].YBType); // if (memo.StartsWith("��")) // memo = memo.Substring(1); // } // return memo; //} //���� //public static bool CheckBeginCharge(string MzRegId) //{ // List<Model.RmSending> lstRmSending = Service.DBClientService.GetList<Model.RmSending>("MzRegId=@0", MzRegId); // if (lstRmSending.Count > 0) // { // MessageBox.Show("��Ҫ�߳��IJ��˿��ܴ����շ�״̬,���Ժ����ԣ�", "ϵͳ��ʾ", MessageBoxButton.OK, MessageBoxImage.Information); // return true; // } // return false; //} ////���� ///// <summary> ///// �ж���ҽ�����ǹ��� IsGf���ѣ�IsYb ҽ�� ///// </summary> ///// <param name="PatTypeId">BsPatType���е�ID</param> ///// <returns></returns> //public static Model.BsTallyGroup IsYb(int PatTypeId) //{ // var lstBsPatType = UtilsLocCache.GetCacheEntity<Model.BsPatType>(t => t.GUID == PatTypeId); // var lstBsTallyType = UtilsLocCache.GetCacheEntity<Model.BsTallyType>(t => t.GUID == lstBsPatType.TallyTypeId); // var lstBsTallyGroup = UtilsLocCache.GetCacheEntity<Model.BsTallyGroup>(t => t.GUID == lstBsTallyType.TallyGroupId); // return lstBsTallyGroup; //} /// <summary> /// ����ʱ���ȡ���ID /// </summary> /// <param name="time">��ǰ����ʱ��</param> /// <returns></returns> public static string GetTimeSpanID(DateTime time) { string result = string.Empty; //�����α����� var bsRegTimeSpan = UtilsLocCache.GetCacheAll <BsRegTimeSpan>().Where(t => t.IsActive = true).ToList(); string timeStr = time.ToShortTimeString(); if (bsRegTimeSpan.Count > 0) { var lstbsRegTimeSpan = bsRegTimeSpan.FindAll(t => DateTime.Compare(Convert.ToDateTime(timeStr), Convert.ToDateTime(t.TimeBegin)) >= 0 && DateTime.Compare(Convert.ToDateTime(timeStr), Convert.ToDateTime(t.TimeEnd)) <= 0); if (lstbsRegTimeSpan.Count > 0) { result = lstbsRegTimeSpan.FirstOrDefault().GUID; } else { result = string.Empty; } } return(result); }