Пример #1
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(MobileSoft.Model.WorkFlow.Tb_WorkFlow_InstanceTemp model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@InfoId",                                    SqlDbType.Int,         4),
                new SqlParameter("@InstanceId",                                SqlDbType.Int,         4),
                new SqlParameter("@Tb_Dictionary_InstanceType_DictionaryCode", SqlDbType.NVarChar,   20),
                new SqlParameter("@InstanceMark",                              SqlDbType.VarChar,  2000),
                new SqlParameter("@NoticeMsg",                                 SqlDbType.Int,         4),
                new SqlParameter("@NoticeMail",                                SqlDbType.Int,         4),
                new SqlParameter("@NoticePhone",                               SqlDbType.Int,         4),
                new SqlParameter("@NoticeHaveDeal",                            SqlDbType.Int,         4),
                new SqlParameter("@NoticeStartDeal",                           SqlDbType.Int,         4),
                new SqlParameter("@NoticeOtherUser",                           SqlDbType.Int,         4),
                new SqlParameter("@IsComplete",                                SqlDbType.Int,         4),
                new SqlParameter("@IsSuccess",                                 SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.InfoId;
            parameters[1].Value  = model.InstanceId;
            parameters[2].Value  = model.Tb_Dictionary_InstanceType_DictionaryCode;
            parameters[3].Value  = model.InstanceMark;
            parameters[4].Value  = model.NoticeMsg;
            parameters[5].Value  = model.NoticeMail;
            parameters[6].Value  = model.NoticePhone;
            parameters[7].Value  = model.NoticeHaveDeal;
            parameters[8].Value  = model.NoticeStartDeal;
            parameters[9].Value  = model.NoticeOtherUser;
            parameters[10].Value = model.IsComplete;
            parameters[11].Value = model.IsSuccess;

            DbHelperSQL.RunProcedure("Proc_Tb_WorkFlow_InstanceTemp_Update", parameters, out rowsAffected);
        }
Пример #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public MobileSoft.Model.WorkFlow.Tb_WorkFlow_InstanceTemp GetModel(int InfoId)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@InfoId", SqlDbType.Int, 4)
            };
            parameters[0].Value = InfoId;

            MobileSoft.Model.WorkFlow.Tb_WorkFlow_InstanceTemp model = new MobileSoft.Model.WorkFlow.Tb_WorkFlow_InstanceTemp();
            DataSet ds = DbHelperSQL.RunProcedure("Proc_Tb_WorkFlow_InstanceTemp_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["InfoId"].ToString() != "")
                {
                    model.InfoId = int.Parse(ds.Tables[0].Rows[0]["InfoId"].ToString());
                }
                if (ds.Tables[0].Rows[0]["InstanceId"].ToString() != "")
                {
                    model.InstanceId = int.Parse(ds.Tables[0].Rows[0]["InstanceId"].ToString());
                }
                model.Tb_Dictionary_InstanceType_DictionaryCode = ds.Tables[0].Rows[0]["Tb_Dictionary_InstanceType_DictionaryCode"].ToString();
                model.InstanceMark = ds.Tables[0].Rows[0]["InstanceMark"].ToString();
                if (ds.Tables[0].Rows[0]["NoticeMsg"].ToString() != "")
                {
                    model.NoticeMsg = int.Parse(ds.Tables[0].Rows[0]["NoticeMsg"].ToString());
                }
                if (ds.Tables[0].Rows[0]["NoticeMail"].ToString() != "")
                {
                    model.NoticeMail = int.Parse(ds.Tables[0].Rows[0]["NoticeMail"].ToString());
                }
                if (ds.Tables[0].Rows[0]["NoticePhone"].ToString() != "")
                {
                    model.NoticePhone = int.Parse(ds.Tables[0].Rows[0]["NoticePhone"].ToString());
                }
                if (ds.Tables[0].Rows[0]["NoticeHaveDeal"].ToString() != "")
                {
                    model.NoticeHaveDeal = int.Parse(ds.Tables[0].Rows[0]["NoticeHaveDeal"].ToString());
                }
                if (ds.Tables[0].Rows[0]["NoticeStartDeal"].ToString() != "")
                {
                    model.NoticeStartDeal = int.Parse(ds.Tables[0].Rows[0]["NoticeStartDeal"].ToString());
                }
                if (ds.Tables[0].Rows[0]["NoticeOtherUser"].ToString() != "")
                {
                    model.NoticeOtherUser = int.Parse(ds.Tables[0].Rows[0]["NoticeOtherUser"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsComplete"].ToString() != "")
                {
                    model.IsComplete = int.Parse(ds.Tables[0].Rows[0]["IsComplete"].ToString());
                }
                if (ds.Tables[0].Rows[0]["IsSuccess"].ToString() != "")
                {
                    model.IsSuccess = int.Parse(ds.Tables[0].Rows[0]["IsSuccess"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }