Example #1
0
        public bool Exist(CodeEntity codeEntity)
        {
            DataRow[] rows = this.Codes.Select("ID = '"+ codeEntity.ID +"' AND Code = '"+ codeEntity.Code +"'");

            if (rows.Length > 0)
                return true;
            else
                return false;
        }
Example #2
0
        public void Delete(CodeEntity codeEntity)
        {
            DatabaseLib.DatabaseFactory dataFactory = new DatabaseLib.DatabaseFactory();
            DatabaseLib.IDatabase dataClient = dataFactory.CreateClient(BaseLib.SystemType.Web);

            string strSql = "DELETE FROM s_codes WHERE ID = '@ID@'";

            strSql = strSql.Replace("@ID@", codeEntity.ID);

            dataClient.SqlText = strSql;

            DataSet ds = dataClient.Query();

            this.Message = dataClient.Message;
            this.Result = dataClient.Result;
        }
Example #3
0
        public void Add(CodeEntity codeEntity)
        {
            DatabaseLib.DatabaseFactory dataFactory = new DatabaseLib.DatabaseFactory();
            DatabaseLib.IDatabase dataClient = dataFactory.CreateClient(BaseLib.SystemType.Web);

            string strSql = "INSERT INTO s_codes(ID, Text, Value, Code, CodeText) VALUES('@ID@', '@Text@', '@Value@', '@Code@', '@CodeText@')";

            strSql = strSql.Replace("@ID@", codeEntity.ID);
            strSql = strSql.Replace("@Text@", codeEntity.Text);
            strSql = strSql.Replace("@Value@", codeEntity.Value);
            strSql = strSql.Replace("@Code@", codeEntity.Code);
            strSql = strSql.Replace("@CodeText@", codeEntity.CodeText);

            dataClient.SqlText = strSql;

            DataSet ds = dataClient.Query();

            this.Message = dataClient.Message;
            this.Result = dataClient.Result;
        }
Example #4
0
        public void Modify(CodeEntity codeEntity)
        {
            DatabaseLib.DatabaseFactory dataFactory = new DatabaseLib.DatabaseFactory();
            DatabaseLib.IDatabase dataClient = dataFactory.CreateClient(BaseLib.SystemType.Web);

            string strSql = "UPDATE s_codes SET Text = '@Text@',  Value = '@Value@' WHERE ID = '@ID@'; UPDATE s_codes SET CodeText = '@CodeText@ WHERE Code = '@Code@'";

            strSql = strSql.Replace("@ID@", codeEntity.ID);
            strSql = strSql.Replace("@Text@", codeEntity.Text);
            strSql = strSql.Replace("@Value@", codeEntity.Value);
            strSql = strSql.Replace("@Code@", codeEntity.Code);
            strSql = strSql.Replace("@CodeText@", codeEntity.CodeText);

            dataClient.SqlText = strSql;

            DataSet ds = dataClient.Query();

            this.Message = dataClient.Message;
            this.Result = dataClient.Result;
        }