public void checkStates(ref Dictionary <_IdData, object> datas , DateTime Ftime, DateTime Etime, _TypePack typePack, int TravelId) { bool ERR = false; // IEnumerable<decimal> IdPersons = (IEnumerable<decimal>)datas[_IdData.Package_CollectionGps]; if (!packTimeIsTrue(Ftime, Etime)) { ERR = true; // datas[_IdData.Event_Description] += "\n" + "تاریخ شروع یا پایان نادرست است"; Exceptor("تاریخ شروع یا پایان نادرست است"); } if (!TypeAndAgreeIsTrue(typePack, ref datas)) { ERR = true; // datas[_IdData.Event_Description] += "\n" + "تنظیمات نوع و قرارداد متناسب نیستند"; Exceptor("تنظیمات نوع و قرارداد متناسب نیستند"); } // foreach (decimal item in IdPersons) // { /* * * Person objP = GP.Persons.Single(x => x.Person_ID == item); * * if (!isPersonSetWithTypePack(objP.Person_isWoman, typePack)) * { * ERR = true; * datas[_IdData.Event_Description] += "\n" + "نوع بسته با شخص انتخابی به مشخصات زیر همخوانی ندارد "; * datas[_IdData.Event_Description] += "\n"+"کد ملی: "+ objP.Person_NationalCode; * datas[_IdData.Event_Description] += "\n"+"شماره شناسایی: " + objP.Person_IdentifyCode; * } * if (isPersonBlackLists(item)) * { * ERR = true; * datas[_IdData.Event_Description] += "\n" + "شخصی به مشخصات زیر در لیست سیاه قرار دارد"; * datas[_IdData.Event_Description] += "\n"+"کد ملی: "+ objP.Person_NationalCode; * datas[_IdData.Event_Description] += "\n"+"شماره شناسایی: " + objP.Person_IdentifyCode; * } * if (packAndGates(Ftime, Etime, TravelId, item)) * { * ERR = true; * datas[_IdData.Event_Description] += "\n" + "تنظیمات مجوز تردد ها یا بسته اشتباه می باشد"; * } */ // } if (ERR) { Exceptor((string)datas[_IdData.Event_Description]); } }
public bool isPersonSetWithTypePack(bool isWoman, _TypePack typePack) { switch (typePack) { case _TypePack.WorkerMan: if (isWoman) { return(false); } break; case _TypePack.WorkerWoman: if (!isWoman) { return(false); } break; } return(true); //@ }
public bool TypeAndAgreeIsTrue(_TypePack tp, ref Dictionary <_IdData, object> datas) { if (datas.ContainsKey(_IdData.Agreement_ID)) { switch (tp) { case _TypePack.WorkerMan: return(true); case _TypePack.WorkerWoman: return(true); } } else { switch (tp) { case _TypePack.TeachTrainee: return(true); case _TypePack.TeachUni: return(true); case _TypePack.TeachAct: return(true); case _TypePack.Guest: return(true); case _TypePack.TempWork: return(true); case _TypePack.Company: return(true); } } return(false); //@ }