Ejemplo n.º 1
0
 public void UpdateDeliveryManArrearageLog(DeliveryManArrearageLogInfo oParam)
 {
     new DeliveryManArrearageLogDac().Update(oParam);
 }
Ejemplo n.º 2
0
 private void map(DeliveryManArrearageLogInfo oParam, DataRow tempdr)
 {
     oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]);
     oParam.UserSysNo = Util.TrimIntNull(tempdr["UserSysNo"]);
     oParam.DSSysNo = Util.TrimIntNull(tempdr["DSSysNo"]);
     oParam.Arrearage = Util.TrimDecimalNull(tempdr["Arrearage"]);
     oParam.ArrearageLogType = Util.TrimIntNull(tempdr["ArrearageLogType"]);
     oParam.ArrearageChange = Util.TrimDecimalNull(tempdr["ArrearageChange"]);
     oParam.Memo = Util.TrimNull(tempdr["Memo"]);
     oParam.CreateTime = Util.TrimDateNull(tempdr["CreateTime"]);
     oParam.CreateUserSysNo = Util.TrimIntNull(tempdr["CreateUserSysNo"]);
 }
Ejemplo n.º 3
0
 public DeliveryManArrearageLogInfo LoadDMALog(int SysNo)
 {
     string sql = "select * from DeliveryMan_ArrearageLog where sysno=" + SysNo;
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     DeliveryManArrearageLogInfo oInfo = new DeliveryManArrearageLogInfo();
     if (Util.HasMoreRow(ds))
         map(oInfo, ds.Tables[0].Rows[0]);
     else
         oInfo = null;
     return oInfo;
 }
Ejemplo n.º 4
0
 public void InsertDeliveryManArrearageLog(DeliveryManArrearageLogInfo oParam)
 {
     new DeliveryManArrearageLogDac().Insert(oParam);
 }
Ejemplo n.º 5
0
        public int Update(DeliveryManArrearageLogInfo oParam)
        {
            string sql = @"UPDATE DeliveryMan_ArrearageLog SET
                            UserSysNo=@UserSysNo, DSSysNo=@DSSysNo,
                            Arrearage=@Arrearage, ArrearageLogType=@ArrearageLogType,
                            ArrearageChange=@ArrearageChange, Memo=@Memo,
                            CreateTime=@CreateTime, CreateUserSysNo=@CreateUserSysNo
                            WHERE SysNo=@SysNo";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramUserSysNo = new SqlParameter("@UserSysNo", SqlDbType.Int, 4);
            SqlParameter paramDSSysNo = new SqlParameter("@DSSysNo", SqlDbType.Int, 4);
            SqlParameter paramArrearage = new SqlParameter("@Arrearage", SqlDbType.Decimal, 9);
            SqlParameter paramArrearageLogType = new SqlParameter("@ArrearageLogType", SqlDbType.Int, 4);
            SqlParameter paramArrearageChange = new SqlParameter("@ArrearageChange", SqlDbType.Decimal, 9);
            SqlParameter paramMemo = new SqlParameter("@Memo", SqlDbType.NVarChar, 300);
            SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime);
            SqlParameter paramCreateUserSysNo = new SqlParameter("@CreateUserSysNo", SqlDbType.Int, 4);

            if (oParam.SysNo != AppConst.IntNull)
                paramSysNo.Value = oParam.SysNo;
            else
                paramSysNo.Value = System.DBNull.Value;
            if (oParam.UserSysNo != AppConst.IntNull)
                paramUserSysNo.Value = oParam.UserSysNo;
            else
                paramUserSysNo.Value = System.DBNull.Value;
            if (oParam.DSSysNo != AppConst.IntNull)
                paramDSSysNo.Value = oParam.DSSysNo;
            else
                paramDSSysNo.Value = System.DBNull.Value;
            if (oParam.Arrearage != AppConst.DecimalNull)
                paramArrearage.Value = oParam.Arrearage;
            else
                paramArrearage.Value = System.DBNull.Value;
            if (oParam.ArrearageLogType != AppConst.IntNull)
                paramArrearageLogType.Value = oParam.ArrearageLogType;
            else
                paramArrearageLogType.Value = System.DBNull.Value;
            if (oParam.ArrearageChange != AppConst.DecimalNull)
                paramArrearageChange.Value = oParam.ArrearageChange;
            else
                paramArrearageChange.Value = System.DBNull.Value;
            if (oParam.Memo != AppConst.StringNull)
                paramMemo.Value = oParam.Memo;
            else
                paramMemo.Value = System.DBNull.Value;
            if (oParam.CreateTime != AppConst.DateTimeNull)
                paramCreateTime.Value = oParam.CreateTime;
            else
                paramCreateTime.Value = System.DBNull.Value;
            if (oParam.CreateUserSysNo != AppConst.IntNull)
                paramCreateUserSysNo.Value = oParam.CreateUserSysNo;
            else
                paramCreateUserSysNo.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramUserSysNo);
            cmd.Parameters.Add(paramDSSysNo);
            cmd.Parameters.Add(paramArrearage);
            cmd.Parameters.Add(paramArrearageLogType);
            cmd.Parameters.Add(paramArrearageChange);
            cmd.Parameters.Add(paramMemo);
            cmd.Parameters.Add(paramCreateTime);
            cmd.Parameters.Add(paramCreateUserSysNo);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
