public int GetNumberOfUnreadNotifications(UserWrapper userWrapper) { NotificationTableAdapter adapter=new NotificationTableAdapter(); Debug.WriteLine(userWrapper.UserName); Object obj=adapter.Notification_GetUnreadNotificationCount(userWrapper.UserName); return (int) obj; }
void btnOK_Click(object sender, EventArgs e) { int ygCharge = 0; if (!int.TryParse(GetStringEditorValue(YouthChargeStd), out ygCharge)) { ygCharge = 3; } if (Request["Action"] == "Import" && !ValidateFormField()) { return; } //--如果是员工新增界面 if (String.IsNullOrEmpty(txtOID.Value)) { txtOID.Value = Guid.NewGuid().ToString(); mmAdapter.MyInsert(txtOID.Value, GetStringEditorValue(EmpName), GetStringEditorValue(HrCode), GetStringEditorValue(Sex), GetStringEditorValue(Dept), GetStringEditorValue(WorkGroup), GetStringEditorValue(Post), GetStringEditorValue(ParttimeName), GetStringEditorValue(Politics), GetDateTimeEditorValue(PartyDate), GetStringEditorValue(Wedding), GetStringEditorValue(Nation), GetStringEditorValue(NativePlace), GetStringEditorValue(Mobile), GetStringEditorValue(EmpID), GetStringEditorValue(House), GetDateTimeEditorValue(Birthday), GetDateTimeEditorValue(JobDateTime), GetDateTimeEditorValue(ComDateTime), GetStringEditorValue(FstSchoolExp), GetStringEditorValue(FstDegree), GetStringEditorValue(LstSchoolExp), GetStringEditorValue(LstDegree), GetStringEditorValue(SkillLevel), GetStringEditorValue(VolunteerInfo), GetStringEditorValue(SpecialSkill), GetStringEditorValue(ApplyParty), GetDateTimeEditorValue(ApplyPartyDate), GetStringEditorValue(FstSchool), GetStringEditorValue(FstProfession), GetDateTimeEditorValue(FstGraduateDate), GetStringEditorValue(LstSchool), GetStringEditorValue(LstProfession), GetDateTimeEditorValue(LstGraduateDate), GetStringEditorValue(HrType), GetStringEditorValue(HrStatus), ygCharge, GetStringEditorValue(FK_YouthGroup_FZ), GetStringEditorValue(Email), GetStringEditorValue(FK_YouthGroup)); if (Request["Action"] == "Import") { miAdapter.MyDelete(Request["MI_OID"]); } NotificationTableAdapter.ClearNfCache(); } else { mmAdapter.MyUpdate(GetStringEditorValue(EmpName), GetStringEditorValue(HrCode), GetStringEditorValue(Sex), GetStringEditorValue(Dept), GetStringEditorValue(WorkGroup), GetStringEditorValue(Post), GetStringEditorValue(ParttimeName), GetStringEditorValue(Politics), GetDateTimeEditorValue(PartyDate), GetStringEditorValue(Wedding), GetStringEditorValue(Nation), GetStringEditorValue(NativePlace), GetStringEditorValue(Mobile), GetStringEditorValue(EmpID), GetStringEditorValue(House), GetDateTimeEditorValue(Birthday), GetDateTimeEditorValue(JobDateTime), GetDateTimeEditorValue(ComDateTime), GetStringEditorValue(FstSchoolExp), GetStringEditorValue(FstDegree), GetStringEditorValue(LstSchoolExp), GetStringEditorValue(LstDegree), GetStringEditorValue(SkillLevel), GetStringEditorValue(VolunteerInfo), GetStringEditorValue(SpecialSkill), GetStringEditorValue(ApplyParty), GetDateTimeEditorValue(ApplyPartyDate), GetStringEditorValue(FstSchool), GetStringEditorValue(FstProfession), GetDateTimeEditorValue(FstGraduateDate), GetStringEditorValue(LstSchool), GetStringEditorValue(LstProfession), GetDateTimeEditorValue(LstGraduateDate), GetStringEditorValue(HrType), GetStringEditorValue(HrStatus), ygCharge, GetStringEditorValue(Email), GetStringEditorValue(FK_YouthGroup), GetStringEditorValue(FK_YouthGroup_FZ), txtOID.Value); NotificationTableAdapter.ClearNfCache(); } }
public IEnumerable<NotificationWrapper> GetNotificationsForUser(UserWrapper user) { NotificationTableAdapter adapter = new NotificationTableAdapter(); DBDataSet.NotificationDataTable res = adapter.GetData(user.UserID); return res.Select(not => new NotificationWrapper() { UserID = not.UserID, UnitCode = not.UnitCode, Comment = not.Comment, FirstName = not.FirstName, IsRead = not.IsRead, LastName = not.LastName, Rating = not.Rating, ResponseId = not.ResponseId, Time = not.Time }); }
public void MarkNotificationAsRead(UserWrapper userWrapper, int responseId) { NotificationTableAdapter adapter=new NotificationTableAdapter(); adapter.Notification_MarkNotificationAsRead(userWrapper.UserName, responseId); }