示例#1
0
        public List <CSCInitiativeTeamGridDisplayModel> getCSCInitiativeTeamGridDisplayResult()
        {
            var _dataContext = new CSCPortalDataContext();
            var cscini       = (from data in _dataContext.tbCSCInitiativeTeams
                                orderby data.CreatedDate descending
                                select data);
            var dataToReturnItems = (from item in cscini
                                     select new CSCInitiativeTeamGridDisplayModel
            {
                CSCInitiativeID = item.CSCInitiativeID.GetValueOrDefault(),
                TeamName = item.TeamName.ToString() ?? string.Empty,

                EmpID = item.EmpID.ToString() ?? string.Empty,
                Location = item.Location.ToString() ?? string.Empty,
                HomePage = item.HomePage.ToString() ?? string.Empty,
                DLID = item.DLID.ToString() ?? string.Empty,
                CreatedDate = item.CreatedDate.GetValueOrDefault(),
                TeamID = item.TeamID.ToString() ?? string.Empty,
                CSCInitiativeName = (from data in _dataContext.tbCSCInitiatives
                                     where data.CSCInitiativeID == item.CSCInitiativeID
                                     select data.CSCInitiativeName).FirstOrDefault() ?? string.Empty
            });


            return(dataToReturnItems.ToList());
        }
        public List<CSCInitiativeTeamGridDisplayModel> getCSCInitiativeTeamGridDisplayResult()
        {
            var _dataContext = new CSCPortalDataContext();
            var cscini = (from data in _dataContext.tbCSCInitiativeTeams
                          orderby data.CreatedDate descending
                          select data);
            var dataToReturnItems = (from item in cscini
                                     select new CSCInitiativeTeamGridDisplayModel
                                     {
                                          CSCInitiativeID=item.CSCInitiativeID.GetValueOrDefault(),
                                          TeamName=item.TeamName.ToString()??string.Empty,

                                          EmpID = item.EmpID.ToString() ?? string.Empty,
                                          Location = item.Location.ToString() ?? string.Empty,
                                          HomePage = item.HomePage.ToString() ?? string.Empty,
                                          DLID = item.DLID.ToString() ?? string.Empty,
                                         CreatedDate = item.CreatedDate.GetValueOrDefault(),
                                          TeamID = item.TeamID.ToString() ?? string.Empty,
                                          CSCInitiativeName=(from data in _dataContext.tbCSCInitiatives
                                                             where data.CSCInitiativeID==item.CSCInitiativeID
                                                             select data.CSCInitiativeName).FirstOrDefault()??string.Empty

                                     });

            return dataToReturnItems.ToList();
        }
示例#3
0
        public tbEmp getProfileAttributes(String empid)
        {
            CSCPortalDataContext _dataContext = new CSCPortalDataContext();
            var empdata = (from emp in _dataContext.tbEmps
                           select emp
                           ).Where(x => x.EmpID.Equals(empid)).FirstOrDefault();

            return(empdata);
        }
示例#4
0
 public bool DreamFormSubmit(tbDream dreamTable)
 {
     var _dataContext = new CSCPortalDataContext();
     try
     {
         _dataContext.tbDreams.InsertOnSubmit(dreamTable);
         _dataContext.SubmitChanges();
     }
     catch (Exception e)
     {
         return false;
     }
     return true;
 }
