using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SqlClient; using System.Data; using ZXDT.DBUtility; namespace ZXDT.CallCenter.DAL { /// /// 数据访问类:T_Sys_TempItems /// public partial class T_Sys_TempItems { public T_Sys_TempItems() { } #region Method /// /// 是否存在该记录 /// public bool Exists(int F_Id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) from T_Sys_TempItems"); strSql.Append(" where F_Id=@F_Id"); SqlParameter[] parameters = { new SqlParameter("@F_Id", SqlDbType.Int,4) }; parameters[0].Value = F_Id; return DbHelperSQL.Exists(strSql.ToString(), parameters); } /// /// 增加一条数据 /// public int Add(ZXDT.CallCenter.Model.T_Sys_TempItems model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_Sys_TempItems("); strSql.Append("F_TempName,F_UserId,ExpandIntField1,ExpandIntField2,ExpandIntField3,ExpandIntField4,ExpandIntField5,ExpandIntField6,ExpandDecField1,ExpandDecField2,ExpandDecField3,ExpandDecField4,ExpandDecField5,ExpandDecField6,ExpandDatField1,ExpandDatField2,ExpandDatField3,ExpandDatField4,ExpandDatField5,ExpandDatField6,ExpandVchField1,ExpandVchField2,ExpandVchField3,ExpandVchField4,ExpandVchField5,ExpandVchField6,ExpandVchField7,ExpandVchField8,ExpandVchField9,ExpandVchField10,ExpandVchField11,ExpandVchField12,ExpandVchField13,ExpandVchField14,ExpandVchField15,ExpandSintField1,ExpandSintField2,ExpandSintField3,ExpandSintField4,ExpandSintField5)"); strSql.Append(" values ("); strSql.Append("@F_TempName,@F_UserId,@ExpandIntField1,@ExpandIntField2,@ExpandIntField3,@ExpandIntField4,@ExpandIntField5,@ExpandIntField6,@ExpandDecField1,@ExpandDecField2,@ExpandDecField3,@ExpandDecField4,@ExpandDecField5,@ExpandDecField6,@ExpandDatField1,@ExpandDatField2,@ExpandDatField3,@ExpandDatField4,@ExpandDatField5,@ExpandDatField6,@ExpandVchField1,@ExpandVchField2,@ExpandVchField3,@ExpandVchField4,@ExpandVchField5,@ExpandVchField6,@ExpandVchField7,@ExpandVchField8,@ExpandVchField9,@ExpandVchField10,@ExpandVchField11,@ExpandVchField12,@ExpandVchField13,@ExpandVchField14,@ExpandVchField15,@ExpandSintField1,@ExpandSintField2,@ExpandSintField3,@ExpandSintField4,@ExpandSintField5)"); strSql.Append(";select @@IDENTITY"); SqlParameter[] parameters = { new SqlParameter("@F_TempName", SqlDbType.VarChar,200), new SqlParameter("@F_UserId", SqlDbType.Int,4), new SqlParameter("@ExpandIntField1", SqlDbType.Int,4), new SqlParameter("@ExpandIntField2", SqlDbType.Int,4), new SqlParameter("@ExpandIntField3", SqlDbType.Int,4), new SqlParameter("@ExpandIntField4", SqlDbType.Int,4), new SqlParameter("@ExpandIntField5", SqlDbType.Int,4), new SqlParameter("@ExpandIntField6", SqlDbType.Int,4), new SqlParameter("@ExpandDecField1", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField2", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField3", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField4", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField5", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField6", SqlDbType.Decimal,9), new SqlParameter("@ExpandDatField1", SqlDbType.DateTime), new SqlParameter("@ExpandDatField2", SqlDbType.DateTime), new SqlParameter("@ExpandDatField3", SqlDbType.DateTime), new SqlParameter("@ExpandDatField4", SqlDbType.DateTime), new SqlParameter("@ExpandDatField5", SqlDbType.DateTime), new SqlParameter("@ExpandDatField6", SqlDbType.DateTime), new SqlParameter("@ExpandVchField1", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField2", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField3", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField4", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField5", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField6", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField7", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField8", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField9", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField10", SqlDbType.VarChar,500), new SqlParameter("@ExpandVchField11", SqlDbType.VarChar,500), new SqlParameter("@ExpandVchField12", SqlDbType.VarChar,2000), new SqlParameter("@ExpandVchField13", SqlDbType.VarChar,2000), new SqlParameter("@ExpandVchField14", SqlDbType.Text), new SqlParameter("@ExpandVchField15", SqlDbType.Text), new SqlParameter("@ExpandSintField1", SqlDbType.SmallInt,2), new SqlParameter("@ExpandSintField2", SqlDbType.SmallInt,2), new SqlParameter("@ExpandSintField3", SqlDbType.SmallInt,2), new SqlParameter("@ExpandSintField4", SqlDbType.SmallInt,2), new SqlParameter("@ExpandSintField5", SqlDbType.SmallInt,2)}; parameters[0].Value = model.F_TempName; parameters[1].Value = model.F_UserId; parameters[2].Value = model.ExpandIntField1; parameters[3].Value = model.ExpandIntField2; parameters[4].Value = model.ExpandIntField3; parameters[5].Value = model.ExpandIntField4; parameters[6].Value = model.ExpandIntField5; parameters[7].Value = model.ExpandIntField6; parameters[8].Value = model.ExpandDecField1; parameters[9].Value = model.ExpandDecField2; parameters[10].Value = model.ExpandDecField3; parameters[11].Value = model.ExpandDecField4; parameters[12].Value = model.ExpandDecField5; parameters[13].Value = model.ExpandDecField6; parameters[14].Value = model.ExpandDatField1; parameters[15].Value = model.ExpandDatField2; parameters[16].Value = model.ExpandDatField3; parameters[17].Value = model.ExpandDatField4; parameters[18].Value = model.ExpandDatField5; parameters[19].Value = model.ExpandDatField6; parameters[20].Value = model.ExpandVchField1; parameters[21].Value = model.ExpandVchField2; parameters[22].Value = model.ExpandVchField3; parameters[23].Value = model.ExpandVchField4; parameters[24].Value = model.ExpandVchField5; parameters[25].Value = model.ExpandVchField6; parameters[26].Value = model.ExpandVchField7; parameters[27].Value = model.ExpandVchField8; parameters[28].Value = model.ExpandVchField9; parameters[29].Value = model.ExpandVchField10; parameters[30].Value = model.ExpandVchField11; parameters[31].Value = model.ExpandVchField12; parameters[32].Value = model.ExpandVchField13; parameters[33].Value = model.ExpandVchField14; parameters[34].Value = model.ExpandVchField15; parameters[35].Value = model.ExpandSintField1; parameters[36].Value = model.ExpandSintField2; parameters[37].Value = model.ExpandSintField3; parameters[38].Value = model.ExpandSintField4; parameters[39].Value = model.ExpandSintField5; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } } /// /// 更新一条数据 /// public bool Update(ZXDT.CallCenter.Model.T_Sys_TempItems model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update T_Sys_TempItems set "); strSql.Append("F_TempName=@F_TempName,"); strSql.Append("F_UserId=@F_UserId,"); strSql.Append("ExpandIntField1=@ExpandIntField1,"); strSql.Append("ExpandIntField2=@ExpandIntField2,"); strSql.Append("ExpandIntField3=@ExpandIntField3,"); strSql.Append("ExpandIntField4=@ExpandIntField4,"); strSql.Append("ExpandIntField5=@ExpandIntField5,"); strSql.Append("ExpandIntField6=@ExpandIntField6,"); strSql.Append("ExpandDecField1=@ExpandDecField1,"); strSql.Append("ExpandDecField2=@ExpandDecField2,"); strSql.Append("ExpandDecField3=@ExpandDecField3,"); strSql.Append("ExpandDecField4=@ExpandDecField4,"); strSql.Append("ExpandDecField5=@ExpandDecField5,"); strSql.Append("ExpandDecField6=@ExpandDecField6,"); strSql.Append("ExpandDatField1=@ExpandDatField1,"); strSql.Append("ExpandDatField2=@ExpandDatField2,"); strSql.Append("ExpandDatField3=@ExpandDatField3,"); strSql.Append("ExpandDatField4=@ExpandDatField4,"); strSql.Append("ExpandDatField5=@ExpandDatField5,"); strSql.Append("ExpandDatField6=@ExpandDatField6,"); strSql.Append("ExpandVchField1=@ExpandVchField1,"); strSql.Append("ExpandVchField2=@ExpandVchField2,"); strSql.Append("ExpandVchField3=@ExpandVchField3,"); strSql.Append("ExpandVchField4=@ExpandVchField4,"); strSql.Append("ExpandVchField5=@ExpandVchField5,"); strSql.Append("ExpandVchField6=@ExpandVchField6,"); strSql.Append("ExpandVchField7=@ExpandVchField7,"); strSql.Append("ExpandVchField8=@ExpandVchField8,"); strSql.Append("ExpandVchField9=@ExpandVchField9,"); strSql.Append("ExpandVchField10=@ExpandVchField10,"); strSql.Append("ExpandVchField11=@ExpandVchField11,"); strSql.Append("ExpandVchField12=@ExpandVchField12,"); strSql.Append("ExpandVchField13=@ExpandVchField13,"); strSql.Append("ExpandVchField14=@ExpandVchField14,"); strSql.Append("ExpandVchField15=@ExpandVchField15,"); strSql.Append("ExpandSintField1=@ExpandSintField1,"); strSql.Append("ExpandSintField2=@ExpandSintField2,"); strSql.Append("ExpandSintField3=@ExpandSintField3,"); strSql.Append("ExpandSintField4=@ExpandSintField4,"); strSql.Append("ExpandSintField5=@ExpandSintField5"); strSql.Append(" where F_Id=@F_Id"); SqlParameter[] parameters = { new SqlParameter("@F_TempName", SqlDbType.VarChar,200), new SqlParameter("@F_UserId", SqlDbType.Int,4), new SqlParameter("@ExpandIntField1", SqlDbType.Int,4), new SqlParameter("@ExpandIntField2", SqlDbType.Int,4), new SqlParameter("@ExpandIntField3", SqlDbType.Int,4), new SqlParameter("@ExpandIntField4", SqlDbType.Int,4), new SqlParameter("@ExpandIntField5", SqlDbType.Int,4), new SqlParameter("@ExpandIntField6", SqlDbType.Int,4), new SqlParameter("@ExpandDecField1", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField2", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField3", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField4", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField5", SqlDbType.Decimal,9), new SqlParameter("@ExpandDecField6", SqlDbType.Decimal,9), new SqlParameter("@ExpandDatField1", SqlDbType.DateTime), new SqlParameter("@ExpandDatField2", SqlDbType.DateTime), new SqlParameter("@ExpandDatField3", SqlDbType.DateTime), new SqlParameter("@ExpandDatField4", SqlDbType.DateTime), new SqlParameter("@ExpandDatField5", SqlDbType.DateTime), new SqlParameter("@ExpandDatField6", SqlDbType.DateTime), new SqlParameter("@ExpandVchField1", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField2", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField3", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField4", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField5", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField6", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField7", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField8", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField9", SqlDbType.VarChar,200), new SqlParameter("@ExpandVchField10", SqlDbType.VarChar,500), new SqlParameter("@ExpandVchField11", SqlDbType.VarChar,500), new SqlParameter("@ExpandVchField12", SqlDbType.VarChar,2000), new SqlParameter("@ExpandVchField13", SqlDbType.VarChar,2000), new SqlParameter("@ExpandVchField14", SqlDbType.Text), new SqlParameter("@ExpandVchField15", SqlDbType.Text), new SqlParameter("@ExpandSintField1", SqlDbType.SmallInt,2), new SqlParameter("@ExpandSintField2", SqlDbType.SmallInt,2), new SqlParameter("@ExpandSintField3", SqlDbType.SmallInt,2), new SqlParameter("@ExpandSintField4", SqlDbType.SmallInt,2), new SqlParameter("@ExpandSintField5", SqlDbType.SmallInt,2), new SqlParameter("@F_Id", SqlDbType.Int,4)}; parameters[0].Value = model.F_TempName; parameters[1].Value = model.F_UserId; parameters[2].Value = model.ExpandIntField1; parameters[3].Value = model.ExpandIntField2; parameters[4].Value = model.ExpandIntField3; parameters[5].Value = model.ExpandIntField4; parameters[6].Value = model.ExpandIntField5; parameters[7].Value = model.ExpandIntField6; parameters[8].Value = model.ExpandDecField1; parameters[9].Value = model.ExpandDecField2; parameters[10].Value = model.ExpandDecField3; parameters[11].Value = model.ExpandDecField4; parameters[12].Value = model.ExpandDecField5; parameters[13].Value = model.ExpandDecField6; parameters[14].Value = model.ExpandDatField1; parameters[15].Value = model.ExpandDatField2; parameters[16].Value = model.ExpandDatField3; parameters[17].Value = model.ExpandDatField4; parameters[18].Value = model.ExpandDatField5; parameters[19].Value = model.ExpandDatField6; parameters[20].Value = model.ExpandVchField1; parameters[21].Value = model.ExpandVchField2; parameters[22].Value = model.ExpandVchField3; parameters[23].Value = model.ExpandVchField4; parameters[24].Value = model.ExpandVchField5; parameters[25].Value = model.ExpandVchField6; parameters[26].Value = model.ExpandVchField7; parameters[27].Value = model.ExpandVchField8; parameters[28].Value = model.ExpandVchField9; parameters[29].Value = model.ExpandVchField10; parameters[30].Value = model.ExpandVchField11; parameters[31].Value = model.ExpandVchField12; parameters[32].Value = model.ExpandVchField13; parameters[33].Value = model.ExpandVchField14; parameters[34].Value = model.ExpandVchField15; parameters[35].Value = model.ExpandSintField1; parameters[36].Value = model.ExpandSintField2; parameters[37].Value = model.ExpandSintField3; parameters[38].Value = model.ExpandSintField4; parameters[39].Value = model.ExpandSintField5; parameters[40].Value = model.F_Id; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } } /// /// 删除一条数据 /// public bool Delete(int F_Id) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from T_Sys_TempItems "); strSql.Append(" where F_Id=@F_Id"); SqlParameter[] parameters = { new SqlParameter("@F_Id", SqlDbType.Int,4) }; parameters[0].Value = F_Id; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return true; } else { return false; } } /// /// 批量删除数据 /// public bool DeleteList(string F_Idlist) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from T_Sys_TempItems "); strSql.Append(" where F_Id in (" + F_Idlist + ") "); int rows = DbHelperSQL.ExecuteSql(strSql.ToString()); if (rows > 0) { return true; } else { return false; } } /// /// 得到一个对象实体 /// public ZXDT.CallCenter.Model.T_Sys_TempItems GetModel(int F_Id) { StringBuilder strSql = new StringBuilder(); strSql.Append("select top 1 F_Id,F_TempName,F_UserId,ExpandIntField1,ExpandIntField2,ExpandIntField3,ExpandIntField4,ExpandIntField5,ExpandIntField6,ExpandDecField1,ExpandDecField2,ExpandDecField3,ExpandDecField4,ExpandDecField5,ExpandDecField6,ExpandDatField1,ExpandDatField2,ExpandDatField3,ExpandDatField4,ExpandDatField5,ExpandDatField6,ExpandVchField1,ExpandVchField2,ExpandVchField3,ExpandVchField4,ExpandVchField5,ExpandVchField6,ExpandVchField7,ExpandVchField8,ExpandVchField9,ExpandVchField10,ExpandVchField11,ExpandVchField12,ExpandVchField13,ExpandVchField14,ExpandVchField15,ExpandSintField1,ExpandSintField2,ExpandSintField3,ExpandSintField4,ExpandSintField5 from T_Sys_TempItems "); strSql.Append(" where F_Id=@F_Id"); SqlParameter[] parameters = { new SqlParameter("@F_Id", SqlDbType.Int,4) }; parameters[0].Value = F_Id; ZXDT.CallCenter.Model.T_Sys_TempItems model = new ZXDT.CallCenter.Model.T_Sys_TempItems(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["F_Id"] != null && ds.Tables[0].Rows[0]["F_Id"].ToString() != "") { model.F_Id = int.Parse(ds.Tables[0].Rows[0]["F_Id"].ToString()); } if (ds.Tables[0].Rows[0]["F_TempName"] != null && ds.Tables[0].Rows[0]["F_TempName"].ToString() != "") { model.F_TempName = ds.Tables[0].Rows[0]["F_TempName"].ToString(); } if (ds.Tables[0].Rows[0]["F_UserId"] != null && ds.Tables[0].Rows[0]["F_UserId"].ToString() != "") { model.F_UserId = int.Parse(ds.Tables[0].Rows[0]["F_UserId"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandIntField1"] != null && ds.Tables[0].Rows[0]["ExpandIntField1"].ToString() != "") { model.ExpandIntField1 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField1"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandIntField2"] != null && ds.Tables[0].Rows[0]["ExpandIntField2"].ToString() != "") { model.ExpandIntField2 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField2"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandIntField3"] != null && ds.Tables[0].Rows[0]["ExpandIntField3"].ToString() != "") { model.ExpandIntField3 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField3"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandIntField4"] != null && ds.Tables[0].Rows[0]["ExpandIntField4"].ToString() != "") { model.ExpandIntField4 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField4"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandIntField5"] != null && ds.Tables[0].Rows[0]["ExpandIntField5"].ToString() != "") { model.ExpandIntField5 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField5"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandIntField6"] != null && ds.Tables[0].Rows[0]["ExpandIntField6"].ToString() != "") { model.ExpandIntField6 = int.Parse(ds.Tables[0].Rows[0]["ExpandIntField6"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDecField1"] != null && ds.Tables[0].Rows[0]["ExpandDecField1"].ToString() != "") { model.ExpandDecField1 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField1"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDecField2"] != null && ds.Tables[0].Rows[0]["ExpandDecField2"].ToString() != "") { model.ExpandDecField2 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField2"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDecField3"] != null && ds.Tables[0].Rows[0]["ExpandDecField3"].ToString() != "") { model.ExpandDecField3 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField3"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDecField4"] != null && ds.Tables[0].Rows[0]["ExpandDecField4"].ToString() != "") { model.ExpandDecField4 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField4"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDecField5"] != null && ds.Tables[0].Rows[0]["ExpandDecField5"].ToString() != "") { model.ExpandDecField5 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField5"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDecField6"] != null && ds.Tables[0].Rows[0]["ExpandDecField6"].ToString() != "") { model.ExpandDecField6 = decimal.Parse(ds.Tables[0].Rows[0]["ExpandDecField6"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDatField1"] != null && ds.Tables[0].Rows[0]["ExpandDatField1"].ToString() != "") { model.ExpandDatField1 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField1"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDatField2"] != null && ds.Tables[0].Rows[0]["ExpandDatField2"].ToString() != "") { model.ExpandDatField2 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField2"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDatField3"] != null && ds.Tables[0].Rows[0]["ExpandDatField3"].ToString() != "") { model.ExpandDatField3 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField3"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDatField4"] != null && ds.Tables[0].Rows[0]["ExpandDatField4"].ToString() != "") { model.ExpandDatField4 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField4"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDatField5"] != null && ds.Tables[0].Rows[0]["ExpandDatField5"].ToString() != "") { model.ExpandDatField5 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField5"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandDatField6"] != null && ds.Tables[0].Rows[0]["ExpandDatField6"].ToString() != "") { model.ExpandDatField6 = DateTime.Parse(ds.Tables[0].Rows[0]["ExpandDatField6"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandVchField1"] != null && ds.Tables[0].Rows[0]["ExpandVchField1"].ToString() != "") { model.ExpandVchField1 = ds.Tables[0].Rows[0]["ExpandVchField1"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField2"] != null && ds.Tables[0].Rows[0]["ExpandVchField2"].ToString() != "") { model.ExpandVchField2 = ds.Tables[0].Rows[0]["ExpandVchField2"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField3"] != null && ds.Tables[0].Rows[0]["ExpandVchField3"].ToString() != "") { model.ExpandVchField3 = ds.Tables[0].Rows[0]["ExpandVchField3"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField4"] != null && ds.Tables[0].Rows[0]["ExpandVchField4"].ToString() != "") { model.ExpandVchField4 = ds.Tables[0].Rows[0]["ExpandVchField4"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField5"] != null && ds.Tables[0].Rows[0]["ExpandVchField5"].ToString() != "") { model.ExpandVchField5 = ds.Tables[0].Rows[0]["ExpandVchField5"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField6"] != null && ds.Tables[0].Rows[0]["ExpandVchField6"].ToString() != "") { model.ExpandVchField6 = ds.Tables[0].Rows[0]["ExpandVchField6"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField7"] != null && ds.Tables[0].Rows[0]["ExpandVchField7"].ToString() != "") { model.ExpandVchField7 = ds.Tables[0].Rows[0]["ExpandVchField7"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField8"] != null && ds.Tables[0].Rows[0]["ExpandVchField8"].ToString() != "") { model.ExpandVchField8 = ds.Tables[0].Rows[0]["ExpandVchField8"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField9"] != null && ds.Tables[0].Rows[0]["ExpandVchField9"].ToString() != "") { model.ExpandVchField9 = ds.Tables[0].Rows[0]["ExpandVchField9"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField10"] != null && ds.Tables[0].Rows[0]["ExpandVchField10"].ToString() != "") { model.ExpandVchField10 = ds.Tables[0].Rows[0]["ExpandVchField10"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField11"] != null && ds.Tables[0].Rows[0]["ExpandVchField11"].ToString() != "") { model.ExpandVchField11 = ds.Tables[0].Rows[0]["ExpandVchField11"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField12"] != null && ds.Tables[0].Rows[0]["ExpandVchField12"].ToString() != "") { model.ExpandVchField12 = ds.Tables[0].Rows[0]["ExpandVchField12"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField13"] != null && ds.Tables[0].Rows[0]["ExpandVchField13"].ToString() != "") { model.ExpandVchField13 = ds.Tables[0].Rows[0]["ExpandVchField13"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField14"] != null && ds.Tables[0].Rows[0]["ExpandVchField14"].ToString() != "") { model.ExpandVchField14 = ds.Tables[0].Rows[0]["ExpandVchField14"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandVchField15"] != null && ds.Tables[0].Rows[0]["ExpandVchField15"].ToString() != "") { model.ExpandVchField15 = ds.Tables[0].Rows[0]["ExpandVchField15"].ToString(); } if (ds.Tables[0].Rows[0]["ExpandSintField1"] != null && ds.Tables[0].Rows[0]["ExpandSintField1"].ToString() != "") { model.ExpandSintField1 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField1"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandSintField2"] != null && ds.Tables[0].Rows[0]["ExpandSintField2"].ToString() != "") { model.ExpandSintField2 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField2"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandSintField3"] != null && ds.Tables[0].Rows[0]["ExpandSintField3"].ToString() != "") { model.ExpandSintField3 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField3"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandSintField4"] != null && ds.Tables[0].Rows[0]["ExpandSintField4"].ToString() != "") { model.ExpandSintField4 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField4"].ToString()); } if (ds.Tables[0].Rows[0]["ExpandSintField5"] != null && ds.Tables[0].Rows[0]["ExpandSintField5"].ToString() != "") { model.ExpandSintField5 = int.Parse(ds.Tables[0].Rows[0]["ExpandSintField5"].ToString()); } return model; } else { return null; } } /// /// 获得数据列表 /// public DataSet GetList(string strWhere) { StringBuilder strSql = new StringBuilder(); strSql.Append("select F_Id,F_TempName,F_UserId,ExpandIntField1,ExpandIntField2,ExpandIntField3,ExpandIntField4,ExpandIntField5,ExpandIntField6,ExpandDecField1,ExpandDecField2,ExpandDecField3,ExpandDecField4,ExpandDecField5,ExpandDecField6,ExpandDatField1,ExpandDatField2,ExpandDatField3,ExpandDatField4,ExpandDatField5,ExpandDatField6,ExpandVchField1,ExpandVchField2,ExpandVchField3,ExpandVchField4,ExpandVchField5,ExpandVchField6,ExpandVchField7,ExpandVchField8,ExpandVchField9,ExpandVchField10,ExpandVchField11,ExpandVchField12,ExpandVchField13,ExpandVchField14,ExpandVchField15,ExpandSintField1,ExpandSintField2,ExpandSintField3,ExpandSintField4,ExpandSintField5 "); strSql.Append(" FROM T_Sys_TempItems "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } return DbHelperSQL.Query(strSql.ToString()); } /// /// 获得前几行数据 /// public DataSet GetList(int Top, string strWhere, string filedOrder) { StringBuilder strSql = new StringBuilder(); strSql.Append("select "); if (Top > 0) { strSql.Append(" top " + Top.ToString()); } strSql.Append(" F_Id,F_TempName,F_UserId,ExpandIntField1,ExpandIntField2,ExpandIntField3,ExpandIntField4,ExpandIntField5,ExpandIntField6,ExpandDecField1,ExpandDecField2,ExpandDecField3,ExpandDecField4,ExpandDecField5,ExpandDecField6,ExpandDatField1,ExpandDatField2,ExpandDatField3,ExpandDatField4,ExpandDatField5,ExpandDatField6,ExpandVchField1,ExpandVchField2,ExpandVchField3,ExpandVchField4,ExpandVchField5,ExpandVchField6,ExpandVchField7,ExpandVchField8,ExpandVchField9,ExpandVchField10,ExpandVchField11,ExpandVchField12,ExpandVchField13,ExpandVchField14,ExpandVchField15,ExpandSintField1,ExpandSintField2,ExpandSintField3,ExpandSintField4,ExpandSintField5 "); strSql.Append(" FROM T_Sys_TempItems "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } strSql.Append(" order by " + filedOrder); return DbHelperSQL.Query(strSql.ToString()); } /// /// 获取记录总数 /// public int GetRecordCount(string strWhere) { StringBuilder strSql = new StringBuilder(); strSql.Append("select count(1) FROM T_Sys_TempItems "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } object obj = DbHelperSQL.GetSingle(strSql.ToString()); if (obj == null) { return 0; } else { return Convert.ToInt32(obj); } } /// /// 分页获取数据列表 /// public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex) { StringBuilder strSql = new StringBuilder(); strSql.Append("SELECT * FROM ( "); strSql.Append(" SELECT ROW_NUMBER() OVER ("); if (!string.IsNullOrEmpty(orderby.Trim())) { strSql.Append("order by T." + orderby); } else { strSql.Append("order by T.F_Id desc"); } strSql.Append(")AS Row, T.* from T_Sys_TempItems T "); if (!string.IsNullOrEmpty(strWhere.Trim())) { strSql.Append(" WHERE " + strWhere); } strSql.Append(" ) TT"); strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex); return DbHelperSQL.Query(strSql.ToString()); } /* /// /// 分页获取数据列表 /// public DataSet GetList(int PageSize,int PageIndex,string strWhere) { SqlParameter[] parameters = { new SqlParameter("@tblName", SqlDbType.VarChar, 255), new SqlParameter("@fldName", SqlDbType.VarChar, 255), new SqlParameter("@PageSize", SqlDbType.Int), new SqlParameter("@PageIndex", SqlDbType.Int), new SqlParameter("@IsReCount", SqlDbType.Bit), new SqlParameter("@OrderType", SqlDbType.Bit), new SqlParameter("@strWhere", SqlDbType.VarChar,1000), }; parameters[0].Value = "T_Sys_TempItems"; parameters[1].Value = "F_Id"; parameters[2].Value = PageSize; parameters[3].Value = PageIndex; parameters[4].Value = 0; parameters[5].Value = 0; parameters[6].Value = strWhere; return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds"); }*/ #endregion Method } }