Exemplo n.º 1
0
        public int AddItem(RMARevertInfo oParam)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                foreach (int registerSysNo in oParam.ItemHash.Keys)
                {
                    RMARevertItemInfo oRevertItem = new RMARevertItemInfo();
                    oRevertItem.RegisterSysNo = registerSysNo;
                    oRevertItem.RevertSysNo = oParam.SysNo;
                    //��Register�ֿ��д��RMA_Revert_Item
                    int revertStockSysNo = AppConst.IntNull;
                    DataRow regdr = RMARegisterManager.GetInstance().GetRegisterRow(registerSysNo);
                    revertStockSysNo = Util.TrimIntNull(regdr["RevertStockSysNo"]);

                    oRevertItem.StockSysNo = Util.TrimIntNull(revertStockSysNo);

                    this.InsertRevertItem(oRevertItem);
                }

                scope.Complete();
                return oParam.SysNo;
            }
        }
Exemplo n.º 2
0
 public RMARevertInfo Load(int sysno)
 {
     RMARevertInfo oRevert = new RMARevertInfo();
     string sql = "select * from RMA_Revert (NOLOCK) where sysno = " + sysno;
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     if (Util.HasMoreRow(ds))
     {
         MapRevert(oRevert, ds.Tables[0].Rows[0]);
     }
     return oRevert;
 }
Exemplo n.º 3
0
 public void InsertRevert(RMARevertInfo oInfo)
 {
     new RMARevertDac().InsertRevert(oInfo);
 }
Exemplo n.º 4
0
 public RMARevertInfo GetOutBoundRevert(int sysno)
 {
     RMARevertInfo orderRevert = new RMARevertInfo();
     string sql = "select * from RMA_Revert (NOLOCK) where status = " + (int)AppEnum.RMARevertStatus.Reverted + " and sysno=" + sysno + "";
     DataSet ds = SqlHelper.ExecuteDataSet(sql);
     if (Util.HasMoreRow(ds))
     {
         MapRevert(orderRevert, ds.Tables[0].Rows[0]);
     }
     return orderRevert;
 }
Exemplo n.º 5
0
 private void MapRevert(RMARevertInfo oInfo, DataRow dr)
 {
     oInfo.Address = dr["Address"].ToString();
     oInfo.Contact = dr["Contact"].ToString();
     oInfo.CreateTime = Util.TrimDateNull(dr["CreateTime"]);
     oInfo.CreateUserSysNo = Util.TrimIntNull(dr["CreateUserSysNo"]);
     oInfo.CustomerSysNo = Util.TrimIntNull(dr["CustomerSysNo"]);
     oInfo.Note = dr["Note"].ToString();
     oInfo.OutTime = Util.TrimDateNull(dr["OutTime"]);
     oInfo.OutUserSysNo = Util.TrimIntNull(dr["OutUserSysNo"]);
     oInfo.Phone = dr["Phone"].ToString();
     oInfo.RevertID = dr["RevertID"].ToString();
     oInfo.ShipType = Util.TrimIntNull(dr["ShipType"]);
     oInfo.Status = Util.TrimIntNull(dr["Status"]);
     oInfo.SysNo = Util.TrimIntNull(dr["SysNo"]);
     oInfo.ZIP = dr["ZIP"].ToString();
     oInfo.SOSysNo = Util.TrimIntNull(dr["SOSysNo"]);
     oInfo.LocationStatus = Util.TrimIntNull(dr["LocationStatus"]);
     oInfo.AddressAreaSysNo = Util.TrimIntNull(dr["AddressAreaSysNo"]);
     oInfo.PackageID = dr["PackageID"].ToString();
     oInfo.FreightUserSysNo = Util.TrimIntNull(dr["FreightUserSysNo"]);
     oInfo.SetDeliveryManTime = Util.TrimDateNull(dr["SetDeliveryManTime"]);
     oInfo.CheckQtyUserSysNo = Util.TrimIntNull(dr["CheckQtyUserSysNo"]);
     oInfo.CheckQtyTime = Util.TrimDateNull(dr["CheckQtyTime"]);
     oInfo.IsPrintPackageCover = Util.TrimIntNull(dr["IsPrintPackageCover"]);
     oInfo.IsConfirmAddress = Util.TrimIntNull(dr["IsConfirmAddress"]);
 }