示例#5
0
        public bool DreamFormSubmit(tbDream dreamTable)
        {
            var _dataContext = new CSCPortalDataContext();

            try
            {
                _dataContext.tbDreams.InsertOnSubmit(dreamTable);
                _dataContext.SubmitChanges();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
示例#6
0
 public List<tbDream> DreamFormBind(String DreamId)
 {
     var _dataContext = new CSCPortalDataContext();
     try
     {
         var modelData = (from data in _dataContext.tbDreams
                          where data.DID == int.Parse(DreamId)
                          select data);
         return modelData.ToList();
     }
     catch (Exception e)
     {
         return null;
     }
 }
示例#7
0
        public List <tbDream> DreamFormBind(String DreamId)
        {
            var _dataContext = new CSCPortalDataContext();

            try
            {
                var modelData = (from data in _dataContext.tbDreams
                                 where data.DID == int.Parse(DreamId)
                                 select data);
                return(modelData.ToList());
            }
            catch (Exception e)
            {
                return(null);
            }
        }
示例#8
0
 public bool DreamFormUpdate(DreamGridDisplayModel dreamModel)
 {
     var _dataContext = new CSCPortalDataContext();
     try
     {
         var dreamModelData = (from data in _dataContext.tbDreams
                               where data.DID == dreamModel.DreamId
                               select data).FirstOrDefault();
         dreamModelData.CONTACTPERSON = dreamModel.ContactPerson;
         dreamModelData.STATUSID = int.Parse(dreamModel.Status);
         _dataContext.SubmitChanges();
     }
     catch (Exception e)
     {
         return false;
     }
     return true;
 }
示例#9
0
        public bool DreamFormUpdate(DreamGridDisplayModel dreamModel)
        {
            var _dataContext = new CSCPortalDataContext();

            try
            {
                var dreamModelData = (from data in _dataContext.tbDreams
                                      where data.DID == dreamModel.DreamId
                                      select data).FirstOrDefault();
                dreamModelData.CONTACTPERSON = dreamModel.ContactPerson;
                dreamModelData.STATUSID      = int.Parse(dreamModel.Status);
                _dataContext.SubmitChanges();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
示例#10
0
        public bool setProfileAttributes(tbEmp emp)
        {
            try
            {
                CSCPortalDataContext _dataContext = new CSCPortalDataContext();
                var empchanged = (from emp1 in _dataContext.tbEmps
                                  select emp1).Where(x => x.EmpID == emp.EmpID).FirstOrDefault();
                empchanged.EmpName  = emp.EmpName;
                empchanged.Location = emp.Location;
                empchanged.Phone    = emp.Phone;
                empchanged.Email    = emp.Email;

                _dataContext.SubmitChanges();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
示例#11
0
        public List <DreamGridDisplayModel> getDreamGridDisplayResult()
        {
            var _dataContext = new CSCPortalDataContext();
            var dreamResult  = (from dream in _dataContext.tbDreams
                                where dream.STATUSID != 6
                                select dream).OrderByDescending(x => x.SUBMITTEDDATE);
            var dataToReturn = (from dream1 in dreamResult
                                select new DreamGridDisplayModel
            {
                DreamId = dream1.DID,
                DreamTitle = dream1.DTITLE,
                DreamDescription = dream1.DDESCRIPTION,
                EmpId = dream1.EMPID,
                EmpName = dream1.EMPNAME,
                Location = dream1.LOCATION,
                SubmittedDate = dream1.SUBMITTEDDATE.Value.ToShortDateString(),
                Status = dream1.STATUSID.ToString(),
                ContactPerson = dream1.CONTACTPERSON.ToString()
            });

            return(dataToReturn.ToList());
        }
示例#12
0
        public List<DreamGridDisplayModel> getDreamGridDisplayResult()
        {
            var _dataContext = new CSCPortalDataContext();
            var dreamResult = (from dream in _dataContext.tbDreams
                               where dream.STATUSID!=6
                               select dream).OrderByDescending(x => x.SUBMITTEDDATE);
            var dataToReturn = (from dream1 in dreamResult
                                select new DreamGridDisplayModel
                                {
                                     DreamId=dream1.DID,
                                     DreamTitle=dream1.DTITLE,
                                     DreamDescription=dream1.DDESCRIPTION,
                                     EmpId = dream1.EMPID ,
                                     EmpName = dream1.EMPNAME ,
                                     Location = dream1.LOCATION ,
                                     SubmittedDate = dream1.SUBMITTEDDATE.Value.ToShortDateString() ,
                                     Status= dream1.STATUSID.ToString(),
                                     ContactPerson=dream1.CONTACTPERSON.ToString()

                                });
            return dataToReturn.ToList();
        }
示例#13
0
        public bool setProfileAttributes(tbEmp emp)
        {
            try
            {
                CSCPortalDataContext _dataContext = new CSCPortalDataContext();
                var empchanged=(from emp1 in _dataContext.tbEmps
                                select emp1).Where(x=> x.EmpID==emp.EmpID).FirstOrDefault();
                empchanged.EmpName=emp.EmpName;
                empchanged.Location=emp.Location;
                empchanged.Phone=emp.Phone;
                empchanged.Email = emp.Email;

                _dataContext.SubmitChanges();
            }
            catch (Exception e)
            {
                return false;
            }
            return true;
        }
示例#14
0
 public tbEmp getProfileAttributes(String empid)
 {
     CSCPortalDataContext _dataContext = new CSCPortalDataContext();
     var empdata=(from emp in _dataContext.tbEmps
                      select emp
                      ).Where(x=> x.EmpID.Equals(empid)).FirstOrDefault();
     return empdata;
 }