Exemplo n.º 1
0
        public int AlterPassword(long opid, string newPassword)
        {
            int result;

            try
            {
                //var model = db.SysOperator.Find(opid);
                //if (model != null)
                //{
                //    model.Password = newPassword;
                //}
                //db.Entry(model).State = System.Data.Entity.EntityState.Modified;
                //result = db.SaveChanges();

                var obj = db.UP_AlterPassword(opid, newPassword);
                var id  = obj.FirstOrDefault();
                if (id == null)
                {
                    return(0);
                }
                result = 1;
                return(result);
            }
            catch (Exception ex)
            {
                LogUtil.Exception("ExceptionLogger", ex);
                result = 0;
            }
            return(result);
        }