Example #1
0
        public static HumanResourceQualificationForm GetFormById(int operationalLicensesFormId)
        {
            HumanResourceQualificationForm entity = null;

            using (SmizeeContext Context = new SmizeeContext())
            {
                entity = Context.HumanResourceQualificationForms.FirstOrDefault(f => f.HumanResourceQualificationFormID == operationalLicensesFormId);
                // force context to get Form
                string code             = entity.Form.Periodicity.Code;
                int    functionalAreaID = entity.Form.FormType.FunctionalAreaID;
            }
            return(entity);
        }
Example #2
0
        public static bool CheckFormsByFormDate(int formId, int productionUnitId, DateTime formDate)
        {
            bool result = false;

            HumanResourceQualificationForm entity = null;

            using (SmizeeContext Context = new SmizeeContext())
            {
                entity = Context.HumanResourceQualificationForms.FirstOrDefault(fef => (fef.FormID == formId) & (fef.ProductionUnitID == productionUnitId) & (fef.FormDate == formDate));
                if (entity != null)
                {
                    result = true;
                }
            }
            return(result);
        }
Example #3
0
        public static int CreateForm(int formId, int productionUnitId, int periodNumber, DateTime formDate)
        {
            int HumanResourceQualificationFormId  = 0;
            HumanResourceQualificationForm entity = new HumanResourceQualificationForm();

            using (var db = new Models.SmizeeContext())
            {
                entity.FormID           = formId;
                entity.StateID          = 1;
                entity.ProductionUnitID = productionUnitId;
                entity.PeriodNumber     = periodNumber;
                entity.FormDate         = formDate;

                db.HumanResourceQualificationForms.Add(entity);
                db.SaveChanges();
                HumanResourceQualificationFormId = entity.HumanResourceQualificationFormID;
            }
            return(HumanResourceQualificationFormId);
        }