/// <summary> /// 增加一条数据 /// </summary> public int Add(Model.tb_kehu model) { StringBuilder strSql = new StringBuilder(); StringBuilder strSql1 = new StringBuilder(); StringBuilder strSql2 = new StringBuilder(); if (model.h_no != null) { strSql1.Append("h_no,"); strSql2.Append("'" + model.h_no + "',"); } if (model.h_name != null) { strSql1.Append("h_name,"); strSql2.Append("'" + model.h_name + "',"); } if (model.h_tel != null) { strSql1.Append("h_tel,"); strSql2.Append("'" + model.h_tel + "',"); } if (model.h_address != null) { strSql1.Append("h_address,"); strSql2.Append("'" + model.h_address + "',"); } if (model.h_zipcode != null) { strSql1.Append("h_zipcode,"); strSql2.Append("'" + model.h_zipcode + "',"); } if (model.h_uname != null) { strSql1.Append("h_uname,"); strSql2.Append("'" + model.h_uname + "',"); } if (model.h_remark != null) { strSql1.Append("h_remark,"); strSql2.Append("'" + model.h_remark + "',"); } strSql.Append("insert into tb_kehu("); strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1)); strSql.Append(")"); strSql.Append(" values ("); strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1)); strSql.Append(")"); strSql.Append(";select @@IDENTITY"); object obj = DbSQL.GetSingle(strSql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Model.tb_pan model) { StringBuilder strSql = new StringBuilder(); StringBuilder strSql1 = new StringBuilder(); StringBuilder strSql2 = new StringBuilder(); if (model.p_pid != null) { strSql1.Append("p_pid,"); strSql2.Append("" + model.p_pid + ","); } if (model.p_time != null) { strSql1.Append("p_time,"); strSql2.Append("'" + model.p_time + "',"); } if (model.p_user != null) { strSql1.Append("p_user,"); strSql2.Append("'" + model.p_user + "',"); } if (model.p_numold != null) { strSql1.Append("p_numold,"); strSql2.Append("" + model.p_numold + ","); } if (model.p_numnow != null) { strSql1.Append("p_numnow,"); strSql2.Append("" + model.p_numnow + ","); } if (model.p_remark != null) { strSql1.Append("p_remark,"); strSql2.Append("'" + model.p_remark + "',"); } strSql.Append("insert into tb_pan("); strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1)); strSql.Append(")"); strSql.Append(" values ("); strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1)); strSql.Append(")"); strSql.Append(";select @@IDENTITY"); object obj = DbSQL.GetSingle(strSql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Model.tb_type model) { StringBuilder strSql = new StringBuilder(); StringBuilder strSql1 = new StringBuilder(); StringBuilder strSql2 = new StringBuilder(); if (model.t_paid != null) { strSql1.Append("t_paid,"); strSql2.Append("" + model.t_paid + ","); } if (model.t_no != null) { strSql1.Append("t_no,"); strSql2.Append("'" + model.t_no + "',"); } if (model.t_name != null) { strSql1.Append("t_name,"); strSql2.Append("'" + model.t_name + "',"); } if (model.t_desc != null) { strSql1.Append("t_desc,"); strSql2.Append("'" + model.t_desc + "',"); } strSql.Append("insert into tb_type("); strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1)); strSql.Append(")"); strSql.Append(" values ("); strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1)); strSql.Append(")"); strSql.Append(";select @@IDENTITY"); object obj = DbSQL.GetSingle(strSql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 获取记录总数 /// </summary> public int GetRecordCount(string strWhere) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) FROM tb_order "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } object obj = DbSQL.GetSingle(strSql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Model.tb_order model) { StringBuilder strSql = new StringBuilder(); StringBuilder strSql1 = new StringBuilder(); StringBuilder strSql2 = new StringBuilder(); if (model.o_no != null) { strSql1.Append("o_no,"); strSql2.Append("'" + model.o_no + "',"); } if (model.o_type != null) { strSql1.Append("o_type,"); strSql2.Append("" + model.o_type + ","); } if (model.o_time != null) { strSql1.Append("o_time,"); strSql2.Append("'" + model.o_time + "',"); } if (model.o_busy != null) { strSql1.Append("o_busy,"); strSql2.Append("" + model.o_busy + ","); } if (model.o_sum != null) { strSql1.Append("o_sum,"); strSql2.Append("'" + model.o_sum + "',"); } if (model.o_user != null) { strSql1.Append("o_user,"); strSql2.Append("'" + model.o_user + "',"); } if (model.o_desc != null) { strSql1.Append("o_desc,"); strSql2.Append("'" + model.o_desc + "',"); } if (model.o_num != null) { strSql1.Append("o_num,"); strSql2.Append("" + model.o_num + ","); } if (model.o_pid != null) { strSql1.Append("o_pid,"); strSql2.Append("" + model.o_pid + ","); } strSql.Append("insert into tb_order("); strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1)); strSql.Append(")"); strSql.Append(" values ("); strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1)); strSql.Append(")"); strSql.Append(";select @@IDENTITY"); object obj = DbSQL.GetSingle(strSql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Model.tb_churu model) { StringBuilder strSql = new StringBuilder(); StringBuilder strSql1 = new StringBuilder(); StringBuilder strSql2 = new StringBuilder(); if (model.cr_oid != null) { strSql1.Append("cr_oid,"); strSql2.Append("" + model.cr_oid + ","); } if (model.cr_pid != null) { strSql1.Append("cr_pid,"); strSql2.Append("" + model.cr_pid + ","); } if (model.cr_time != null) { strSql1.Append("cr_time,"); strSql2.Append("'" + model.cr_time + "',"); } if (model.cr_type != null) { strSql1.Append("cr_type,"); strSql2.Append("" + model.cr_type + ","); } if (model.cr_num != null) { strSql1.Append("cr_num,"); strSql2.Append("" + model.cr_num + ","); } if (model.cr_yan != null) { strSql1.Append("cr_yan,"); strSql2.Append("" + model.cr_yan + ","); } if (model.cr_price != null) { strSql1.Append("cr_price,"); strSql2.Append("" + model.cr_price + ","); } if (model.cr_remark != null) { strSql1.Append("cr_remark,"); strSql2.Append("'" + model.cr_remark + "',"); } strSql.Append("insert into tb_churu("); strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1)); strSql.Append(")"); strSql.Append(" values ("); strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1)); strSql.Append(")"); strSql.Append(";select @@IDENTITY"); object obj = DbSQL.GetSingle(strSql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Model.tb_user model) { StringBuilder strSql = new StringBuilder(); StringBuilder strSql1 = new StringBuilder(); StringBuilder strSql2 = new StringBuilder(); if (model.u_log != null) { strSql1.Append("u_log,"); strSql2.Append("'" + model.u_log + "',"); } if (model.u_pwd != null) { strSql1.Append("u_pwd,"); strSql2.Append("'" + model.u_pwd + "',"); } if (model.u_no != null) { strSql1.Append("u_no,"); strSql2.Append("'" + model.u_no + "',"); } if (model.u_name != null) { strSql1.Append("u_name,"); strSql2.Append("'" + model.u_name + "',"); } if (model.u_tel != null) { strSql1.Append("u_tel,"); strSql2.Append("'" + model.u_tel + "',"); } if (model.u_email != null) { strSql1.Append("u_email,"); strSql2.Append("'" + model.u_email + "',"); } if (model.u_type != null) { strSql1.Append("u_type,"); strSql2.Append("" + model.u_type + ","); } if (model.u_sex != null) { strSql1.Append("u_sex,"); strSql2.Append("'" + model.u_sex + "',"); } if (model.u_address != null) { strSql1.Append("u_address,"); strSql2.Append("'" + model.u_address + "',"); } if (model.u_adddate != null) { strSql1.Append("u_adddate,"); strSql2.Append("'" + model.u_adddate + "',"); } strSql.Append("insert into tb_user("); strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1)); strSql.Append(")"); strSql.Append(" values ("); strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1)); strSql.Append(")"); strSql.Append(";select @@IDENTITY"); object obj = DbSQL.GetSingle(strSql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Model.tb_proc model) { StringBuilder strSql = new StringBuilder(); StringBuilder strSql1 = new StringBuilder(); StringBuilder strSql2 = new StringBuilder(); if (model.p_no != null) { strSql1.Append("p_no,"); strSql2.Append("'" + model.p_no + "',"); } if (model.p_name != null) { strSql1.Append("p_name,"); strSql2.Append("'" + model.p_name + "',"); } if (model.p_tyid != null) { strSql1.Append("p_tyid,"); strSql2.Append("" + model.p_tyid + ","); } if (model.p_pinpai != null) { strSql1.Append("p_pinpai,"); strSql2.Append("'" + model.p_pinpai + "',"); } if (model.p_model != null) { strSql1.Append("p_model,"); strSql2.Append("'" + model.p_model + "',"); } if (model.p_shang != null) { strSql1.Append("p_shang,"); strSql2.Append("'" + model.p_shang + "',"); } if (model.p_price != null) { strSql1.Append("p_price,"); strSql2.Append("'" + model.p_price + "',"); } if (model.p_unit != null) { strSql1.Append("p_unit,"); strSql2.Append("'" + model.p_unit + "',"); } if (model.p_sx != null) { strSql1.Append("p_sx,"); strSql2.Append("'" + model.p_sx + "',"); } if (model.p_xx != null) { strSql1.Append("p_xx,"); strSql2.Append("'" + model.p_xx + "',"); } if (model.p_desc != null) { strSql1.Append("p_desc,"); strSql2.Append("'" + model.p_desc + "',"); } if (model.p_addtime != null) { strSql1.Append("p_addtime,"); strSql2.Append("'" + model.p_addtime + "',"); } if (model.p_ckid != null) { strSql1.Append("p_ckid,"); strSql2.Append("" + model.p_ckid + ","); } if (model.p_kqid != null) { strSql1.Append("p_kqid,"); strSql2.Append("" + model.p_kqid + ","); } if (model.p_num != null) { strSql1.Append("p_num,"); strSql2.Append("" + model.p_num + ","); } if (model.p_rzfid != null) { strSql1.Append("p_rzfid,"); strSql2.Append("" + model.p_rzfid + ","); } strSql.Append("insert into tb_proc("); strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1)); strSql.Append(")"); strSql.Append(" values ("); strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1)); strSql.Append(")"); strSql.Append(";select @@IDENTITY"); object obj = DbSQL.GetSingle(strSql.ToString()); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }