Beispiel #1
0
        public EmpCheckMonth(USERINFO emp, AttControlClass attControl, GetDeptNameDelgate GetDeptName)
        {
            Emp        = emp;
            DeptName   = GetDeptName((short)emp.DEFAULTDEPTID);
            AttControl = attControl;
            GetDayType = AttControl.GetDayType;
            EmpNote    = AttControl.GetEmpNoteInfoByByte(emp.Notes);

            if (EmpNote == null)
            {
                EmpNote            = new EmpNoteInfo();
                EmpNote.EmpPyName  = PinyinHelper.PinyinString(emp.Name);
                EmpNote.IsHaveNote = true;
                AttControl.UpDateEmpNoteInfo(emp.USERID, EmpNote);
            }
        }
Beispiel #2
0
        public void UpDateEmpNoteInfo(int userid, EmpNoteInfo eni)
        {
            eni.ConName = Con.ConName;

            var u = Con.USERINFO.SingleOrDefault(p => p.USERID == userid);

            if (u != null)
            {
                var noteList = ByteToListEmpNote(u.Notes);
                var e        = noteList.SingleOrDefault(p => p.ConName == eni.ConName);
                if (e != null)
                {
                    noteList.Remove(e);
                }
                noteList.Add(eni);
                u.Notes = ListEmpNodeToByte(noteList);
                Con.SaveChanges();
            }
        }