Exemplo n.º 1
0
Arquivo: User.cs Projeto: jiqsaw/pikcv
        public void UpdateLastLoginDate(int UserID)
        {
            DateTime LastLoginDate = DateTime.Now;

            PIKCV.DAL.User objUser = new PIKCV.DAL.User();
            objUser.LoadByPrimaryKey(UserID);
            objUser.LastLoginDate = LastLoginDate;
            objUser.Save();
        }
Exemplo n.º 2
0
Arquivo: User.cs Projeto: jiqsaw/pikcv
 public bool UpdateCVStatus(int UserID, bool IsCVActive)
 {
     PIKCV.DAL.User objUser = new PIKCV.DAL.User();
     objUser.LoadByPrimaryKey(UserID);
     if (objUser.IsCVConfirmed)
     {
         objUser.IsCVActive = IsCVActive;
         objUser.Save();
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
Arquivo: User.cs Projeto: jiqsaw/pikcv
        // Üyelik Bilgileri Yeni Kayýt | Güncelle
        public int SaveUserInfo(int UserID, string FirstName, string LastName, string Email, string IdentityNo,
                                string Password, string SecretQuestion, string SecretAnswer, bool IsWantedSMS)
        {
            try
            {
                PIKCV.DAL.User objUser = new PIKCV.DAL.User();

                if (UserID > 0)
                {
                    objUser.LoadByPrimaryKey(UserID);
                }
                else
                {
                    objUser.AddNew(); objUser.CreateDate = DateTime.Now;
                }

                objUser.Email      = Email;
                objUser.FirstName  = Util.ReplaceStrForDB(FirstName);
                objUser.IdentityNo = Util.ClearString(IdentityNo.Trim());

                if (UserID < 1)
                {
                    objUser.CreateDate       = DateTime.Now;
                    objUser.ActivationNumber = " ";
                    objUser.EmployeeTypeCode = (int)PIKCV.COM.EnumDB.EmployeeTypes.Unknown;
                    objUser.IsActive         = true;
                    objUser.IsCVActive       = false;
                    objUser.IsCVConfirmed    = false;
                    objUser.IsDeleted        = false;
                    objUser.IsEmailConfirmed = false;
                    //**objUser.IsEmailConfirmed = true;
                    objUser.LastLoginDate = DateTime.Now.AddYears(50);
                }
                if (Password != String.Empty)
                {
                    objUser.Password = Encryption.Encrypt(Password);
                }
                objUser.LastName       = Util.ReplaceStrForDB(LastName);
                objUser.ModifyDate     = DateTime.Now;
                objUser.SecretQuestion = Util.ReplaceStrForDB(SecretQuestion);
                objUser.SecretAnswer   = Util.ReplaceStrForDB(SecretAnswer);
                objUser.IsWantedSMS    = IsWantedSMS;
                objUser.Save();
                return(objUser.UserID);
            }
            catch (Exception)
            {
                return(0);
            }
        }
Exemplo n.º 4
0
Arquivo: User.cs Projeto: jiqsaw/pikcv
 public static bool RemoveUser(int UserID)
 {
     try
     {
         PIKCV.DAL.User objUser = new PIKCV.DAL.User();
         objUser.LoadByPrimaryKey(UserID);
         objUser.IsDeleted = true;
         objUser.Save();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 5
0
Arquivo: User.cs Projeto: jiqsaw/pikcv
 public bool ActivateUser(int UserID, string ActivationNumber)
 {
     PIKCV.DAL.User objUser = new PIKCV.DAL.User();
     objUser.Where.UserID.Value           = UserID;
     objUser.Where.ActivationNumber.Value = ActivationNumber;
     objUser.Query.Load();
     if (objUser.RowCount > 0)
     {
         objUser.LoadByPrimaryKey(UserID);
         objUser.IsEmailConfirmed = true;
         objUser.Save();
         return(true);
     }
     return(false);
 }
Exemplo n.º 6
0
Arquivo: User.cs Projeto: jiqsaw/pikcv
        public bool SaveActivation(int UserID, string ActivationNumber)
        {
            try
            {
                PIKCV.DAL.User objUser = new PIKCV.DAL.User();
                objUser.LoadByPrimaryKey(UserID);
                objUser.ActivationNumber = ActivationNumber;
                objUser.Save();
                return(true);
            }
            catch (Exception)
            {
                throw;
            }

            return(false);
        }
Exemplo n.º 7
0
        public bool SaveEmploymentChooices(int UserID, ArrayList arrSelectedSectors, ArrayList arrSelectedPositions, PIKCV.COM.EnumDB.EmployeeTypes EmployeeType)
        {
            PIKCV.DAO.TransactionMgr Tran = PIKCV.DAO.TransactionMgr.ThreadTransactionMgr();

            try
            {
                PIKCV.DAL.UserSectors   objSectors   = new PIKCV.DAL.UserSectors();
                PIKCV.DAL.UserPositions objPositions = new PIKCV.DAL.UserPositions();
                PIKCV.DAL.UserCVs       ObjCV        = new PIKCV.DAL.UserCVs();
                PIKCV.DAL.User          ObjUser      = new PIKCV.DAL.User();

                objSectors.Where.UserID.Value   = UserID;
                objPositions.Where.UserID.Value = UserID;
                objSectors.Query.Load();
                objPositions.Query.Load();

                Tran.BeginTransaction();

                objSectors.DeleteAll();
                objSectors.Save();

                objPositions.DeleteAll();
                objPositions.Save();

                for (int i = 0; i < arrSelectedPositions.Count; i++)
                {
                    objPositions.AddNew();
                    objPositions.UserID     = UserID;
                    objPositions.PositionID = Convert.ToInt32(arrSelectedPositions[i]);
                    objPositions.Save();
                }

                for (int i = 0; i < arrSelectedSectors.Count; i++)
                {
                    objSectors.AddNew();
                    objSectors.UserID   = UserID;
                    objSectors.SectorID = Convert.ToInt32(arrSelectedSectors[i]);
                    objSectors.Save();
                }

                ObjCV.Where.UserID.Value = UserID;
                ObjCV.Query.Load();

                ObjCV.ModifyDate = DateTime.Now;
                if (ObjCV.CvFocusCode < (int)PIKCV.COM.EnumDB.CVFocusCode.PlacementPreferences)
                {
                    ObjCV.CvFocusCode = (int)PIKCV.COM.EnumDB.CVFocusCode.PlacementPreferences;
                }
                ObjCV.Save();

                ObjUser.LoadByPrimaryKey(UserID);
                ObjUser.EmployeeTypeCode = (int)EmployeeType;
                ObjUser.Save();

                Tran.CommitTransaction();

                return(true);
            }
            catch (Exception)
            {
                Tran.RollbackTransaction();
                PIKCV.DAO.TransactionMgr.ThreadTransactionMgrReset();
                return(false);
            }
        }