Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Settingslayout);
            var toolbardSettings = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbarSettings);

            SetSupportActionBar(toolbardSettings);
            MaterialMenuDrawable materialMenu = new MaterialMenuDrawable(this, Color.Purple, (int)stroke.EXTRA_THIN, MaterialMenuDrawable.DefaultScale, MaterialMenuDrawable.DefaultTransformDuration);

            materialMenu.SetIconState(MaterialMenuDrawable.IconState.Arrow);
            toolbardSettings.NavigationIcon   = materialMenu;
            toolbardSettings.NavigationClick += delegate {
                OnBackPressed();
                Finish();
            };



            editProfile    = FindViewById <TextView>(Resource.Id.settingseditProfile);
            addndDrop      = FindViewById <TextView>(Resource.Id.settingsaddndDrop);
            Credits        = FindViewById <TextView>(Resource.Id.settingsCredits);
            Changepassword = FindViewById <TextView>(Resource.Id.settingsChangePassword);

            editProfile.SetOnClickListener(this);
            addndDrop.SetOnClickListener(this);
            Credits.SetOnClickListener(this);
            Changepassword.SetOnClickListener(this);
            // Create your application here
        }
Ejemplo n.º 2
0
 public ActionResult ChangePasswordPartial(Changepassword ManageInfo)
 {
     if (ManageInfo.OldPassword != null)
     {
         if (ManageInfo.Password != null && ManageInfo.Password.Length >= 6)
         {
             if (ManageInfo.Password == ManageInfo.ConfirmPassword)
             {
                 string sessionname = Session["UserName"].ToString();
                 var    userid      = db.Users.SingleOrDefault(t => t.UserName == sessionname).UserNameID;
                 User   us          = db.Users.Find(userid);
                 string haspas      = GetMD5HashData(ManageInfo.OldPassword);
                 if (us.Password == haspas)
                 {
                     string newpassword = GetMD5HashData(ManageInfo.Password);
                     us.Password        = newpassword;
                     db.Entry(us).State = EntityState.Modified;
                     db.SaveChanges();
                     return(RedirectToAction("Complete", "Account"));
                 }
                 else
                 {
                     ModelState.AddModelError("", "Current password wrong! try again!");
                 }
             }
         }
     }
     return(View());
 }
        public async Task SaveChangepassword(Changepassword _changepassword)
        {
            int LoginId = 0;// To get User Id from session or user identity table.

            using (_UnitOfWork)
            {
                string Msg = null;

                if (_changepassword.LoginId == LoginId)
                {
                    _changepassword.CreatedBy   = LoginId;
                    _changepassword.CreatedDate = DateTime.Now;
                }
                else
                {
                    _changepassword.ModifiedBy   = LoginId;
                    _changepassword.ModifiedDate = DateTime.Now;
                }
                Msg = "Saved Successfully";

                var result = await _db.Changepasswords.AddAsync(_changepassword);

                _UnitOfWork.Commit();
            }
        }
Ejemplo n.º 4
0
        public void ChangePassword(LoginChangePasswordRequestAPI LoginChangePasswordRequestAPI)
        {
            var pdschangepassword = new pdschangepasswordDataSet();

            string cErrorMessage = string.Empty;

            DataRow ttblchangepasswordRow = pdschangepassword.ttblchangepassword.NewttblchangepasswordRow();

            Changepassword.UpdateRowFromChangepassword(ref ttblchangepasswordRow, LoginChangePasswordRequestAPI.changepassword);
            pdschangepassword.ttblchangepassword.AddttblchangepasswordRow((pdschangepasswordDataSet.ttblchangepasswordRow)ttblchangepasswordRow);

            var iCompanyNumber = LoginChangePasswordRequestAPI.iCompanyNumber;


            NLogLoggerP.Trace("ChangePassword - Login - Before Call");
            StopwatchUtil.Time(
                () =>
            {
                using (var poLoginproxy = this.proxyAppObject.CreatePO_loginproxy())
                {
                    this.SetRequiredContextParameters();
                    poLoginproxy.ChangePassword(ref pdsContext, iCompanyNumber, pdschangepassword, out cErrorMessage);
                }
            });
            NLogLoggerP.Info("ChangePassword - Login - After Call");


            this.ReportErrors(cErrorMessage);
            this.ReportErrors(this.pdsContext);
            this.ReportErrors(pdschangepassword);
        }
Ejemplo n.º 5
0
        public HttpResponseMessage PostChangePassword(Changepassword changePass)
        {
            LoginDAL userdal     = new LoginDAL();
            Response objResponse = new Response();

            try
            {
                var jsonResult = new StringBuilder();
                jsonResult       = userdal.ChangePassword(changePass);
                objResponse.Data = jsonResult.ToString();
                if (!string.IsNullOrEmpty(jsonResult.ToString()) && jsonResult.ToString() != "-1")
                {
                    objResponse.Success = true;
                }
                else
                {
                    objResponse.Success = false;
                }

                return(Request.CreateResponse(HttpStatusCode.OK, objResponse));
            }
            catch (Exception ex)
            {
                #region set exception response
                string logMsg = Environment.NewLine + DateTime.Now + Environment.NewLine + "Method Name: changePassword | Contoller Name: Login Controller" + Environment.NewLine;
                logMsg += ":" + DateTime.Now + "|" + ex.ToString() + "-" + Environment.NewLine;
                ErrorHandler.ErrorLog(logMsg);
                #endregion
                objResponse.ErrorList.Add(new Error {
                    errorCode = "EX", errorMsg = ex.Message
                });
                objResponse.Success = false;
                return(Request.CreateResponse(HttpStatusCode.BadRequest, objResponse));
            }
        }
