Exemple #1
0
        private string submitaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Sys.BusinessUserInfo bu = new project.Business.Sys.BusinessUserInfo();
                bu.load(userid);
                if (bu.Entity.Password == Encrypt.EncryptDES(jp.getValue("oldpwd"), "1"))
                {
                    bu.Entity.Password = Encrypt.EncryptDES(jp.getValue("newpwd"), "1");
                    bu.changepwd();
                }
                else
                {
                    flag = "3";
                }
            }
            catch { flag = "2"; }

            collection.Add(new JsonStringValue("type", "submit"));
            collection.Add(new JsonStringValue("flag", flag));

            return(collection.ToString());
        }
Exemple #2
0
        private string newpasswordaction(JsonArrayParse jp)
        {
            JsonObjectCollection collection = new JsonObjectCollection();
            string flag = "1";

            try
            {
                Business.Sys.BusinessUserInfo bc = new project.Business.Sys.BusinessUserInfo();
                bc.load(jp.getValue("id"));
                string newpwd = getRandom();

                bc.Entity.Password = Encrypt.EncryptDES(newpwd, "1");
                int r = bc.changepwd();
                if (r <= 0)
                {
                    flag = "2";
                }

                collection.Add(new JsonStringValue("type", "newpassword"));
                collection.Add(new JsonStringValue("flag", flag));
                collection.Add(new JsonStringValue("newpassword", newpwd));
            }
            catch
            { flag = "2"; }
            return(collection.ToString());
        }