Example #1
0
        public void AbandonDS(DSInfo dsInfo)
        {
            try
            {
                TransactionOptions options = new TransactionOptions();
                options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
                options.Timeout = TransactionManager.DefaultTimeout;

                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
                {
                    //����DS״̬
                    DSManager.GetInstance().UpdateDSMaster(dsInfo);

                    //����DL״̬
                    string sql = @"update DL_Master set Status =" + (int)AppEnum.DLStatus.StockConfirmed + " where DL_Master.sysno in (select distinct dlsysno from ds_item where dssysno=" + dsInfo.SysNo + ")";
                    SqlHelper.ExecuteNonQuery(sql);
                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                dsInfo.SysNo = AppConst.IntNull;
                throw ex;
            }
        }
Example #2
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;
            }
        }
Example #3
0
File: DSDac.cs Project: ue96/ue96
        public int Update(DSInfo oParam)
        {
            string sql = @"UPDATE DS_Master SET
                            DLSysNo=@DLSysNo, FreightUserSysNo=@FreightUserSysNo,
                            ARAmt=@ARAmt, IncomeAmt=@IncomeAmt,
                            CreateUserSysNo=@CreateUserSysNo, CreateTime=@CreateTime,
                            SettlementUserSysNo=@SettlementUserSysNo, SettlementTime=@SettlementTime,
                            VoucherUserSysNo=@VoucherUserSysNo, VoucherID=@VoucherID,
                            VoucherTime=@VoucherTime, AbandonUserSysNo=@AbandonUserSysNo,
                            AbandonTime=@AbandonTime, Status=@Status,
                            AuditUserSysNo=@AuditUserSysNo, AuditTime=@AuditTime,
                            PosFee=@PosFee, Cheque=@Cheque,
                            Cash=@Cash, PosGoods=@PosGoods,
                            Remittance=@Remittance, RemittanceDate=@RemittanceDate,
                            Memo=@Memo, RemittanceType=@RemittanceType,
                            IsReceiveVoucher=@IsReceiveVoucher, PosGoodsCash=@PosGoodsCash,
                            AccAuditUserSysNo=@AccAuditUserSysNo, AccAuditTime=@AccAuditTime
                            WHERE SysNo=@SysNo";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
            SqlParameter paramDLSysNo = new SqlParameter("@DLSysNo", SqlDbType.Int, 4);
            SqlParameter paramFreightUserSysNo = new SqlParameter("@FreightUserSysNo", SqlDbType.Int, 4);
            SqlParameter paramARAmt = new SqlParameter("@ARAmt", SqlDbType.Decimal, 9);
            SqlParameter paramIncomeAmt = new SqlParameter("@IncomeAmt", SqlDbType.Decimal, 9);
            SqlParameter paramCreateUserSysNo = new SqlParameter("@CreateUserSysNo", SqlDbType.Int, 4);
            SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime);
            SqlParameter paramSettlementUserSysNo = new SqlParameter("@SettlementUserSysNo", SqlDbType.Int, 4);
            SqlParameter paramSettlementTime = new SqlParameter("@SettlementTime", SqlDbType.DateTime);
            SqlParameter paramVoucherUserSysNo = new SqlParameter("@VoucherUserSysNo", SqlDbType.Int, 4);
            SqlParameter paramVoucherID = new SqlParameter("@VoucherID", SqlDbType.NVarChar, 50);
            SqlParameter paramVoucherTime = new SqlParameter("@VoucherTime", SqlDbType.DateTime);
            SqlParameter paramAbandonUserSysNo = new SqlParameter("@AbandonUserSysNo", SqlDbType.Int, 4);
            SqlParameter paramAbandonTime = new SqlParameter("@AbandonTime", SqlDbType.DateTime);
            SqlParameter paramStatus = new SqlParameter("@Status", SqlDbType.Int, 4);
            SqlParameter paramAuditUserSysNo = new SqlParameter("@AuditUserSysNo", SqlDbType.Int, 4);
            SqlParameter paramAuditTime = new SqlParameter("@AuditTime", SqlDbType.DateTime);
            SqlParameter paramPosFee = new SqlParameter("@PosFee", SqlDbType.Decimal, 9);
            SqlParameter paramCheque = new SqlParameter("@Cheque", SqlDbType.Decimal, 9);
            SqlParameter paramCash = new SqlParameter("@Cash", SqlDbType.Decimal, 9);
            SqlParameter paramPosGoods = new SqlParameter("@PosGoods", SqlDbType.Decimal, 9);
            SqlParameter paramRemittance = new SqlParameter("@Remittance", SqlDbType.Decimal, 9);
            SqlParameter paramRemittanceDate = new SqlParameter("@RemittanceDate", SqlDbType.DateTime);
            SqlParameter paramMemo = new SqlParameter("@Memo", SqlDbType.NVarChar, 500);
            SqlParameter paramRemittanceType = new SqlParameter("@RemittanceType", SqlDbType.Int, 4);
            SqlParameter paramIsReceiveVoucher = new SqlParameter("@IsReceiveVoucher", SqlDbType.Int, 4);
            SqlParameter paramPosGoodsCash = new SqlParameter("@PosGoodsCash", SqlDbType.Decimal, 9);
            SqlParameter paramAccAuditUserSysNo = new SqlParameter("@AccAuditUserSysNo", SqlDbType.Int, 4);
            SqlParameter paramAccAuditTime = new SqlParameter("@AccAuditTime", SqlDbType.DateTime);

            if (oParam.SysNo != AppConst.IntNull)
                paramSysNo.Value = oParam.SysNo;
            else
                paramSysNo.Value = System.DBNull.Value;
            if (oParam.DLSysNo != AppConst.IntNull)
                paramDLSysNo.Value = oParam.DLSysNo;
            else
                paramDLSysNo.Value = System.DBNull.Value;
            if (oParam.FreightUserSysNo != AppConst.IntNull)
                paramFreightUserSysNo.Value = oParam.FreightUserSysNo;
            else
                paramFreightUserSysNo.Value = System.DBNull.Value;
            if (oParam.ARAmt != AppConst.DecimalNull)
                paramARAmt.Value = oParam.ARAmt;
            else
                paramARAmt.Value = System.DBNull.Value;
            if (oParam.IncomeAmt != AppConst.DecimalNull)
                paramIncomeAmt.Value = oParam.IncomeAmt;
            else
                paramIncomeAmt.Value = System.DBNull.Value;
            if (oParam.CreateUserSysNo != AppConst.IntNull)
                paramCreateUserSysNo.Value = oParam.CreateUserSysNo;
            else
                paramCreateUserSysNo.Value = System.DBNull.Value;
            if (oParam.CreateTime != AppConst.DateTimeNull)
                paramCreateTime.Value = oParam.CreateTime;
            else
                paramCreateTime.Value = System.DBNull.Value;
            if (oParam.SettlementUserSysNo != AppConst.IntNull)
                paramSettlementUserSysNo.Value = oParam.SettlementUserSysNo;
            else
                paramSettlementUserSysNo.Value = System.DBNull.Value;
            if (oParam.SettlementTime != AppConst.DateTimeNull)
                paramSettlementTime.Value = oParam.SettlementTime;
            else
                paramSettlementTime.Value = System.DBNull.Value;
            if (oParam.VoucherUserSysNo != AppConst.IntNull)
                paramVoucherUserSysNo.Value = oParam.VoucherUserSysNo;
            else
                paramVoucherUserSysNo.Value = System.DBNull.Value;
            if (oParam.VoucherID != AppConst.StringNull)
                paramVoucherID.Value = oParam.VoucherID;
            else
                paramVoucherID.Value = System.DBNull.Value;
            if (oParam.VoucherTime != AppConst.DateTimeNull)
                paramVoucherTime.Value = oParam.VoucherTime;
            else
                paramVoucherTime.Value = System.DBNull.Value;
            if (oParam.AbandonUserSysNo != AppConst.IntNull)
                paramAbandonUserSysNo.Value = oParam.AbandonUserSysNo;
            else
                paramAbandonUserSysNo.Value = System.DBNull.Value;
            if (oParam.AbandonTime != AppConst.DateTimeNull)
                paramAbandonTime.Value = oParam.AbandonTime;
            else
                paramAbandonTime.Value = System.DBNull.Value;
            if (oParam.Status != AppConst.IntNull)
                paramStatus.Value = oParam.Status;
            else
                paramStatus.Value = System.DBNull.Value;
            if (oParam.AuditUserSysNo != AppConst.IntNull)
                paramAuditUserSysNo.Value = oParam.AuditUserSysNo;
            else
                paramAuditUserSysNo.Value = System.DBNull.Value;
            if (oParam.AuditTime != AppConst.DateTimeNull)
                paramAuditTime.Value = oParam.AuditTime;
            else
                paramAuditTime.Value = System.DBNull.Value;
            if (oParam.PosFee != AppConst.DecimalNull)
                paramPosFee.Value = oParam.PosFee;
            else
                paramPosFee.Value = System.DBNull.Value;
            if (oParam.Cheque != AppConst.DecimalNull)
                paramCheque.Value = oParam.Cheque;
            else
                paramCheque.Value = System.DBNull.Value;
            if (oParam.Cash != AppConst.DecimalNull)
                paramCash.Value = oParam.Cash;
            else
                paramCash.Value = System.DBNull.Value;
            if (oParam.PosGoods != AppConst.DecimalNull)
                paramPosGoods.Value = oParam.PosGoods;
            else
                paramPosGoods.Value = System.DBNull.Value;
            if (oParam.Remittance != AppConst.DecimalNull)
                paramRemittance.Value = oParam.Remittance;
            else
                paramRemittance.Value = System.DBNull.Value;
            if (oParam.RemittanceDate != AppConst.DateTimeNull)
                paramRemittanceDate.Value = oParam.RemittanceDate;
            else
                paramRemittanceDate.Value = System.DBNull.Value;
            if (oParam.Memo != AppConst.StringNull)
                paramMemo.Value = oParam.Memo;
            else
                paramMemo.Value = System.DBNull.Value;
            if (oParam.RemittanceType != AppConst.IntNull)
                paramRemittanceType.Value = oParam.RemittanceType;
            else
                paramRemittanceType.Value = System.DBNull.Value;
            if (oParam.IsReceiveVoucher != AppConst.IntNull)
                paramIsReceiveVoucher.Value = oParam.IsReceiveVoucher;
            else
                paramIsReceiveVoucher.Value = System.DBNull.Value;
            if (oParam.PosGoodsCash != AppConst.DecimalNull)
                paramPosGoodsCash.Value = oParam.PosGoodsCash;
            else
                paramPosGoodsCash.Value = System.DBNull.Value;
            if (oParam.AccAuditUserSysNo != AppConst.IntNull)
                paramAccAuditUserSysNo.Value = oParam.AccAuditUserSysNo;
            else
                paramAccAuditUserSysNo.Value = System.DBNull.Value;
            if (oParam.AccAuditTime != AppConst.DateTimeNull)
                paramAccAuditTime.Value = oParam.AccAuditTime;
            else
                paramAccAuditTime.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramDLSysNo);
            cmd.Parameters.Add(paramFreightUserSysNo);
            cmd.Parameters.Add(paramARAmt);
            cmd.Parameters.Add(paramIncomeAmt);
            cmd.Parameters.Add(paramCreateUserSysNo);
            cmd.Parameters.Add(paramCreateTime);
            cmd.Parameters.Add(paramSettlementUserSysNo);
            cmd.Parameters.Add(paramSettlementTime);
            cmd.Parameters.Add(paramVoucherUserSysNo);
            cmd.Parameters.Add(paramVoucherID);
            cmd.Parameters.Add(paramVoucherTime);
            cmd.Parameters.Add(paramAbandonUserSysNo);
            cmd.Parameters.Add(paramAbandonTime);
            cmd.Parameters.Add(paramStatus);
            cmd.Parameters.Add(paramAuditUserSysNo);
            cmd.Parameters.Add(paramAuditTime);
            cmd.Parameters.Add(paramPosFee);
            cmd.Parameters.Add(paramCheque);
            cmd.Parameters.Add(paramCash);
            cmd.Parameters.Add(paramPosGoods);
            cmd.Parameters.Add(paramRemittance);
            cmd.Parameters.Add(paramRemittanceDate);
            cmd.Parameters.Add(paramMemo);
            cmd.Parameters.Add(paramRemittanceType);
            cmd.Parameters.Add(paramIsReceiveVoucher);
            cmd.Parameters.Add(paramPosGoodsCash);
            cmd.Parameters.Add(paramAccAuditUserSysNo);
            cmd.Parameters.Add(paramAccAuditTime);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
