Пример #1
0
        /// <summary>
        /// </summary>
        public int UpdateOverWork(OverWork overWork)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_PKID, SqlDbType.Int).Value                  = overWork.PKID;
            cmd.Parameters.Add(_AccountID, SqlDbType.Int).Value             = overWork.Account.Id;
            cmd.Parameters.Add(_SubmitDate, SqlDbType.DateTime).Value       = overWork.SubmitDate;
            cmd.Parameters.Add(_From, SqlDbType.DateTime).Value             = overWork.FromDate;
            cmd.Parameters.Add(_To, SqlDbType.DateTime).Value               = overWork.ToDate;
            cmd.Parameters.Add(_CostTime, SqlDbType.Decimal).Value          = overWork.CostTime;
            cmd.Parameters.Add(_Reason, SqlDbType.Text).Value               = overWork.Reason;
            cmd.Parameters.Add(_ProjectName, SqlDbType.NVarChar, 250).Value = overWork.ProjectName;
            cmd.Parameters.Add(_DiyProcess, SqlDbType.Text).Value           =
                RequestUtility.DiyProcessToString(overWork.DiyProcess);
            return(SqlHelper.ExecuteNonQuery("OverWorkUpdate", cmd));
        }
Пример #2
0
        /// <summary>
        /// </summary>
        public int UpdateOutApplication(OutApplication outapplication)
        {
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_PKID, SqlDbType.Int).Value                  = outapplication.PKID;
            cmd.Parameters.Add(_AccountID, SqlDbType.Int).Value             = outapplication.Account.Id;
            cmd.Parameters.Add(_SubmitDate, SqlDbType.DateTime).Value       = outapplication.SubmitDate;
            cmd.Parameters.Add(_From, SqlDbType.DateTime).Value             = outapplication.FromDate;
            cmd.Parameters.Add(_To, SqlDbType.DateTime).Value               = outapplication.ToDate;
            cmd.Parameters.Add(_CostTime, SqlDbType.Decimal).Value          = outapplication.CostTime;
            cmd.Parameters.Add(_Reason, SqlDbType.Text).Value               = outapplication.Reason;
            cmd.Parameters.Add(_OutLocation, SqlDbType.NVarChar, 250).Value = outapplication.OutLocation;
            cmd.Parameters.Add(_OutType, SqlDbType.Int).Value               = outapplication.OutType.ID;
            cmd.Parameters.Add(_DiyProcess, SqlDbType.Text).Value           =
                RequestUtility.DiyProcessToString(outapplication.DiyProcess);
            return(SqlHelper.ExecuteNonQuery("OutApplicationUpdate", cmd));
        }
Пример #3
0
        /// <summary>
        /// </summary>
        public int InsertOverWork(OverWork overWork)
        {
            int        pkid;
            SqlCommand cmd = new SqlCommand();

            cmd.Parameters.Add(_PKID, SqlDbType.Int).Direction              = ParameterDirection.Output;
            cmd.Parameters.Add(_AccountID, SqlDbType.Int).Value             = overWork.Account.Id;
            cmd.Parameters.Add(_SubmitDate, SqlDbType.DateTime).Value       = overWork.SubmitDate;
            cmd.Parameters.Add(_From, SqlDbType.DateTime).Value             = overWork.FromDate;
            cmd.Parameters.Add(_To, SqlDbType.DateTime).Value               = overWork.ToDate;
            cmd.Parameters.Add(_CostTime, SqlDbType.Decimal).Value          = overWork.CostTime;
            cmd.Parameters.Add(_Reason, SqlDbType.Text).Value               = overWork.Reason;
            cmd.Parameters.Add(_ProjectName, SqlDbType.NVarChar, 250).Value = overWork.ProjectName;
            cmd.Parameters.Add(_DiyProcess, SqlDbType.Text).Value           =
                RequestUtility.DiyProcessToString(overWork.DiyProcess);
            SqlHelper.ExecuteNonQueryReturnPKID("OverWorkInsert", cmd, out pkid);
            return(pkid);
        }