Ejemplo n.º 6
0
        public async Task <IActionResult> Create([Bind("LoginId,oldPassword,newPassword,confirmPassword")] Changepassword changepassword)
        {
            if (ModelState.IsValid)
            {
                await _changepasswordRepository.SaveChangepassword(changepassword);

                return(RedirectToAction(nameof(Create)));
            }
            return(View(changepassword));
        }
Ejemplo n.º 7
0
 public StringBuilder ChangePassword(Changepassword changePass)
 {
     try
     {
         SqlParameter[] P = new SqlParameter[] {
             new SqlParameter("@UserInfoID", changePass.UserInfoID),
             new SqlParameter("@NewPassword", changePass.newpass),
             new SqlParameter("@OldPassword", String.IsNullOrEmpty(changePass.oldpass)? DBNull.Value : (object)changePass.oldpass),
             new SqlParameter("@Type", String.IsNullOrEmpty(changePass.type)? DBNull.Value : (object)changePass.type),
         };
         var jsonResult = new StringBuilder();
         jsonResult = DataLib.JsonStringExecuteReader(DataLib.Connection.GetConnectionString, SPKeys.changePassword, P);
         return(jsonResult);
     }
     catch { throw; }
 }
Ejemplo n.º 8
0
        public string ChangePassword(Changepassword changepassword, int iCompanyNumber)
        {
            var     pdschangepassword          = new pdschangepasswordDataSet();
            DataRow ttblchangepasswordCriteria = pdschangepassword.ttblchangepassword.NewttblchangepasswordRow();

            Changepassword.UpdateRowFromChangepassword(ref ttblchangepasswordCriteria, changepassword);
            pdschangepassword.ttblchangepassword.AddttblchangepasswordRow((pdschangepasswordDataSet.ttblchangepasswordRow)ttblchangepasswordCriteria);
            var cErrorMessage = string.Empty;

            StopwatchUtil.Time(
                () =>
            {
                this._poLoginproxy.ChangePassword(ref this._pdsContext, iCompanyNumber, pdschangepassword, out cErrorMessage);
            });
            _nLogLoggerP.Trace("ChangePassword");
            return(cErrorMessage);
        }
Ejemplo n.º 9
0
        public ActionResult Changepass(Changepassword changepassword)
        {
            NotesMarketPLaceEntities databaseContext = new NotesMarketPLaceEntities();
            var user = databaseContext.Users.Where(x => x.EmailID == User.Identity.Name).FirstOrDefault();

            if (user != null && user.Password == changepassword.Password)
            {
                databaseContext.Configuration.ValidateOnSaveEnabled = false;
                user.Password     = changepassword.NewPassword;
                user.ModifiedDate = DateTime.Now;
                ViewBag.Message   = "Your Password Change Sessuful.";
                databaseContext.SaveChanges();
                FormsAuthentication.SignOut();
                return(RedirectToAction("Index", "Login"));
            }
            else
            {
                ViewBag.Error = "Please Enter the Correct Old Password";
                return(View());
            }
        }
Ejemplo n.º 10
0
        public string ChangePassword(ChangePasswordRequestModel changePasswordRequestModel, string host)
        {
            var claimsAndLoginObject = new ClaimsAndLoginObject(new ProgressConfiguration());
            var nLogger = this.ReturnTenantAndUser(claimsAndLoginObject, changePasswordRequestModel, out _, out _, "ChangePassword", host);

            ReportErrors(nLogger, claimsAndLoginObject.LoggingEMessages, claimsAndLoginObject.LoggingIMessages, claimsAndLoginObject.LoggingWMessages);
            var changePassword = new Changepassword
            {
                oldpassword     = changePasswordRequestModel.OldPassword,
                newpassword     = changePasswordRequestModel.NewPassword,
                confirmpassword = changePasswordRequestModel.ConfirmPassword,
                usercompany     = changePasswordRequestModel.Cono,
                username        = changePasswordRequestModel.Oper
            };
            var returnValue = this._loginRepository.ChangePassword(changePassword, changePasswordRequestModel.Cono);

            if (!string.IsNullOrEmpty(returnValue))
            {
                nLogger.Warn(returnValue);
            }
            return(returnValue);
        }
Ejemplo n.º 11
0
 public string ChangePassword(Changepassword changePassword, int companyNumber)
 {
     return(this.loginAdapter.ChangePassword(changePassword, companyNumber));
 }
Ejemplo n.º 12
0
 public bool checkemail(Changepassword emailId)
 {
     return(this._rfqDataAcess.checkemail(emailId));
 }
Ejemplo n.º 13
0
 public string changepassword(Changepassword obj)
 {
     return(_rfqDataAcess.changepassword(obj));
 }
Ejemplo n.º 14
0
        public IHttpActionResult checkemailidexists(Changepassword email)
        {
            bool exists = this._rfqBusenessAcess.checkemail(email);

            return(Json(exists));
        }