Exemplo n.º 1
0
        public void AddEmployeeTaskMap(EmployeeTaskMap employeeTask)
        {
            CompanyDBDataContext dc = new CompanyDBDataContext();
            string dataValidate     = ValidationHelper.CheckCompulsoryEmployeeTaskColumn(employeeTask);

            if (dataValidate != QueryResource.AllFieldsPresent)
            {
                throw new Exception(dataValidate);
            }
            else
            {
                dc.EmployeeTaskMaps.InsertOnSubmit(employeeTask);
                dc.SubmitChanges();
            }
        }
 public static string CheckCompulsoryEmployeeTaskColumn(EmployeeTaskMap employeeTask)
 {
     if (employeeTask.EmployeeTaskMapID == 0)
     {
         return(QueryResource.EmpTaskIDMissing);
     }
     else if (employeeTask.TaskID == 0)
     {
         return(QueryResource.ProjectIdMissing);
     }
     else if (employeeTask.EmployeeID == 0)
     {
         return(QueryResource.EmployeeIdMissing);
     }
     else
     {
         return(QueryResource.AllFieldsPresent);
     }
 }