public bool SetBind(TemplateBindType type, int bindId, string templatePath) { int rowcount; if (!HasExists(type, bindId)) { rowcount = base.ExecuteNonQuery( new SqlQuery(base.OptimizeSQL(SP.TplBind_Add), new object[, ] { { "@bindId", bindId }, { "@bindType", (int)type }, { "@tplPath", templatePath } })); } else { //如果模板为空,则删除 if (String.IsNullOrEmpty(templatePath)) { return(RemoveBind(type, bindId)); } else { rowcount = base.ExecuteNonQuery( new SqlQuery(base.OptimizeSQL(SP.TplBind_Update), new object[, ] { { "@tplPath", templatePath }, { "@bindId", bindId }, { "@bindType", (int)type } })); } } return(rowcount == 1); }
internal bool RemoveBind(TemplateBindType type, string bindID) { bool result = dal.RemoveBind(type, bindID); //WeakRefCache.RebuiltTemplateBind(); return(result); }
public Error RemoveBind(int refrenceId, TemplateBindType templateBindType) { bool result = tpldal.RemoveBind(templateBindType, refrenceId); RepositoryDataCache.ClearTemplateBinds(); return(null); }
public bool SetBind(TemplateBindType type, int bindId, string templatePath) { int rowcount; //如果模板为空,则删除 if (String.IsNullOrEmpty(templatePath)) { return(RemoveBind(type, bindId)); } var paramsters = base.Db.CreateParametersFromArray( new object[, ] { { "@tplPath", templatePath }, { "@bindId", bindId }, { "@bindType", (int)type } }); if (!HasExists(type, bindId)) { rowcount = base.ExecuteNonQuery( base.NewQuery(DbSql.TplBind_Add, paramsters)); } else { rowcount = base.ExecuteNonQuery( base.NewQuery(DbSql.TplBind_Update, paramsters) ); } return(rowcount == 1); }
public bool SetBind(TemplateBindType type,int bindId,string templatePath) { int rowcount; if (!HasExists(type, bindId)) { rowcount = base.ExecuteNonQuery( new SqlQuery(base.OptimizeSQL(SP.TplBind_Add), new object[,]{ {"@bindId", bindId}, {"@bindType",(int)type}, {"@tplPath",templatePath} })); } else { //如果模板为空,则删除 if (String.IsNullOrEmpty(templatePath)) { return RemoveBind(type, bindId); } else { rowcount = base.ExecuteNonQuery( new SqlQuery(base.OptimizeSQL(SP.TplBind_Update), new object[,]{ {"@tplPath",templatePath}, {"@bindId",bindId}, {"@bindType",(int)type} })); } } return rowcount == 1; }
//private TemplateBind GetBind(TemplateBindType type, string bindID) //{ // TemplateBind entity = null; // base.ExecuteReader(new SqlQuery(base.OptimizeSQL(SP.TplBind_GetBind), // new object[,]{ // {"@bindId", bindID}, // {"@bindType", type} // }), // reader => // { // if (reader.HasRows) // { // entity = reader.ToEntity<TemplateBind>(); // } // }); // return entity; //} public bool RemoveBind(TemplateBindType type, int bindRefrenceId) { return(base.ExecuteNonQuery( base.NewQuery(DbSql.TplBind_RemoveBind, base.Db.CreateParametersFromArray( new object[, ] { { "@bindId", bindRefrenceId }, { "@bindType", type } }))) == 1); }
private ITemplateBind GetBind(TemplateBindType templateBindType, int bindRefrenceId) { foreach (ITemplateBind bind in this.TemplateBinds) { if (bind.BindType == templateBindType && bind.BindRefrenceId == bindRefrenceId) return bind; } return null; }
//private TemplateBind GetBind(TemplateBindType type, string bindID) //{ // TemplateBind entity = null; // base.ExecuteReader(new SqlQuery(base.OptimizeSQL(SP.TplBind_GetBind), // new object[,]{ // {"@bindId", bindID}, // {"@bindType", type} // }), // reader => // { // if (reader.HasRows) // { // entity = reader.ToEntity<TemplateBind>(); // } // }); // return entity; //} public bool RemoveBind(TemplateBindType type, int bindRefrenceId) { return base.ExecuteNonQuery( new SqlQuery(base.OptimizeSQL(SP.TplBind_RemoveBind), new object[,]{ {"@bindId", bindRefrenceId}, {"@bindType", type} })) == 1; }
//private TemplateBind GetBind(TemplateBindType type, string bindID) //{ // TemplateBind entity = null; // base.ExecuteReader(new SqlQuery(base.OptimizeSQL(SP.TplBind_GetBind), // new object[,]{ // {"@bindId", bindID}, // {"@bindType", type} // }), // reader => // { // if (reader.HasRows) // { // entity = reader.ToEntity<TemplateBind>(); // } // }); // return entity; //} public bool RemoveBind(TemplateBindType type, int bindRefrenceId) { return(base.ExecuteNonQuery( new SqlQuery(base.OptimizeSQL(SP.TplBind_RemoveBind), new object[, ] { { "@bindId", bindRefrenceId }, { "@bindType", type } })) == 1); }
private bool HasExists(TemplateBindType type, int bindID) { return(int.Parse(base.ExecuteScalar( new SqlQuery(base.OptimizeSQL(SP.TplBind_CheckExists), new object[, ] { { "@bindId", bindID }, { "@bindType", type } }) ).ToString()) != 0); }
private bool HasExists(TemplateBindType type, int bindID) { return int.Parse(base.ExecuteScalar( new SqlQuery(base.OptimizeSQL(SP.TplBind_CheckExists), new object[,]{ {"@bindId", bindID}, {"@bindType", type} }) ).ToString()) != 0; }
private ITemplateBind GetBind(TemplateBindType templateBindType, int bindRefrenceId) { foreach (ITemplateBind bind in this.TemplateBinds) { if (bind.BindType == templateBindType && bind.BindRefrenceId == bindRefrenceId) { return(bind); } } return(null); }
private bool HasExists(TemplateBindType type, int bindId) { var parameters = base.Db.CreateParametersFromArray( new object[, ] { { "@bindId", bindId }, { "@bindType", type } }); return(int.Parse(base.ExecuteScalar( base.NewQuery(DbSql.TplBind_CheckExists, parameters) ).ToString()) != 0); }
internal TemplateBind(int id, TemplateBindType type, string templatePath) { this.Id = id; this.BindType = type; this.TplPath = templatePath; }
public void RemoveBind(TemplateBindType templateBindType, int bindRefrenceId) { bool result = tpldal.RemoveBind(templateBindType, bindRefrenceId); RepositoryDataCache.ClearTemplateBinds(); }
public ITemplateBind GetTemplateBind(int bindRelationId, TemplateBindType templateBindType) { return this.GetBind(templateBindType, bindRelationId); }
internal TemplateBind(int id,TemplateBindType type,string templatePath) { this.Id = id; this.BindType = type; this.TplPath = templatePath; }
public TemplateBind(int id, TemplateBindType type, string templatePath) { ID = id; BindType = type; TplPath = templatePath; }
public ITemplateBind GetTemplateBind(int bindRelationId, TemplateBindType templateBindType) { return(this.GetBind(templateBindType, bindRelationId)); }
internal bool RemoveBind(TemplateBindType type, string bindID) { bool result=dal.RemoveBind(type, bindID); //WeakRefCache.RebuiltTemplateBind(); return result; }
public TemplateBind CreateTemplateBind(int id, TemplateBindType type, string templatePath) { return(new TemplateBind(id, type, templatePath)); }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <param name="type"></param> /// <param name="templatePath"></param> /// <returns></returns> public ITemplateBind CreateTemplateBind(int id, TemplateBindType type, string templatePath) { return new TemplateBind(id, type, templatePath); }
public TemplateBind(int id, TemplateBindType type, string templatePath) { this.ID = id; this.BindType = type; this.TplPath = templatePath; }