Esempio n. 1
0
        public int UpdateSpecialCompanent2WorkFlowBySpecialDetailID(SpecialCompanent2WorkFlow obj)
        {
            string     sql = @"UPDATE [BE_SpecialCompanent2WorkFlow] SET [SpecialID]=@SpecialID
				, [WorkFlowID]=@WorkFlowID
				, [Sequence]=@Sequence
                WHERE [SpecialDetailID]=@SpecialDetailID"                ;
            SqlCommand cmd = new SqlCommand(sql, this.conn, this.trans);

            SqlParameter pSpecialID = new SqlParameter("SpecialID", Convert2DBnull(obj.SpecialID));

            pSpecialID.SqlDbType = SqlDbType.UniqueIdentifier;
            cmd.Parameters.Add(pSpecialID);

            SqlParameter pWorkFlowID = new SqlParameter("WorkFlowID", Convert2DBnull(obj.WorkFlowID));

            pWorkFlowID.SqlDbType = SqlDbType.UniqueIdentifier;
            cmd.Parameters.Add(pWorkFlowID);

            SqlParameter pSequence = new SqlParameter("Sequence", Convert2DBnull(obj.Sequence));

            pSequence.SqlDbType = SqlDbType.Int;
            cmd.Parameters.Add(pSequence);

            SqlParameter pSpecialDetailID = new SqlParameter("SpecialDetailID", Convert2DBnull(obj.SpecialDetailID));

            pSpecialDetailID.SqlDbType = SqlDbType.UniqueIdentifier;
            cmd.Parameters.Add(pSpecialDetailID);

            return(cmd.ExecuteNonQuery());
        }
Esempio n. 2
0
        public int InsertSpecialCompanent2WorkFlow(SpecialCompanent2WorkFlow obj)
        {
            string     sql = @"INSERT INTO[BE_SpecialCompanent2WorkFlow]([SpecialDetailID]
				, [SpecialID]
				, [WorkFlowID]
				, [Sequence]
				) VALUES(@SpecialDetailID
				, @SpecialID
				, @WorkFlowID
				, @Sequence
				)"                ;
            SqlCommand cmd = new SqlCommand(sql, this.conn, this.trans);

            SqlParameter pSpecialDetailID = new SqlParameter("SpecialDetailID", Convert2DBnull(obj.SpecialDetailID));

            pSpecialDetailID.SqlDbType = SqlDbType.UniqueIdentifier;
            cmd.Parameters.Add(pSpecialDetailID);

            SqlParameter pSpecialID = new SqlParameter("SpecialID", Convert2DBnull(obj.SpecialID));

            pSpecialID.SqlDbType = SqlDbType.UniqueIdentifier;
            cmd.Parameters.Add(pSpecialID);

            SqlParameter pWorkFlowID = new SqlParameter("WorkFlowID", Convert2DBnull(obj.WorkFlowID));

            pWorkFlowID.SqlDbType = SqlDbType.UniqueIdentifier;
            cmd.Parameters.Add(pWorkFlowID);

            SqlParameter pSequence = new SqlParameter("Sequence", Convert2DBnull(obj.Sequence));

            pSequence.SqlDbType = SqlDbType.Int;
            cmd.Parameters.Add(pSequence);

            return(cmd.ExecuteNonQuery());
        }
Esempio n. 3
0
        public List <SpecialCompanent2WorkFlow> LoadSpecialCompanent2WorkFlowsBySequence(int sequence)
        {
            string     sql = @"SELECT [SpecialDetailID]
				, [SpecialID]
				, [WorkFlowID]
				, [Sequence]
				 FROM [BE_SpecialCompanent2WorkFlow] WHERE [Sequence]=@Sequence"                ;
            SqlCommand cmd = new SqlCommand(sql, this.conn, this.trans);

            SqlParameter pSequence = new SqlParameter("Sequence", sequence);

            pSequence.SqlDbType = SqlDbType.Int;
            cmd.Parameters.Add(pSequence);

            List <SpecialCompanent2WorkFlow> ret = new List <SpecialCompanent2WorkFlow>();
            SqlDataReader dr = cmd.ExecuteReader();

            try
            {
                while (dr.Read())
                {
                    SpecialCompanent2WorkFlow iret = new SpecialCompanent2WorkFlow();
                    if (!Convert.IsDBNull(dr["SpecialDetailID"]))
                    {
                        iret.SpecialDetailID = (Guid)dr["SpecialDetailID"];
                    }
                    if (!Convert.IsDBNull(dr["SpecialID"]))
                    {
                        iret.SpecialID = (Guid)dr["SpecialID"];
                    }
                    if (!Convert.IsDBNull(dr["WorkFlowID"]))
                    {
                        iret.WorkFlowID = (Guid)dr["WorkFlowID"];
                    }
                    if (!Convert.IsDBNull(dr["Sequence"]))
                    {
                        iret.Sequence = (int)dr["Sequence"];
                    }
                    ret.Add(iret);
                }
            }
            finally
            {
                dr.Close();
            }
            return(ret);
        }
Esempio n. 4
0
        public int LoadSpecialCompanent2WorkFlowBySpecialDetailID(SpecialCompanent2WorkFlow obj)
        {
            string     sql = @"SELECT [SpecialDetailID]
				, [SpecialID]
				, [WorkFlowID]
				, [Sequence]
                FROM [BE_SpecialCompanent2WorkFlow] WITH(NOLOCK) WHERE [SpecialDetailID]=@SpecialDetailID"                ;
            SqlCommand cmd = new SqlCommand(sql, this.conn, this.trans);

            SqlParameter pSpecialDetailID = new SqlParameter("SpecialDetailID", Convert2DBnull(obj.SpecialDetailID));

            pSpecialDetailID.SqlDbType = SqlDbType.UniqueIdentifier;
            cmd.Parameters.Add(pSpecialDetailID);

            int           ret = 0;
            SqlDataReader dr  = cmd.ExecuteReader();

            try
            {
                while (dr.Read())
                {
                    if (!Convert.IsDBNull(dr["SpecialDetailID"]))
                    {
                        obj.SpecialDetailID = (Guid)dr["SpecialDetailID"];
                    }
                    if (!Convert.IsDBNull(dr["SpecialID"]))
                    {
                        obj.SpecialID = (Guid)dr["SpecialID"];
                    }
                    if (!Convert.IsDBNull(dr["WorkFlowID"]))
                    {
                        obj.WorkFlowID = (Guid)dr["WorkFlowID"];
                    }
                    if (!Convert.IsDBNull(dr["Sequence"]))
                    {
                        obj.Sequence = (int)dr["Sequence"];
                    }
                    ret += 1;
                }
            }
            finally
            {
                dr.Close();
            }
            return(ret);
        }