Beispiel #1
0
        /// <summary>
        /// 添加复审人
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Add(Model.SOSecondCheck model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into SOSecondCheck(");
            strSql.Append("SOSecondCheckID,SaleOrderID,SecondChecker,CheckFlag)");
            strSql.Append(" values (");
            strSql.Append("@SOSecondCheckID,@SaleOrderID,@SecondChecker,@CheckFlag)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SOSecondCheckID", SqlDbType.VarChar, 36),
                new SqlParameter("@SaleOrderID",     SqlDbType.VarChar, 36),
                new SqlParameter("@SecondChecker",   SqlDbType.VarChar, 36),
                new SqlParameter("@CheckFlag",       SqlDbType.Char, 1)
            };
            parameters[0].Value = model.SOSecondCheckID;
            parameters[1].Value = model.SaleOrderID;
            parameters[2].Value = model.SecondChecker;
            parameters[3].Value = model.CheckFlag;

            int rows = DBAccess.ExecuteNonQuery(DB.Type, DB.ConnectionString, CommandType.Text, strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 根据销售订单ID获取复审人
        /// </summary>
        /// <param name="SaleOrderID"></param>
        /// <returns></returns>
        public List <SOSecondCheck> GetModel(string SaleOrderID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select SOSecondCheckID,SaleOrderID,SecondChecker,SecondCheckTime,SecondCheckView,CheckFlag,U.UserName from SOSecondCheck SOC ");
            strSql.Append(" inner join OA_User U on U.UserID = SOC.SecondChecker ");
            strSql.Append(" where SaleOrderID=@SaleOrderID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@SaleOrderID", SqlDbType.VarChar, 36)
            };
            parameters[0].Value = SaleOrderID;

            DataSet ds = DBAccess.ExecuteDataset(DB.Type, DB.ConnectionString, CommandType.Text, strSql.ToString(), parameters);
            List <Model.SOSecondCheck> list = new List <OA.Model.SOSecondCheck>();

            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    Model.SOSecondCheck model = new Model.SOSecondCheck();
                    model.SOSecondCheckID = dr["SOSecondCheckID"].ToString();
                    model.SaleOrderID     = dr["SaleOrderID"].ToString();
                    model.SecondChecker   = dr["SecondChecker"].ToString();
                    if (dr["SecondCheckTime"] != null && dr["SecondCheckTime"].ToString() != "")
                    {
                        model.SecondCheckTime = DateTime.Parse(dr["SecondCheckTime"].ToString());
                    }
                    model.SecondCheckView   = dr["SecondCheckView"].ToString();
                    model.CheckFlag         = dr["CheckFlag"].ToString();
                    model.SecondCheckerName = dr["UserName"].ToString();

                    list.Add(model);
                }
            }
            return(list);
        }
Beispiel #3
0
 /// <summary>
 /// 添加复审人
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Add(Model.SOSecondCheck model)
 {
     return(iSOSecondCheckDAL.Add(model));
 }