示例#1
0
文件: SlnManager.cs 项目: ue96/ue96
 private void mapSlnItemC3(SlnItemC3Info oParam, DataRow tempdr)
 {
     oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]);
     oParam.SlnItemSysNo = Util.TrimIntNull(tempdr["SlnItemSysNo"]);
     oParam.C3SysNo = Util.TrimIntNull(tempdr["C3SysNo"]);
     oParam.Status = Util.TrimIntNull(tempdr["Status"]);
 }
示例#2
0
文件: SlnManager.cs 项目: ue96/ue96
        public void UpdateSlnItemC3(SlnItemC3Info oParam)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                new SlnDac().Update(oParam);
                scope.Complete();
            }
        }
示例#3
0
文件: SlnManager.cs 项目: ue96/ue96
 public SlnItemC3Info LoadSlnItemC3(int SysNo)
 {
     string sql = "select * from sln_item_c3 where sysno=" + SysNo;
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     SlnItemC3Info oParam = new SlnItemC3Info();
     if (Util.HasMoreRow(ds))
         mapSlnItemC3(oParam, ds.Tables[0].Rows[0]);
     else
         oParam = null;
     return oParam;
 }
示例#4
0
文件: SlnManager.cs 项目: ue96/ue96
 public int InsertSlnItemC3(SlnItemC3Info oParam)
 {
     string sql = "select * from sln_item_c3 where slnitemsysno = " + oParam.SlnItemSysNo + " and c3sysno = " + oParam.C3SysNo;
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     if (Util.HasMoreRow(ds))
         throw new BizException("the same c3 exists already");
     return new SlnDac().Insert(oParam);
 }
示例#5
0
文件: SlnDac.cs 项目: ue96/ue96
        public int Update(SlnItemC3Info oParam)
        {
            string sql = @"UPDATE sln_item_c3 SET
                            SlnItemSysNo=@SlnItemSysNo, C3SysNo=@C3SysNo,
                            Status=@Status
                            WHERE SysNo=@SysNo";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramSlnItemSysNo = new SqlParameter("@SlnItemSysNo", SqlDbType.Int, 4);
            SqlParameter paramC3SysNo = new SqlParameter("@C3SysNo", SqlDbType.Int, 4);
            SqlParameter paramStatus = new SqlParameter("@Status", SqlDbType.Int, 4);

            if (oParam.SysNo != AppConst.IntNull)
                paramSysNo.Value = oParam.SysNo;
            else
                paramSysNo.Value = System.DBNull.Value;
            if (oParam.SlnItemSysNo != AppConst.IntNull)
                paramSlnItemSysNo.Value = oParam.SlnItemSysNo;
            else
                paramSlnItemSysNo.Value = System.DBNull.Value;
            if (oParam.C3SysNo != AppConst.IntNull)
                paramC3SysNo.Value = oParam.C3SysNo;
            else
                paramC3SysNo.Value = System.DBNull.Value;
            if (oParam.Status != AppConst.IntNull)
                paramStatus.Value = oParam.Status;
            else
                paramStatus.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramSlnItemSysNo);
            cmd.Parameters.Add(paramC3SysNo);
            cmd.Parameters.Add(paramStatus);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
示例#6
0
文件: SlnDac.cs 项目: ue96/ue96
        public int Insert(SlnItemC3Info oParam)
        {
            string sql = @"INSERT INTO sln_item_c3
                            (
                            SlnItemSysNo, C3SysNo, Status
                            )
                            VALUES (
                            @SlnItemSysNo, @C3SysNo, @Status
                            );set @SysNo = SCOPE_IDENTITY();";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramSlnItemSysNo = new SqlParameter("@SlnItemSysNo", SqlDbType.Int, 4);
            SqlParameter paramC3SysNo = new SqlParameter("@C3SysNo", SqlDbType.Int, 4);
            SqlParameter paramStatus = new SqlParameter("@Status", SqlDbType.Int, 4);
            paramSysNo.Direction = ParameterDirection.Output;
            if (oParam.SlnItemSysNo != AppConst.IntNull)
                paramSlnItemSysNo.Value = oParam.SlnItemSysNo;
            else
                paramSlnItemSysNo.Value = System.DBNull.Value;
            if (oParam.C3SysNo != AppConst.IntNull)
                paramC3SysNo.Value = oParam.C3SysNo;
            else
                paramC3SysNo.Value = System.DBNull.Value;
            if (oParam.Status != AppConst.IntNull)
                paramStatus.Value = oParam.Status;
            else
                paramStatus.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramSlnItemSysNo);
            cmd.Parameters.Add(paramC3SysNo);
            cmd.Parameters.Add(paramStatus);

            return SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo);
        }