Ejemplo n.º 6
0
        public int Insert(DeliveryManArrearageLogInfo oParam)
        {
            string sql = @"INSERT INTO DeliveryMan_ArrearageLog
                            (
                            UserSysNo, DSSysNo, Arrearage, ArrearageLogType,
                            ArrearageChange, Memo, CreateTime, CreateUserSysNo
                            )
                            VALUES (
                            @UserSysNo, @DSSysNo, @Arrearage, @ArrearageLogType,
                            @ArrearageChange, @Memo, @CreateTime, @CreateUserSysNo
                            );set @SysNo = SCOPE_IDENTITY();";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramUserSysNo = new SqlParameter("@UserSysNo", SqlDbType.Int, 4);
            SqlParameter paramDSSysNo = new SqlParameter("@DSSysNo", SqlDbType.Int, 4);
            SqlParameter paramArrearage = new SqlParameter("@Arrearage", SqlDbType.Decimal, 9);
            SqlParameter paramArrearageLogType = new SqlParameter("@ArrearageLogType", SqlDbType.Int, 4);
            SqlParameter paramArrearageChange = new SqlParameter("@ArrearageChange", SqlDbType.Decimal, 9);
            SqlParameter paramMemo = new SqlParameter("@Memo", SqlDbType.NVarChar, 300);
            SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime);
            SqlParameter paramCreateUserSysNo = new SqlParameter("@CreateUserSysNo", SqlDbType.Int, 4);
            paramSysNo.Direction = ParameterDirection.Output;
            if (oParam.UserSysNo != AppConst.IntNull)
                paramUserSysNo.Value = oParam.UserSysNo;
            else
                paramUserSysNo.Value = System.DBNull.Value;
            if (oParam.DSSysNo != AppConst.IntNull)
                paramDSSysNo.Value = oParam.DSSysNo;
            else
                paramDSSysNo.Value = System.DBNull.Value;
            if (oParam.Arrearage != AppConst.DecimalNull)
                paramArrearage.Value = oParam.Arrearage;
            else
                paramArrearage.Value = System.DBNull.Value;
            if (oParam.ArrearageLogType != AppConst.IntNull)
                paramArrearageLogType.Value = oParam.ArrearageLogType;
            else
                paramArrearageLogType.Value = System.DBNull.Value;
            if (oParam.ArrearageChange != AppConst.DecimalNull)
                paramArrearageChange.Value = oParam.ArrearageChange;
            else
                paramArrearageChange.Value = System.DBNull.Value;
            if (oParam.Memo != AppConst.StringNull)
                paramMemo.Value = oParam.Memo;
            else
                paramMemo.Value = System.DBNull.Value;
            if (oParam.CreateTime != AppConst.DateTimeNull)
                paramCreateTime.Value = oParam.CreateTime;
            else
                paramCreateTime.Value = System.DBNull.Value;
            if (oParam.CreateUserSysNo != AppConst.IntNull)
                paramCreateUserSysNo.Value = oParam.CreateUserSysNo;
            else
                paramCreateUserSysNo.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramUserSysNo);
            cmd.Parameters.Add(paramDSSysNo);
            cmd.Parameters.Add(paramArrearage);
            cmd.Parameters.Add(paramArrearageLogType);
            cmd.Parameters.Add(paramArrearageChange);
            cmd.Parameters.Add(paramMemo);
            cmd.Parameters.Add(paramCreateTime);
            cmd.Parameters.Add(paramCreateUserSysNo);

            return SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// ��˽��㵥
        /// </summary>
        /// <param name="oDSInfo"></param>
        public void AuditDS(DSInfo oDSInfo)
        {
            try
            {
                TransactionOptions options = new TransactionOptions();
                options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
                options.Timeout = TransactionManager.DefaultTimeout;

                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
                {
                    string sql = "select * from DS_Item where DSSysNo=" + oDSInfo.SysNo + " and IsPos=" + (int)AppEnum.YNStatus.Yes + " and (PosNo is null or PosDate is null)";
                    DataSet ds = SqlHelper.ExecuteDataSet(sql);
                    if (Util.HasMoreRow(ds))
                        throw new BizException("ˢ���ն˺ż�ˢ������û����д������");
                    UpdateDSMaster(oDSInfo);
                    decimal Remittance = 0;
                    decimal PosGoods = 0;
                    decimal Cheque = 0;
                    decimal PosGoodsCash = 0;
                    if (oDSInfo.Remittance != AppConst.DecimalNull)
                        Remittance = oDSInfo.Remittance;
                    if (oDSInfo.PosGoods != AppConst.DecimalNull)
                        PosGoods = oDSInfo.PosGoods;
                    if (oDSInfo.Cheque != AppConst.DecimalNull)
                        Cheque = oDSInfo.Cheque;
                    if (oDSInfo.PosGoodsCash != AppConst.DecimalNull)
                        PosGoodsCash = oDSInfo.PosGoodsCash;
                    decimal Arrearage = Remittance + PosGoods - PosGoodsCash + Cheque - oDSInfo.ARAmt;
                    if (Arrearage != 0)
                    {
                        DeliveryManArrearageLogInfo oDMArrearageLog = new DeliveryManArrearageLogInfo();
                        oDMArrearageLog.UserSysNo = oDSInfo.FreightUserSysNo;
                        oDMArrearageLog.DSSysNo = oDSInfo.SysNo;
                        oDMArrearageLog.Arrearage = Arrearage;
                        oDMArrearageLog.ArrearageChange = Arrearage;
                        oDMArrearageLog.CreateTime = DateTime.Now;
                        oDMArrearageLog.CreateUserSysNo = oDSInfo.AuditUserSysNo;
                        if (Arrearage < 0)
                            oDMArrearageLog.ArrearageLogType = (int)AppEnum.DeliveryManArrearageLogType.PayMentOfGoodsLack;
                        else if (Arrearage > 0)
                            oDMArrearageLog.ArrearageLogType = (int)AppEnum.DeliveryManArrearageLogType.PayMentofGoodsExcessive;
                        DeliveryManager.GetInstance().InsertDeliveryManArrearageLog(oDMArrearageLog);
                    }
                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }