Пример #1
0
        public PurchasePaintInfo GetInfoByWfId(string wfInstanceId)
        {
            SqlParameter[] parameters = new SqlParameter[] {
                new SqlParameter("@WFInstanceId", System.Data.SqlDbType.NVarChar, 100)
            };
            parameters[0].Value = wfInstanceId;
            DataTable         dt   = DBHelper.ExecutedProcedure("Biz.JC_PurchasePaint_GetBywfId", parameters);
            PurchasePaintInfo Info = new PurchasePaintInfo();

            if (dt != null && dt.Rows.Count > 0)
            {
                Info.FormID     = Assign(dt.Rows[0]["FormID"]);
                Info.DeptName   = Assign(dt.Rows[0]["DeptName"]);
                Info.DeptCode   = Assign(dt.Rows[0]["DeptCode"]);
                Info.UserName   = Assign(dt.Rows[0]["UserName"]);
                Info.Mobile     = Assign(dt.Rows[0]["Mobile"]);
                Info.DateTime   = Assign(dt.Rows[0]["DateTime"]);
                Info.Title      = Assign(dt.Rows[0]["Title"]);
                Info.Content    = Assign(dt.Rows[0]["Content"]);
                Info.IsApproval = Assign(dt.Rows[0]["IsApproval"]);
                return(Info);
            }

            return(null);
        }
Пример #2
0
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(PurchasePaintInfo model)
        {
            string sql = string.Format("Update Biz.JC_PurchasePaint set DeptName = '{0}',DeptCode='{1}'," +
                                       "UserName='******',Mobile='{3}',DateTime='{4}',Title='{5}',Content='{6}',IsApproval = '{7}' where FormID = '{8}'",
                                       model.DeptName, model.DeptCode, model.UserName, model.Mobile, model.DateTime,
                                       model.Title, model.Content, model.IsApproval, model.FormID);

            return(DBHelper.ExecuteNonQuery(sql));
        }
Пример #3
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Insert(PurchasePaintInfo model)
        {
            string sql = string.Format("INSERT INTO Biz.JC_PurchasePaint (FormID,DeptName,DeptCode,UserName,Mobile,DateTime," +
                                       "Title,Content,IsApproval) VALUES" + "('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')",
                                       model.FormID, model.DeptName, model.DeptCode, model.UserName, model.Mobile,
                                       model.DateTime, model.Title, model.Content, model.IsApproval);

            return(DBHelper.ExecuteNonQuery(sql));
        }