Ejemplo n.º 1
0
        /// <summary>
        /// 第三方检核
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>

        public bool Update_disanfangjianhe(YJUI.Model.neibutaizhang model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update neibutaizhang set ");
            strSql.Append("dsJianhe=@dsJianhe,");
            strSql.Append("dsPerson=@dsPerson,");
            strSql.Append("dsDate=@dsDate");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@dsJianhe", SqlDbType.VarChar,   50),
                new SqlParameter("@dsPerson", SqlDbType.VarChar,   50),
                new SqlParameter("@dsDate",   SqlDbType.DateTime),
                new SqlParameter("@ID",       SqlDbType.Int, 4)
            };
            parameters[0].Value = model.dsJianhe;
            parameters[1].Value = model.dsPerson;
            parameters[2].Value = model.dsDate;
            parameters[3].Value = model.ID;
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(YJUI.Model.neibutaizhang model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update neibutaizhang set ");
            strSql.Append("dyDep=@dyDep,");
            strSql.Append("dyPerson=@dyPerson,");
            strSql.Append("dyDate=@dyDate,");
            strSql.Append("dyGaishan=@dyGaishan,");
            strSql.Append("cqFangan=@cqFangan,");
            strSql.Append("IsEnd=@IsEnd,");
            strSql.Append("cqDate=@cqDate");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@dyDep",     SqlDbType.VarChar,    50),
                new SqlParameter("@dyPerson",  SqlDbType.VarChar,    50),
                new SqlParameter("@dyDate",    SqlDbType.DateTime),
                new SqlParameter("@dyGaishan", SqlDbType.NVarChar,  200),
                new SqlParameter("@cqFangan",  SqlDbType.NVarChar,  200),
                new SqlParameter("@IsEnd",     SqlDbType.NVarChar,   50),
                new SqlParameter("@cqDate",    SqlDbType.DateTime),
                new SqlParameter("@ID",        SqlDbType.Int, 4)
            };
            parameters[0].Value = model.dyDep;
            parameters[1].Value = model.dyPerson;
            parameters[2].Value = model.dyDate;
            parameters[3].Value = model.dyGaishan;
            parameters[4].Value = model.cqFangan;
            parameters[5].Value = model.IsEnd;
            parameters[6].Value = model.cqDate;
            parameters[7].Value = model.ID;
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(YJUI.Model.neibutaizhang model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into neibutaizhang(");
            strSql.Append("fkDate,fkPerson,fkDep,wtDep,fkDesc,fkItem,fkArea,fkCustomer,fkPic,DepCat)");
            strSql.Append(" values (");
            strSql.Append("@fkDate,@fkPerson,@fkDep,@wtDep,@fkDesc,@fkItem,@fkArea,@fkCustomer,@fkPic,@DepCat)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@fkDate",     SqlDbType.DateTime),
                new SqlParameter("@fkPerson",   SqlDbType.VarChar,    50),
                new SqlParameter("@fkDep",      SqlDbType.VarChar,    50),
                new SqlParameter("@wtDep",      SqlDbType.VarChar,    50),
                new SqlParameter("@fkDesc",     SqlDbType.Text),
                new SqlParameter("@fkItem",     SqlDbType.VarChar,    50),
                new SqlParameter("@fkArea",     SqlDbType.VarChar,   200),
                new SqlParameter("@fkCustomer", SqlDbType.VarChar,   200),
                new SqlParameter("@fkPic",      SqlDbType.VarChar,   200),
                new SqlParameter("@DepCat",     SqlDbType.VarChar,   200),
            };
            parameters[0].Value = model.fkDate;
            parameters[1].Value = model.fkPerson;
            parameters[2].Value = model.FkDep;
            parameters[3].Value = model.wtDep;
            parameters[4].Value = model.fkDesc;
            parameters[5].Value = model.fkItem;
            parameters[6].Value = model.fkArea;
            parameters[7].Value = model.fkCustomer;
            parameters[8].Value = model.FkPic;
            parameters[9].Value = model.DepCat;
            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public YJUI.Model.neibutaizhang GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ID,fkDate,fkPerson,wtDep,fkDesc,dyDep,dyPerson,dyDate,dyGaishan,cqFangan,cqDate,lsJianhe,lsDep,lsDate,myPingjia,myPerson,myDate,dsJianhe,dsPerson,dsDate from neibutaizhang ");
            strSql.Append(" where ID=@ID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID", SqlDbType.Int, 4)
            };
            parameters[0].Value = ID;

            YJUI.Model.neibutaizhang model = new YJUI.Model.neibutaizhang();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public YJUI.Model.neibutaizhang DataRowToModel(DataRow row)
 {
     YJUI.Model.neibutaizhang model = new YJUI.Model.neibutaizhang();
     if (row != null)
     {
         if (row["ID"] != null && row["ID"].ToString() != "")
         {
             model.ID = int.Parse(row["ID"].ToString());
         }
         if (row["fkDate"] != null && row["fkDate"].ToString() != "")
         {
             model.fkDate = DateTime.Parse(row["fkDate"].ToString());
         }
         if (row["fkPerson"] != null)
         {
             model.fkPerson = row["fkPerson"].ToString();
         }
         if (row["wtDep"] != null)
         {
             model.wtDep = row["wtDep"].ToString();
         }
         if (row["fkDesc"] != null)
         {
             model.fkDesc = row["fkDesc"].ToString();
         }
         if (row["dyDep"] != null)
         {
             model.dyDep = row["dyDep"].ToString();
         }
         if (row["dyPerson"] != null)
         {
             model.dyPerson = row["dyPerson"].ToString();
         }
         if (row["dyDate"] != null && row["dyDate"].ToString() != "")
         {
             model.dyDate = DateTime.Parse(row["dyDate"].ToString());
         }
         if (row["dyGaishan"] != null)
         {
             model.dyGaishan = row["dyGaishan"].ToString();
         }
         if (row["cqFangan"] != null)
         {
             model.cqFangan = row["cqFangan"].ToString();
         }
         if (row["cqDate"] != null && row["cqDate"].ToString() != "")
         {
             model.cqDate = DateTime.Parse(row["cqDate"].ToString());
         }
         if (row["lsJianhe"] != null)
         {
             model.lsJianhe = row["lsJianhe"].ToString();
         }
         if (row["lsDep"] != null)
         {
             model.lsDep = row["lsDep"].ToString();
         }
         if (row["lsDate"] != null && row["lsDate"].ToString() != "")
         {
             model.lsDate = DateTime.Parse(row["lsDate"].ToString());
         }
         if (row["myPingjia"] != null)
         {
             model.myPingjia = row["myPingjia"].ToString();
         }
         if (row["myPerson"] != null)
         {
             model.myPerson = row["myPerson"].ToString();
         }
         if (row["myDate"] != null && row["myDate"].ToString() != "")
         {
             model.myDate = DateTime.Parse(row["myDate"].ToString());
         }
         if (row["dsJianhe"] != null)
         {
             model.dsJianhe = row["dsJianhe"].ToString();
         }
         if (row["dsPerson"] != null)
         {
             model.dsPerson = row["dsPerson"].ToString();
         }
         if (row["dsDate"] != null && row["dsDate"].ToString() != "")
         {
             model.dsDate = DateTime.Parse(row["dsDate"].ToString());
         }
     }
     return(model);
 }