Exemplo n.º 6
0
        public int InsertRevert(RMARevertInfo oParam)
        {
            string sql = @"INSERT INTO RMA_Revert
                            (
                            SysNo, RevertID, CustomerSysNo, CreateTime,
                            CreateUserSysNo, ZIP, Address, Contact,
                            Phone, ShipType, OutTime, OutUserSysNo,
                            Note, Status ,SOSysNo ,LocationStatus,AddressAreaSysNo,PackageID,FreightUserSysNo, SetDeliveryManTime,CheckQtyUserSysNo,
                            CheckQtyTime,IsPrintPackageCover,IsConfirmAddress
                            )
                            VALUES (
                            @SysNo, @RevertID, @CustomerSysNo, @CreateTime,
                            @CreateUserSysNo, @ZIP, @Address, @Contact,
                            @Phone, @ShipType, @OutTime, @OutUserSysNo,
                            @Note, @Status ,@SOSysNo , @LocationStatus ,@AddressAreaSysNo,@PackageID ,@FreightUserSysNo, @SetDeliveryManTime,@CheckQtyUserSysNo,
                            @CheckQtyTime, @IsPrintPackageCover, @IsConfirmAddress
                            )";

            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int,4);
            SqlParameter paramRevertID = new SqlParameter("@RevertID", SqlDbType.NVarChar,10);
            SqlParameter paramCustomerSysNo = new SqlParameter("@CustomerSysNo", SqlDbType.Int,4);
            SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime);
            SqlParameter paramCreateUserSysNo = new SqlParameter("@CreateUserSysNo", SqlDbType.Int,4);
            SqlParameter paramZIP = new SqlParameter("@ZIP", SqlDbType.NVarChar,10);
            SqlParameter paramAddress = new SqlParameter("@Address", SqlDbType.NVarChar,200);
            SqlParameter paramContact = new SqlParameter("@Contact", SqlDbType.NVarChar,50);
            SqlParameter paramPhone = new SqlParameter("@Phone", SqlDbType.NVarChar,50);
            SqlParameter paramShipType = new SqlParameter("@ShipType", SqlDbType.Int,4);
            SqlParameter paramOutTime = new SqlParameter("@OutTime", SqlDbType.DateTime);
            SqlParameter paramOutUserSysNo = new SqlParameter("@OutUserSysNo", SqlDbType.Int,4);
            SqlParameter paramNote = new SqlParameter("@Note", SqlDbType.NVarChar,200);
            SqlParameter paramStatus = new SqlParameter("@Status", SqlDbType.Int,4);
            SqlParameter paramSOSysNo = new SqlParameter("@SOSysNo", SqlDbType.Int,4);
            SqlParameter paramLocationStatus = new SqlParameter("@LocationStatus", SqlDbType.Int, 4);
            SqlParameter paramAddressAreaSysNo = new SqlParameter("@AddressAreaSysNo",SqlDbType.Int,4);
            SqlParameter paramPackageID = new SqlParameter("@PackageID", SqlDbType.NVarChar, 50);
            SqlParameter paramFreightUserSysNo = new SqlParameter("@FreightUserSysNo", SqlDbType.Int,4);
            SqlParameter paramSetDeliveryManTime = new SqlParameter("@SetDeliveryManTime", SqlDbType.DateTime);
            SqlParameter paramCheckQtyUserSysNo = new SqlParameter("@CheckQtyUserSysNo", SqlDbType.Int, 4);
            SqlParameter paramCheckQtyTime = new SqlParameter("@CheckQtyTime", SqlDbType.DateTime);
            SqlParameter paramIsPrintPackageCover = new SqlParameter("@IsPrintPackageCover", SqlDbType.Int, 4);
            SqlParameter paramIsConfirmAddress = new SqlParameter("@IsConfirmAddress", SqlDbType.Int, 4);

            if ( oParam.SysNo != AppConst.IntNull)
                paramSysNo.Value = oParam.SysNo;
            else
                paramSysNo.Value = System.DBNull.Value;
            if ( oParam.RevertID != AppConst.StringNull)
                paramRevertID.Value = oParam.RevertID;
            else
                paramRevertID.Value = System.DBNull.Value;
            if ( oParam.CustomerSysNo != AppConst.IntNull)
                paramCustomerSysNo.Value = oParam.CustomerSysNo;
            else
                paramCustomerSysNo.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;
            if ( oParam.ZIP != AppConst.StringNull)
                paramZIP.Value = oParam.ZIP;
            else
                paramZIP.Value = System.DBNull.Value;
            if ( oParam.Address != AppConst.StringNull)
                paramAddress.Value = oParam.Address;
            else
                paramAddress.Value = System.DBNull.Value;
            if ( oParam.Contact != AppConst.StringNull)
                paramContact.Value = oParam.Contact;
            else
                paramContact.Value = System.DBNull.Value;
            if ( oParam.Phone != AppConst.StringNull)
                paramPhone.Value = oParam.Phone;
            else
                paramPhone.Value = System.DBNull.Value;
            if ( oParam.ShipType != AppConst.IntNull)
                paramShipType.Value = oParam.ShipType;
            else
                paramShipType.Value = System.DBNull.Value;
            if ( oParam.OutTime != AppConst.DateTimeNull)
                paramOutTime.Value = oParam.OutTime;
            else
                paramOutTime.Value = System.DBNull.Value;
            if ( oParam.OutUserSysNo != AppConst.IntNull)
                paramOutUserSysNo.Value = oParam.OutUserSysNo;
            else
                paramOutUserSysNo.Value = System.DBNull.Value;
            if ( oParam.Note != AppConst.StringNull)
                paramNote.Value = oParam.Note;
            else
                paramNote.Value = System.DBNull.Value;
            if ( oParam.Status != AppConst.IntNull)
                paramStatus.Value = oParam.Status;
            else
                paramStatus.Value = System.DBNull.Value;
            if ( oParam.SOSysNo != AppConst.IntNull)
                paramSOSysNo.Value = oParam.SOSysNo;
            else
                paramSOSysNo.Value = System.DBNull.Value;
            if (oParam.LocationStatus != AppConst.IntNull)
                paramLocationStatus.Value = oParam.LocationStatus;
            else
                paramLocationStatus.Value = System.DBNull.Value;
            if (oParam.AddressAreaSysNo != AppConst.IntNull)
                paramAddressAreaSysNo.Value = oParam.AddressAreaSysNo;
            else
                paramAddressAreaSysNo.Value = System.DBNull.Value;
            if (oParam.PackageID != AppConst.StringNull)

                paramPackageID.Value = oParam.PackageID;
            else
                paramPackageID.Value = System.DBNull.Value;

            if (oParam.FreightUserSysNo != AppConst.IntNull)
                paramFreightUserSysNo.Value = oParam.FreightUserSysNo;
            else
                paramFreightUserSysNo.Value = System.DBNull.Value;

            if (oParam.SetDeliveryManTime != AppConst.DateTimeNull)
                paramSetDeliveryManTime.Value = oParam.SetDeliveryManTime;
            else
                paramSetDeliveryManTime.Value = System.DBNull.Value;

            if (oParam.CheckQtyUserSysNo != AppConst.IntNull)
                paramCheckQtyUserSysNo.Value = oParam.CheckQtyUserSysNo;
            else
                paramCheckQtyUserSysNo.Value = System.DBNull.Value;

            if (oParam.CheckQtyTime != AppConst.DateTimeNull)
                paramCheckQtyTime.Value = oParam.CheckQtyTime;
            else
                paramCheckQtyTime.Value = System.DBNull.Value;

            if (oParam.IsPrintPackageCover != AppConst.IntNull)
                paramIsPrintPackageCover.Value = oParam.IsPrintPackageCover;
            else
                paramIsPrintPackageCover.Value = System.DBNull.Value;

            if (oParam.IsConfirmAddress != AppConst.IntNull)
                paramIsConfirmAddress.Value = oParam.IsConfirmAddress;
            else
                paramIsConfirmAddress.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramRevertID);
            cmd.Parameters.Add(paramCustomerSysNo);
            cmd.Parameters.Add(paramCreateTime);
            cmd.Parameters.Add(paramCreateUserSysNo);
            cmd.Parameters.Add(paramZIP);
            cmd.Parameters.Add(paramAddress);
            cmd.Parameters.Add(paramContact);
            cmd.Parameters.Add(paramPhone);
            cmd.Parameters.Add(paramShipType);
            cmd.Parameters.Add(paramOutTime);
            cmd.Parameters.Add(paramOutUserSysNo);
            cmd.Parameters.Add(paramNote);
            cmd.Parameters.Add(paramStatus);
            cmd.Parameters.Add(paramSOSysNo);
            cmd.Parameters.Add(paramLocationStatus);
            cmd.Parameters.Add(paramAddressAreaSysNo);
            cmd.Parameters.Add(paramPackageID);
            cmd.Parameters.Add(paramFreightUserSysNo);
            cmd.Parameters.Add(paramSetDeliveryManTime);
            cmd.Parameters.Add(paramCheckQtyUserSysNo);
            cmd.Parameters.Add(paramCheckQtyTime);
            cmd.Parameters.Add(paramIsPrintPackageCover);
            cmd.Parameters.Add(paramIsConfirmAddress);

            return SqlHelper.ExecuteNonQuery(cmd);
        }