//Registration
 public bool CabRegistrationSubmit(tbCabRegistration cabreg)
 {
     try
     {
         _dataContext.tbCabRegistrations.InsertOnSubmit(cabreg);
         _dataContext.SubmitChanges();
     }
     catch (Exception e)
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 2
0
 public bool DreamFormSubmit(tbDream dreamTable)
 {
     var _dataContext = new CSCPortalDataContext();
     try
     {
         _dataContext.tbDreams.InsertOnSubmit(dreamTable);
         _dataContext.SubmitChanges();
     }
     catch (Exception e)
     {
         return false;
     }
     return true;
 }
Ejemplo n.º 3
0
        public bool DreamFormSubmit(tbDream dreamTable)
        {
            var _dataContext = new CSCPortalDataContext();

            try
            {
                _dataContext.tbDreams.InsertOnSubmit(dreamTable);
                _dataContext.SubmitChanges();
            }
            catch (Exception e)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 4
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;
 }
Ejemplo n.º 5
0
 public bool SetCSCInitiative(tbCSCInitiative cscini)
 {
     try
     {
         _dataContext.tbCSCInitiatives.InsertOnSubmit(cscini);
         _dataContext.SubmitChanges();
     }
     catch (Exception e)
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
        }
Ejemplo n.º 8
0
        public MembershipCreateStatus CreateUser(string userName, string password, string email, String empname)
        {
            if (String.IsNullOrEmpty(userName))
            {
                throw new ArgumentException("Value cannot be null or empty.", "userName");
            }
            if (String.IsNullOrEmpty(password))
            {
                throw new ArgumentException("Value cannot be null or empty.", "password");
            }
            if (String.IsNullOrEmpty(email))
            {
                throw new ArgumentException("Value cannot be null or empty.", "email");
            }

            MembershipCreateStatus status = new MembershipCreateStatus();

            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    _provider.CreateUser(userName, password, email, null, null, true, null, out status);
                    var emp = new tbEmp();
                    emp.EmpID   = userName;
                    emp.Email   = email;
                    emp.EmpName = empname;
                    _dataContext.tbEmps.InsertOnSubmit(emp);
                    _dataContext.SubmitChanges();
                    scope.Complete();
                }
            }
            catch (Exception e)
            {
            }
            finally
            {
            }
            return(status);
        }
Ejemplo n.º 9
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;
        }