Esempio n. 1
0
        /// <summary>
        /// 将记录集转为sys_SystemInfoTable实体类
        /// </summary>
        /// <param name="dr">记录集</param>
        /// <returns>sys_SystemInfoTable</returns>
        protected object Populatesys_SystemInfo(IDataReader dr)
        {
            sys_SystemInfoTable nc = new sys_SystemInfoTable();

            if (!Convert.IsDBNull(dr["SystemID"]))
            {
                nc.SystemID = Convert.ToInt32(dr["SystemID"]);                                    // 自动ID
            }
            if (!Convert.IsDBNull(dr["S_Name"]))
            {
                nc.S_Name = Convert.ToString(dr["S_Name"]).Trim();                                  // 系统名称
            }
            if (!Convert.IsDBNull(dr["S_Version"]))
            {
                nc.S_Version = Convert.ToString(dr["S_Version"]).Trim();                                     // 版本号
            }
            if (!Convert.IsDBNull(dr["S_Licensed"]))
            {
                nc.S_Licensed = Convert.ToString(dr["S_Licensed"]).Trim();                                      // 序列号
            }
            if (!Convert.IsDBNull(dr["S_SystemConfigData"]))
            {
                nc.S_SystemConfigData = FrameSystemInfo.Deserialize_sys_ConfigDataTable((byte[])dr["S_SystemConfigData"]);                                              // 系统配置信息
            }
            if (nc.S_SystemConfigData.C_UploadSizeKb == 0)
            {
                nc.S_SystemConfigData.C_UploadSizeKb = 512;
            }
            if (nc.S_SystemConfigData.C_LoginErrorDisableMinute == 0)
            {
                nc.S_SystemConfigData.C_LoginErrorDisableMinute = 30;
            }
            if (nc.S_SystemConfigData.C_LoginErrorMaxNum == 0)
            {
                nc.S_SystemConfigData.C_LoginErrorMaxNum = 5;
            }
            return(nc);
        }
Esempio n. 2
0
        /// <summary>
        /// 新增/删除/修改 sys_SystemInfo
        /// </summary>
        /// <param name="fam">sys_SystemInfoTable实体类</param>
        /// <returns>返回0操正常</returns>
        public override int sys_SystemInfoInsertUpdate(sys_SystemInfoTable fam)
        {
            int rInt = 0;

            using (SqlConnection Conn = GetSqlConnection())
            {
                SqlCommand cmd = new SqlCommand("sys_SystemInfoInsertUpdateDelete", Conn);
                cmd.CommandType = CommandType.StoredProcedure;
                //设置参数
                cmd.Parameters.Add("@DB_Option_Action_", SqlDbType.NVarChar).Value = fam.DB_Option_Action_;                                                  //操作方法 Insert:增加 Update:修改 Delete:删除 Disp:显示单笔记录
                cmd.Parameters.Add("@SystemID", SqlDbType.Int).Value             = fam.SystemID;                                                             //自动ID
                cmd.Parameters.Add("@S_Name", SqlDbType.NVarChar).Value          = fam.S_Name;                                                               //系统名称
                cmd.Parameters.Add("@S_Version", SqlDbType.NVarChar).Value       = fam.S_Version;                                                            //版本号
                cmd.Parameters.Add("@S_Licensed", SqlDbType.VarChar).Value       = fam.S_Licensed;                                                           //序列号
                cmd.Parameters.Add("@S_SystemConfigData", SqlDbType.Image).Value = FrameSystemInfo.Serializable_sys_ConfigDataTable(fam.S_SystemConfigData); //系统配置信息
                Conn.Open();
                rInt = Convert.ToInt32(cmd.ExecuteScalar());
                cmd.Dispose();
                Conn.Dispose();
                Conn.Close();
            }
            return(rInt);
        }