Beispiel #1
0
        private void ShowExp()
        {
            txtComName.Focus();

            barDel.Visibility     = DevExpress.XtraBars.BarItemVisibility.Never;
            btnOpenFactor.Visible = false;

            New                    = true;
            txtComName.Text        = null;
            memoRem.Text           = null;
            txtDept.Text           = null;
            txtComType.Text        = null;
            txtWorkType.Text       = null;
            StartWorkDate.DateTime = GetMasterDataClass.GetDateServer();
            StopWorkDate.DateTime  = GetMasterDataClass.GetDateServer();

            var db = new CDMSDBDataContext(Program.conStr);

            historyWorkBindingSource.DataSource = new HistoryWork();

            var Exp = (from x in db.HistoryWorks
                       where x.Emp_Key == EmpID &&
                       x.Htw_Status == 1 &&
                       x.Htw_Del == 0
                       select x).ToList();

            historyWorkBindingSource.DataSource = Exp;
        }
        public static int CalculateAge(DateTime birthDay)
        {
            DateTime DT = GetMasterDataClass.GetDateServer();

            int Years = DT.Year - birthDay.Year;

            if ((birthDay.Month > DT.Month) || (birthDay.Month == DT.Month && birthDay.Day > DT.Day))
            {
                Years--;
            }

            return(Years);
        }