Exemplo n.º 1
0
        /// <summary>
        /// 更新状态
        /// </summary>
        /// <param name="status">状态(1为启用;0为禁用)</param>
        /// <param name="id">主键</param>
        /// <returns></returns>
        public int UpdateStatus(string status, int id)
        {
            if (parameterValue == null)
            {
                parameterValue = new ParameterValue_DAL();
            }
            var value = parameterValue.UpdateStatus(status, id);

            if (value > -1)
            {
                var entity = ParameterValue_List.FirstOrDefault(f => f.Id == id);
                if (entity != null)
                {
                    entity.Status = status;
                }
            }

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }
            var s = (status == "1" ? "启用" : "禁用");

            Contents = Combination.Log_Contents_PrimaryKey("Sys_ParameterValue", id.ToString());
            Status_Log(value, s, s + "“" + id + "”参数值主键");
            return(value);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        public int Add(ParameterValue entity)
        {
            if (parameterValue == null)
            {
                parameterValue = new ParameterValue_DAL();
            }

            if (ParameterValue_List == null)
            {
                ParameterValue_List = new List <ParameterValue>();
            }

            var value = parameterValue.Add(entity);

            if (value > -1)
            {
                ParameterValue_List.Add(entity);
            }

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_Json("Sys_ParameterValue", Json.Serialization(entity));
            Add_Log(value, "创建“" + entity.Value + "”参数值");
            return(value);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 原始信息
 /// </summary>
 /// <param name="entity"></param>
 public void OriginalInfo(ParameterValue entity)
 {
     if (Combination == null)
     {
         Combination = new ContentsCombination();
     }
     Combination.OldName = entity.Value;
     ContentsArray       = new string[2];
     ContentsArray[0]    = Combination.Log_Contents_Json("原始信息", "Sys_ParameterValue", Json.Serialization(entity));
 }
Exemplo n.º 4
0
 /// <summary>
 /// 原始信息
 /// </summary>
 /// <param name="entity"></param>
 public void OriginalInfo(AccountNumber entity)
 {
     if (Combination == null)
     {
         Combination = new ContentsCombination();
     }
     Combination.OldName = entity.Name;
     ContentsArray       = new string[2];
     ContentsArray[0]    = Combination.Log_Contents_Json("原始信息", "data.json文件", Json.Serialization(entity));
 }
Exemplo n.º 5
0
 /// <summary>
 /// 原始信息
 /// </summary>
 /// <param name="entity"></param>
 public void OriginalInfo(Expend entity)
 {
     if (Combination == null)
     {
         Combination = new ContentsCombination();
     }
     Combination.OldName = entity.ItemName;
     ContentsArray       = new string[2];
     ContentsArray[0]    = Combination.Log_Contents_Json("原始信息", "Expend", Json.Serialization(entity));
 }
Exemplo n.º 6
0
 /// <summary>
 /// 原始信息
 /// </summary>
 /// <param name="entity"></param>
 public void OriginalInfo(System_User entity)
 {
     if (Combination == null)
     {
         Combination = new ContentsCombination();
     }
     Combination.OldName = entity.LoginName;
     ContentsArray       = new string[2];
     ContentsArray[0]    = Combination.Log_Contents_Json("原始信息", "T_SYS_USER", Json.Serialization(entity));
 }
Exemplo n.º 7
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        public int Delete(int id)
        {
            if (expend == null)
            {
                expend = new Expend_DAL();
            }
            int value = expend.Delete(id);

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_PrimaryKey("T_SYS_USER", id.ToString());
            Delete_Log(value, "删除“" + id + "”支出账目主键");
            return(value);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        public int Add(ParameterName entity)
        {
            DoLoad();
            var value = parameterName.Add(entity);

            if (value > -1)
            {
                ParameterName_List.Add(entity);
            }

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_Json("Sys_ParameterName", Json.Serialization(entity));
            Add_Log(value, "创建“" + entity.ConfigName + "”参数名称");
            return(value);
        }
Exemplo n.º 9
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Id">主键</param>
        /// <returns>-1为失败/大于-1为成功</returns>
        public int Delete(string Id)
        {
            if (AccountDAL == null)
            {
                AccountDAL = new Account_DAL();
            }
            AccountNumber_Entity_List.Remove(AccountNumber_Entity_List.FirstOrDefault(f => f.Id == Id));
            int value = AccountDAL.Delete(Json.Serialization(AccountNumber_Entity_List));

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_PrimaryKey("data.json文件", Id.ToString());
            Delete_Log(value, "删除“" + Id + "”账户主键");

            return(value);
        }
Exemplo n.º 10
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        public int Add(Expend entity)
        {
            if (expend == null)
            {
                expend = new Expend_DAL();
            }

            int value = expend.Add(entity);

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_Json("Expend", Json.Serialization(entity));
            Add_Log(value, "支出账目“" + entity.ItemName + "”");

            return(value);
        }
Exemplo n.º 11
0
        /// <summary>
        /// 更新密码
        /// </summary>
        /// <param name="pwd">新密码</param>
        /// <param name="confirmPaw">确认密码</param>
        /// <param name="id">主键</param>
        /// <returns></returns>
        public int Update_Pwd(string pwd, string id)
        {
            if (system_User == null)
            {
                system_User = new System_User_DAL();
            }

            string p     = Encryption.EncryptDES(pwd, ConfigurationManager.AppSettings["KeyValue"]);
            int    value = system_User.Update_Pwd(p, id);

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_PrimaryKey("T_SYS_USER", id.ToString());
            Update_Log(value, "更新“" + id + "”用户主键的密码");
            return(value);
        }
Exemplo n.º 12
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns></returns>
        public int Add(System_User entity)
        {
            if (system_User == null)
            {
                system_User = new System_User_DAL();
            }
            entity.Pwd     = Encryption.EncryptDES(entity.Pwd, ConfigurationManager.AppSettings["KeyValue"]);
            entity.IsAdmin = "0";
            System_User_Entity_List.Add(entity);
            int value = system_User.Add(entity);

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_Json("Sys_User", Json.Serialization(entity));
            Add_Log(value, "创建“" + entity.LoginName + "”用户名");
            return(value);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 添加账号
        /// </summary>
        /// <param name="entity">实体</param>
        /// <returns>-1为失败/大于-1为成功</returns>
        public int Add(AccountNumber entity)
        {
            if (AccountDAL == null)
            {
                AccountDAL = new Account_DAL();
            }

            entity.LogName = Encryption.EncryptDES(entity.LogName, ConfigurationManager.AppSettings["KeyValue"].ToString());
            entity.Paw     = Encryption.EncryptDES(entity.Paw, ConfigurationManager.AppSettings["KeyValue"].ToString());

            AccountNumber_Entity_List.Add(entity);
            int value = AccountDAL.Add(Json.Serialization(AccountNumber_Entity_List));

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_Json("data.json文件", Json.Serialization(entity));
            Add_Log(value, "账户“" + entity.Name + "”");
            return(value);
        }
Exemplo n.º 14
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">主键</param>
        /// <returns></returns>
        public int Delete(int id)
        {
            if (system_User == null)
            {
                system_User = new System_User_DAL();
            }

            int value = system_User.Delete(id);

            if (value > -1)
            {
                System_User_Entity_List.Remove(System_User_Entity_List.FirstOrDefault(f => f.Id == id));
            }

            if (Combination == null)
            {
                Combination = new ContentsCombination();
            }

            Contents = Combination.Log_Contents_PrimaryKey("T_SYS_USER", id.ToString());
            Delete_Log(value, "删除“" + id + "”用户主键");
            return(value);
        }