Example #4
0
        public void CreateDS(DSInfo dsInfo)
        {
            try
            {
                TransactionOptions options = new TransactionOptions();
                options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
                options.Timeout = TransactionManager.DefaultTimeout;

                using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
                {
                    dsInfo.Status = (int)AppEnum.DSStatus.Origin;
                    dsInfo.CreateTime = DateTime.Now;

                    //�������ͽ��㵥����
                    this.InsertDSMaster(dsInfo);

                    //�������ͽ��㵥��ϸ
                    decimal ARAmt = 0; //Ӧ�տ�ϼ�

                    foreach (DSItemInfo item in dsInfo.ItemHash.Values)
                    {
                        item.DSSysNo = dsInfo.SysNo;
                        item.Status = (int)AppEnum.BiStatus.Valid;
                        this.InsertDSItem(item);

                        if (item.PayType == 1) //��������
                        {
                            ARAmt += item.PayAmt;
                        }
                    }

                    dsInfo.ARAmt = ARAmt;

                    UpdateDSMaster(dsInfo);
                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                dsInfo.SysNo = AppConst.IntNull;
                throw ex;
            }
        }
Example #5
0
        public void CreateDS(string dlsysnolist, int usersysno, 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))
                {
                    decimal ARAmt = 0;
                    decimal IncomeAmt = 0;
                    int FreightUser = 0;
                    oDSInfo.ItemHash.Clear();
                    string NullFreightItem = "";
                    string[] DLSysNoList = dlsysnolist.Split(',');
                    int i = 0;

                    for (i = 0; i < DLSysNoList.Length; i++)
                    {
                        int DLSysNo = Int32.Parse(DLSysNoList[i]);
                        DLInfo oDLInfo = DLManager.GetInstance().Load(DLSysNo);
                        if (oDLInfo == null)
                        {
                            throw new BizException(DLSysNo + "��Ӧ�����͵�������");
                        }
                        else if (oDLInfo.Status != (int)AppEnum.DLStatus.StockConfirmed)
                        {

                            throw new BizException(DLSysNo + "���͵�����ȷ�Ϸ���״̬���������ɽ��㵥");
                        }
                        else if (oDLInfo.Status == (int)AppEnum.DLStatus.DSConfirmed)
                        {
                            throw new BizException(DLSysNo + "�˵������ɽ��㵥�������ظ�����");
                        }

                        FreightUser = oDLInfo.FreightUserSysNo;
                        foreach (DLItemInfo oItem in oDLInfo.ItemHash.Values)
                        {
                            if (oItem.Status == (int)AppEnum.BiStatus.Valid)
                            {
                                if (oItem.ItemType == (int)AppEnum.DLItemType.SaleOrder)
                                {
                                    int sosysno = Convert.ToInt32(oItem.ItemID.Substring(1));
                                    SOInfo oSOInfo = SaleManager.GetInstance().LoadSOMaster(sosysno);
                                    if (oSOInfo.FreightUserSysNo == AppConst.IntNull)
                                    {
                                        NullFreightItem += oSOInfo.SOID + ",";

                                    }
                                    else if (NullFreightItem == "" && oSOInfo.FreightUserSysNo == oDLInfo.FreightUserSysNo && oSOInfo.DLSysNo == oDLInfo.SysNo)
                                    {
                                        if (oSOInfo.Status == (int)AppEnum.SOStatus.OutStock)
                                        {
                                            DSItemInfo oDSItem = new DSItemInfo();
                                            oDSItem.ItemID = oItem.ItemID;
                                            oDSItem.ItemType = oItem.ItemType;
                                            oDSItem.PayType = oItem.PayType;
                                            oDSItem.DLSysNo = oItem.DLSysNo;

                                            if (oSOInfo.PayTypeSysNo == 1) //��������ȥ��ͷ
                                            {
                                                oDSItem.PayAmt = Util.TruncMoney(oSOInfo.GetTotalAmt());
                                                IncomeAmt += oDSItem.PayAmt;
                                            }
                                            else
                                            {
                                                oDSItem.PayAmt = 0;
                                                IncomeAmt += oItem.PayAmt;
                                            }
                                            oDSInfo.ItemHash.Add(oDSItem, oDSItem);
                                            ARAmt += oDSItem.PayAmt;

                                        }
                                        else if (oSOInfo.Status == (int)AppEnum.SOStatus.PartlyReturn)
                                        {
                                            DSItemInfo oDSItem = new DSItemInfo();
                                            oDSItem.ItemID = oItem.ItemID;
                                            oDSItem.ItemType = oItem.ItemType;
                                            oDSItem.PayType = oItem.PayType;
                                            oDSItem.DLSysNo = oItem.DLSysNo;

                                            decimal returnAmt = 0;
                                            SOInfo oSOInfo2 = SaleManager.GetInstance().LoadSO(oSOInfo.SysNo);
                                            foreach (SOItemInfo oSOItem in oSOInfo2.ItemHash.Values)
                                            {
                                                if (oSOItem.ReturnQty != AppConst.IntNull)
                                                {
                                                    returnAmt += oSOItem.ReturnQty * oSOItem.Price;
                                                }
                                            }
                                            if (oSOInfo.PayTypeSysNo == 1) //��������ȥ��ͷ
                                            {
                                                oDSItem.PayAmt = Util.TruncMoney(oSOInfo.GetTotalAmt() - returnAmt);
                                                IncomeAmt += Util.TruncMoney(oSOInfo.GetTotalAmt() - returnAmt);

                                            }
                                            else
                                            {
                                                oDSItem.PayAmt = 0;
                                                IncomeAmt += oItem.PayAmt;

                                            }
                                            oDSInfo.ItemHash.Add(oDSItem, oDSItem);
                                            ARAmt += oDSItem.PayAmt;
                                        }
                                    }
                                }
                                else if (oItem.ItemType == (int)AppEnum.DLItemType.RMARequest)
                                {
                                    int FreightUserSysNo = RMARequestManager.GetInstance().GetFreightUserSysNofromID(oItem.ItemID);
                                    int RequestDLSysNo = RMARequestManager.GetInstance().GetDLSysNofromID(oItem.ItemID);

                                    if (FreightUserSysNo == AppConst.IntNull)
                                    {
                                        NullFreightItem += oItem.ItemID + ",";

                                    }
                                    else if (NullFreightItem == "" && FreightUserSysNo == oDLInfo.FreightUserSysNo && RequestDLSysNo == oDLInfo.SysNo)
                                    {
                                        DSItemInfo oDSItem = new DSItemInfo();
                                        oDSItem.ItemID = oItem.ItemID;
                                        oDSItem.ItemType = oItem.ItemType;
                                        oDSItem.PayType = oItem.PayType;
                                        oDSItem.PayAmt = oItem.PayAmt;
                                        oDSItem.DLSysNo = oItem.DLSysNo;

                                        oDSInfo.ItemHash.Add(oDSItem, oDSItem);
                                        ARAmt += oItem.PayAmt;
                                        IncomeAmt += oItem.PayAmt;

                                    }
                                }
                                else if (oItem.ItemType == (int)AppEnum.DLItemType.RMAOutbound)
                                {
                                    int FreightUserSysNo = RMAOutBoundManager.GetInstance().GetFreightUserSysNoByID(oItem.ItemID);
                                    int OutboundDLSysNo = RMAOutBoundManager.GetInstance().GetDLSysNoSysNoByID(oItem.ItemID);

                                    if (FreightUserSysNo == AppConst.IntNull)
                                    {
                                        NullFreightItem += oItem.ItemID + ",";
                                    }
                                    else if (NullFreightItem == "" && FreightUserSysNo == oDLInfo.FreightUserSysNo && OutboundDLSysNo == oDLInfo.SysNo)
                                    {
                                        DSItemInfo oDSItem = new DSItemInfo();
                                        oDSItem.ItemID = oItem.ItemID;
                                        oDSItem.ItemType = oItem.ItemType;
                                        oDSItem.PayType = oItem.PayType;
                                        oDSItem.DLSysNo = oItem.DLSysNo;

                                        oDSItem.PayAmt = 0;
                                        oDSInfo.ItemHash.Add(oDSItem, oDSItem);
                                        ARAmt += 0;
                                        IncomeAmt += 0;

                                    }
                                }
                                else if (oItem.ItemType == (int)AppEnum.DLItemType.RMARevert)
                                {
                                    int FreightUserSysNo = RMARevertManager.GetInstance().GetFreightUserSysNofromID(oItem.ItemID);
                                    int RevertDLSysNo = RMARevertManager.GetInstance().GetDLSysNofromID(oItem.ItemID);

                                    if (FreightUserSysNo == AppConst.IntNull)
                                    {
                                        NullFreightItem += oItem.ItemID + ",";
                                    }

                                    else if (NullFreightItem == "" && FreightUserSysNo == oDLInfo.FreightUserSysNo && RevertDLSysNo == oDLInfo.SysNo)
                                    {
                                        DSItemInfo oDSItem = new DSItemInfo();
                                        oDSItem.ItemID = oItem.ItemID;
                                        oDSItem.ItemType = oItem.ItemType;
                                        oDSItem.PayType = oItem.PayType;
                                        oDSItem.DLSysNo = oItem.DLSysNo;

                                        oDSItem.PayAmt = 0;
                                        oDSInfo.ItemHash.Add(oDSItem, oDSItem);
                                        ARAmt += 0;
                                        IncomeAmt += 0;
                                    }

                                }
                                else if (oItem.ItemType == (int)AppEnum.DLItemType.RMASendAccessory)
                                {
                                    int FreightUserSysNo = RMASendAccessoryManager.GetInstance().GetFreightUserSysNoByID(oItem.ItemID);
                                    int SendAccessoryDLSysNo = RMASendAccessoryManager.GetInstance().GetDLSysNoByID(oItem.ItemID);

                                    if (FreightUserSysNo == AppConst.IntNull)
                                    {
                                        NullFreightItem += oItem.ItemID + ",";
                                    }
                                    else if (NullFreightItem == "" && FreightUserSysNo == oDLInfo.FreightUserSysNo && SendAccessoryDLSysNo == oDLInfo.SysNo)
                                    {
                                        DSItemInfo oDSItem = new DSItemInfo();
                                        oDSItem.ItemID = oItem.ItemID;
                                        oDSItem.ItemType = oItem.ItemType;
                                        oDSItem.PayType = oItem.PayType;
                                        oDSItem.DLSysNo = oItem.DLSysNo;
                                        oDSItem.PayAmt = 0;
                                        oDSInfo.ItemHash.Add(oDSItem, oDSItem);
                                        ARAmt += 0;
                                        IncomeAmt += 0;
                                    }
                                }

                                else if (oItem.ItemType == (int)AppEnum.DLItemType.StShift)
                                {
                                    ShiftInfo oInfo = ShiftManager.GetInstance().Load(Int32.Parse(oItem.ItemID.Substring(2)));
                                    int FreightUserSysNo = oInfo.FreightUserSysNo;
                                    int stShiftDLSysNo = oInfo.DLSysNo;
                                    if (FreightUserSysNo == AppConst.IntNull)
                                    {
                                        NullFreightItem += oItem.ItemID + ",";
                                    }

                                    else if (NullFreightItem == "" && FreightUserSysNo == oDLInfo.FreightUserSysNo && stShiftDLSysNo == oDLInfo.SysNo)
                                    {
                                        DSItemInfo oDSItem = new DSItemInfo();
                                        oDSItem.ItemID = oItem.ItemID;
                                        oDSItem.ItemType = oItem.ItemType;
                                        oDSItem.PayType = oItem.PayType;
                                        oDSItem.DLSysNo = oItem.DLSysNo;
                                        oDSItem.PayAmt = 0;
                                        oDSInfo.ItemHash.Add(oDSItem, oDSItem);
                                        ARAmt += 0;
                                        IncomeAmt += 0;
                                    }
                                }

                            }

                        }
                        oDLInfo.Status = (int)AppEnum.DLStatus.DSConfirmed;
                        DLManager.GetInstance().UpdateDLMaster(oDLInfo);

                    }
                    if (NullFreightItem != "")
                    {
                        throw new BizException(NullFreightItem + "û�������ˣ����������ã�");
                    }

                    if (oDSInfo.ItemHash.Count <= 0)
                    {
                        throw new BizException("���͵���û�����ͳɹ��ĵ���");
                    }
                    oDSInfo.CreateTime = DateTime.Now;
                    oDSInfo.CreateUserSysNo = usersysno;
                    oDSInfo.FreightUserSysNo = FreightUser;
                    oDSInfo.ARAmt = ARAmt;
                    oDSInfo.IncomeAmt = IncomeAmt;
                    DSManager.GetInstance().CreateDS(oDSInfo);
                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #6
0
        /// <summary>
        ///ȡ����˽��㵥
        /// </summary>
        /// <param name="oDSInfo"></param>
        public void CancelAuditDS(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 = "delete DeliveryMan_ArrearageLog where DSSysNo=" + oDSInfo.SysNo;
                    SqlHelper.ExecuteNonQuery(sql);

                    UpdateDSMaster(oDSInfo);
                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #7
0
 private void map(DSInfo oParam, DataRow tempdr)
 {
     oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]);
     oParam.DLSysNo = Util.TrimIntNull(tempdr["DLSysNo"]);
     oParam.FreightUserSysNo = Util.TrimIntNull(tempdr["FreightUserSysNo"]);
     oParam.ARAmt = Util.TrimDecimalNull(tempdr["ARAmt"]);
     oParam.IncomeAmt = Util.TrimDecimalNull(tempdr["IncomeAmt"]);
     oParam.CreateUserSysNo = Util.TrimIntNull(tempdr["CreateUserSysNo"]);
     oParam.CreateTime = Util.TrimDateNull(tempdr["CreateTime"]);
     oParam.SettlementUserSysNo = Util.TrimIntNull(tempdr["SettlementUserSysNo"]);
     oParam.SettlementTime = Util.TrimDateNull(tempdr["SettlementTime"]);
     oParam.VoucherUserSysNo = Util.TrimIntNull(tempdr["VoucherUserSysNo"]);
     oParam.VoucherID = Util.TrimNull(tempdr["VoucherID"]);
     oParam.VoucherTime = Util.TrimDateNull(tempdr["VoucherTime"]);
     oParam.AbandonUserSysNo = Util.TrimIntNull(tempdr["AbandonUserSysNo"]);
     oParam.AbandonTime = Util.TrimDateNull(tempdr["AbandonTime"]);
     oParam.Status = Util.TrimIntNull(tempdr["Status"]);
     oParam.AuditUserSysNo = Util.TrimIntNull(tempdr["AuditUserSysNo"]);
     oParam.AuditTime = Util.TrimDateNull(tempdr["AuditTime"]);
     oParam.PosFee = Util.TrimDecimalNull(tempdr["PosFee"]);
     oParam.Cheque = Util.TrimDecimalNull(tempdr["Cheque"]);
     oParam.Cash = Util.TrimDecimalNull(tempdr["Cash"]);
     oParam.PosGoods = Util.TrimDecimalNull(tempdr["PosGoods"]);
     oParam.Remittance = Util.TrimDecimalNull(tempdr["Remittance"]);
     oParam.RemittanceDate = Util.TrimDateNull(tempdr["RemittanceDate"]);
     oParam.Memo = Util.TrimNull(tempdr["Memo"]);
     oParam.RemittanceType = Util.TrimIntNull(tempdr["RemittanceType"]);
     oParam.IsReceiveVoucher = Util.TrimIntNull(tempdr["IsReceiveVoucher"]);
     oParam.PosGoodsCash = Util.TrimDecimalNull(tempdr["PosGoodsCash"]);
     oParam.AccAuditUserSysNo = Util.TrimIntNull(tempdr["AccAuditUserSysNo"]);
     oParam.AccAuditTime = Util.TrimDateNull(tempdr["AccAuditTime"]);
 }
Example #8
0
        private void InsertDSMaster(DSInfo oParam)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                oParam.SysNo = SequenceDac.GetInstance().Create("DS_Sequence");
                new DSDac().Insert(oParam);
                scope.Complete();
            }
        }
Example #9
0
        public void UpdateDSMaster(DSInfo oParam)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                new DSDac().Update(oParam);
                scope.Complete();
            }
        }
Example #10
0
 public DSInfo LoadMaster(int sysno)
 {
     string sql = "select * from DS_Master where sysno =" + sysno;
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     DSInfo oInfo = new DSInfo();
     if (Util.HasMoreRow(ds))
     {
         map(oInfo, ds.Tables[0].Rows[0]);
         return oInfo;
     }
     else
         return null;
 }