/// <summary> /// 得到一个对象实体 by SQLpara /// </summary> public Lebi_Supplier_Verified GetModel(SQLPara para) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 * from [Lebi_Supplier_Verified] "); if (para.Where != "") { strSql.Append(" where " + para.Where + ""); } Lebi_Supplier_Verified model = new Lebi_Supplier_Verified(); DataSet ds = SqlUtils.SqlUtilsInstance.TextExecuteDataset(strSql.ToString(), para.Para); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["id"].ToString() != "") { model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } model.Name = ds.Tables[0].Rows[0]["Name"].ToString(); if (ds.Tables[0].Rows[0]["Sort"].ToString() != "") { model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString()); } if (ds.Tables[0].Rows[0]["Supplier_Group_id"].ToString() != "") { model.Supplier_Group_id = int.Parse(ds.Tables[0].Rows[0]["Supplier_Group_id"].ToString()); } return(model); } else { return(null); } }
/// <summary> /// 编辑身份验证项目 /// </summary> public void Verified_Edit() { if (!EX_Admin.Power("supplier_verified", "身份验证")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); bool addflag = false; Lebi_Supplier_Verified model = B_Lebi_Supplier_Verified.GetModel(id); if (model == null) { addflag = true; model = new Lebi_Supplier_Verified(); } model = B_Lebi_Supplier_Verified.BindForm(model); model.Name = Language.RequestString("Name"); if (addflag) { B_Lebi_Supplier_Verified.Add(model); Log.Add("添加身份验证", "Supplier_Verified", id.ToString(), CurrentAdmin, Shop.Bussiness.Language.Content(model.Name, CurrentLanguage.Code)); } else { B_Lebi_Supplier_Verified.Update(model); Log.Add("编辑身份验证", "Supplier_Verified", id.ToString(), CurrentAdmin, Shop.Bussiness.Language.Content(model.Name, CurrentLanguage.Code)); } Response.Write("{\"msg\":\"OK\"}"); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Lebi_Supplier_Verified model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Lebi_Supplier_Verified]("); strSql.Append("Name,Sort,Supplier_Group_id)"); strSql.Append(" values ("); strSql.Append("@Name,@Sort,@Supplier_Group_id)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@Name", model.Name), new SqlParameter("@Sort", model.Sort), new SqlParameter("@Supplier_Group_id", model.Supplier_Group_id) }; object obj = SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters); if (obj == null) { return(1); } else { return(Convert.ToInt32(obj)); } }
public string VerifiedName(int id) { Lebi_Supplier_Verified model = B_Lebi_Supplier_Verified.GetModel(id); if (model == null) { return(""); } return(Lang(model.Name)); }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (!EX_Admin.Power("supplier_verified", "身份验证")) { WindowNoPower(); } model = B_Lebi_Supplier_Verified.GetModel(id); if (model == null) { model = new Lebi_Supplier_Verified(); } }
/// <summary> /// 安全方式绑定对象表单 /// </summary> public Lebi_Supplier_Verified SafeBindForm(Lebi_Supplier_Verified model) { if (HttpContext.Current.Request["Name"] != null) { model.Name = Shop.Tools.RequestTool.RequestSafeString("Name"); } if (HttpContext.Current.Request["Sort"] != null) { model.Sort = Shop.Tools.RequestTool.RequestInt("Sort", 0); } if (HttpContext.Current.Request["Supplier_Group_id"] != null) { model.Supplier_Group_id = Shop.Tools.RequestTool.RequestInt("Supplier_Group_id", 0); } return(model); }
/// <summary> /// 编辑身份验证项目 /// </summary> public void Verified_Edit() { if (!Power("supplier_verified", "身份验证")) { AjaxNoPower(); return; } int id = RequestTool.RequestInt("id", 0); int Type_id_BillType = RequestTool.RequestInt("Type_id_BillType", 0); bool addflag = false; string where = ""; where = "Verified_id = " + id + " and Supplier_id = " + CurrentSupplier.id + ""; Lebi_Supplier_Verified Verified = B_Lebi_Supplier_Verified.GetModel(id); if (Verified == null) { Verified = new Lebi_Supplier_Verified(); } Lebi_Supplier_Verified_Log model = B_Lebi_Supplier_Verified_Log.GetModel(where); if (model == null) { addflag = true; model = new Lebi_Supplier_Verified_Log(); } model = B_Lebi_Supplier_Verified_Log.SafeBindForm(model); model.Type_id_SupplierVerifiedStatus = 9020; model.Time_Add = DateTime.Now; if (addflag) { model.Verified_id = id; model.Supplier_id = CurrentSupplier.id; B_Lebi_Supplier_Verified_Log.Add(model); id = B_Lebi_Supplier_Verified_Log.GetMaxId(); Log.Add("身份验证", "Supplier_Verified", id.ToString(), CurrentSupplier, Lang(Verified.Name)); } else { B_Lebi_Supplier_Verified_Log.Update(model); Log.Add("身份验证", "Supplier_Verified", id.ToString(), CurrentSupplier, Lang(Verified.Name)); } string result = "{\"msg\":\"OK\", \"id\":\"" + id + "\"}"; Response.Write(result); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Lebi_Supplier_Verified model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update [Lebi_Supplier_Verified] set "); strSql.Append("[Name]=@Name,"); strSql.Append("[Sort]=@Sort,"); strSql.Append("[Supplier_Group_id]=@Supplier_Group_id"); strSql.Append(" where id=" + model.id); OleDbParameter[] parameters = { new OleDbParameter("@Name", model.Name), new OleDbParameter("@Sort", model.Sort), new OleDbParameter("@Supplier_Group_id", model.Supplier_Group_id) }; AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Lebi_Supplier_Verified model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [Lebi_Supplier_Verified]("); strSql.Append("[Name],[Sort],[Supplier_Group_id])"); strSql.Append(" values ("); strSql.Append("@Name,@Sort,@Supplier_Group_id)"); OleDbParameter[] parameters = { new OleDbParameter("@Name", model.Name), new OleDbParameter("@Sort", model.Sort), new OleDbParameter("@Supplier_Group_id", model.Supplier_Group_id) }; AccessUtils.Instance.TextExecuteNonQuery(strSql.ToString(), parameters); return(1); }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); int vid = RequestTool.RequestInt("vid", 0); if (!Power("supplier_verified", "身份验证")) { WindowNoPower(); } Verified = B_Lebi_Supplier_Verified.GetModel(id); if (Verified == null) { Verified = new Lebi_Supplier_Verified(); } model = B_Lebi_Supplier_Verified_Log.GetModel("Supplier_id = " + CurrentSupplier.id + " and id =" + vid + ""); if (model == null) { model = new Lebi_Supplier_Verified_Log(); } }
/// <summary> /// 对象实体绑定数据 /// </summary> public Lebi_Supplier_Verified ReaderBind(IDataReader dataReader) { Lebi_Supplier_Verified model = new Lebi_Supplier_Verified(); object ojb; ojb = dataReader["id"]; if (ojb != null && ojb != DBNull.Value) { model.id = (int)ojb; } model.Name = dataReader["Name"].ToString(); ojb = dataReader["Sort"]; if (ojb != null && ojb != DBNull.Value) { model.Sort = (int)ojb; } ojb = dataReader["Supplier_Group_id"]; if (ojb != null && ojb != DBNull.Value) { model.Supplier_Group_id = (int)ojb; } return(model); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Lebi_Supplier_Verified model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update [Lebi_Supplier_Verified] set "); strSql.Append("Name= @Name,"); strSql.Append("Sort= @Sort,"); strSql.Append("Supplier_Group_id= @Supplier_Group_id"); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4), new SqlParameter("@Name", SqlDbType.NVarChar, 500), new SqlParameter("@Sort", SqlDbType.Int, 4), new SqlParameter("@Supplier_Group_id", SqlDbType.Int, 4) }; parameters[0].Value = model.id; parameters[1].Value = model.Name; parameters[2].Value = model.Sort; parameters[3].Value = model.Supplier_Group_id; SqlUtils.SqlUtilsInstance.TextExecuteNonQuery(strSql.ToString(), parameters); }
/// <summary> /// 得到一个对象实体 by id /// </summary> public Lebi_Supplier_Verified GetModel(int id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 * from [Lebi_Supplier_Verified] "); strSql.Append(" where id=@id"); SqlParameter[] parameters = { new SqlParameter("@id", SqlDbType.Int, 4) }; parameters[0].Value = id; Lebi_Supplier_Verified model = new Lebi_Supplier_Verified(); DataSet ds = SqlUtils.SqlUtilsInstance.TextExecuteDataset(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["id"].ToString() != "") { model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString()); } model.Name = ds.Tables[0].Rows[0]["Name"].ToString(); if (ds.Tables[0].Rows[0]["Sort"].ToString() != "") { model.Sort = int.Parse(ds.Tables[0].Rows[0]["Sort"].ToString()); } if (ds.Tables[0].Rows[0]["Supplier_Group_id"].ToString() != "") { model.Supplier_Group_id = int.Parse(ds.Tables[0].Rows[0]["Supplier_Group_id"].ToString()); } return(model); } else { return(null); } }
/// <summary> /// 更新一条数据 /// </summary> public static void Update(Lebi_Supplier_Verified model) { D_Lebi_Supplier_Verified.Instance.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public static int Add(Lebi_Supplier_Verified model) { return(D_Lebi_Supplier_Verified.Instance.Add(model)); }
/// <summary> /// 安全方式绑定表单数据 /// </summary> public static Lebi_Supplier_Verified SafeBindForm(Lebi_Supplier_Verified model) { return(D_Lebi_Supplier_Verified.Instance.SafeBindForm(model)); }