Ejemplo n.º 1
0
        public string remoteCheck(CheckExits model)
        {
            Sql sql = new NPoco.Sql(string.Format("select count(1) from {0} where {1}='{2}'", model.TableName, model.ValidField, model.ValidValue));

            if (!string.IsNullOrEmpty(model.DataID))
            {
                sql.Append(string.Format(" and {0}<>'{1}' ", model.KeyField, model.DataID));
            }
            if (model.Filter != null)
            {
                sql.Append(ConditionParser.Serialize(model.Filter));
            }

            if (this.Db.Single <long>(sql) > 0)
            {
                return(string.Format("{0}的值已存在", model.Label));
            }
            return("");
            //
        }
Ejemplo n.º 2
0
        public string remoteCheck(CheckExits model, string frmID, string dataModelID)
        {
            Sql sql = new NPoco.Sql(string.Format("select count(1) from {0} where {1}='{2}'", model.TableName, model.ValidField, model.ValidValue));

            if (!string.IsNullOrEmpty(model.DataID))
            {
                sql.Append(string.Format(" and {0}<>'{1}' ", model.KeyField, model.DataID));
            }
            if (model.Filter != null)
            {
                sql.Append(ConditionParser.Serialize(model.Filter));
            }
            var      ds   = DataModelCom.getDataSource(dataModelID, this.Db);
            Database ywdb = DataBaseManger.GetDB(ds);

            if (ywdb.Single <long>(sql) > 0)
            {
                return(string.Format("{0}的值已存在", model.Label));
            }
            return("");
        }
Ejemplo n.º 3
0
 public Sql <T> On(string onClause, params object[] args)
 {
     _sql.Append("ON " + onClause, args);
     return(_sql);
 }
Ejemplo n.º 4
0
 public Sql On(string onClause, params object[] args)
 {
     return(_sql.Append("ON " + onClause, args));
 }