コード例 #1
0
 public void Update(WhProductShelvingInspectionInfo oParam)
 {
     new WhProductShelvingInspectionDac().Update(oParam);
 }
コード例 #2
0
 private void map(WhProductShelvingInspectionInfo oParam, DataRow tempdr)
 {
     oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]);
       oParam.WorkType = Util.TrimIntNull(tempdr["WorkType"]);
       oParam.BillType = Util.TrimIntNull(tempdr["BillType"]);
       oParam.BillSysNo = Util.TrimIntNull(tempdr["BillSysNo"]);
       oParam.AllocatedUserSysNo = Util.TrimIntNull(tempdr["AllocatedUserSysNo"]);
       oParam.RealUserSysNo = Util.TrimIntNull(tempdr["RealUserSysNo"]);
       oParam.UpdateUserSysNo = Util.TrimIntNull(tempdr["UpdateUserSysNo"]);
       oParam.UpdateTime = Util.TrimDateNull(tempdr["UpdateTime"]);
 }
コード例 #3
0
 public WhProductShelvingInspectionInfo Load(int SysNo)
 {
     string sql = "select * from Wh_ProductShelvingInspection where sysno =" + SysNo;
       DataSet ds = SqlHelper.ExecuteDataSet(sql);
       if (!Util.HasMoreRow(ds))
       return null;
       WhProductShelvingInspectionInfo oInfo = new WhProductShelvingInspectionInfo();
       this.map(oInfo, ds.Tables[0].Rows[0]);
       return oInfo;
 }
コード例 #4
0
 public void Insert(WhProductShelvingInspectionInfo oParam)
 {
     new WhProductShelvingInspectionDac().Insert(oParam);
 }
コード例 #5
0
ファイル: SaleManager.cs プロジェクト: ue96/ue96
        public void OutStock(SOInfo soInfo)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                ////���¶���״̬
                //1 �鿴������ǰ״̬
                //2 ���ø���ֵ������status
                int currentStatus = this.getCurrentSOStatus(soInfo.SysNo);

                if (currentStatus != (int)AppEnum.SOStatus.WaitingOutStock)
                    throw new BizException("outstock so: the current status is not WaitingOutStock, operation of OutStock SO failed");

                //this.UpdateSO(soInfo);
                soInfo.Status = (int)AppEnum.SOStatus.OutStock;
                //���¶���״̬
                UpdateSOStatus(soInfo.SysNo, soInfo.Status, soInfo.OutUserSysNo);
                //������Ʒ���
                foreach(SOItemInfo item in soInfo.ItemHash.Values)
                {
                    InventoryManager.GetInstance().SetSOOutStockQty(soInfo.StockSysNo,item.ProductSysNo,item.Quantity);
                }
                //���¶���������ϸ�ɱ�
                this.SetSOItemCost(soInfo.SysNo);

                //�������Ч���տ-->����soincome(normal, origin)
                SOIncomeInfo soIncome = SOIncomeManager.GetInstance().LoadValid((int)AppEnum.SOIncomeOrderType.SO,soInfo.SysNo);
                if(soIncome==null)//����Ч�տ�������տ
                {
                    soIncome = new SOIncomeInfo();
                    soIncome.OrderType = (int)AppEnum.SOIncomeOrderType.SO;
                    soIncome.OrderSysNo = soInfo.SysNo;
                    soIncome.OrderAmt = soIncome.IncomeAmt = Util.TruncMoney(soInfo.GetTotalAmt());
                    soIncome.IncomeStyle = (int)AppEnum.SOIncomeStyle.Normal;
                    soIncome.IncomeUserSysNo = soInfo.OutUserSysNo;
                    soIncome.IncomeTime = DateTime.Now;
                    soIncome.Status = (int)AppEnum.SOIncomeStatus.Origin;
                    SOIncomeManager.GetInstance().Insert(soIncome);
                    LogInfo log = new LogInfo();
                    log.OptIP = AppConst.SysIP;
                    log.OptUserSysNo = AppConst.SysUser;
                    log.OptTime = DateTime.Now;
                    log.TicketType = (int)AppEnum.LogType.Finance_SOIncome_Add;
                    log.TicketSysNo = soIncome.SysNo;
                    LogManager.GetInstance().Write(log);
                }

                //���������������pointDelay
                if(soInfo.PointAmt>0)
                {
                    SalePointDelayInfo spInfo = new SalePointDelayInfo();
                    spInfo.SOSysNo = soInfo.SysNo;
                    spInfo.CreateTime = DateTime.Now;
                    spInfo.Status = (int)AppEnum.TriStatus.Origin;
                    PointManager.GetInstance().InsertPointDelay(spInfo);
                }

                //��ⶩ�����Ա������м�¼����£�û�������

                WhProductShelvingInspectionInfo oWhpsi = new WhProductShelvingInspectionInfo();
                Hashtable ht = new Hashtable();
                ht.Add("BillSysNo", soInfo.SysNo);
                ht.Add("WorkType", (int)AppEnum.WhWorkType.ProductInspection);
                ht.Add("BillType", (int)AppEnum.WhWorkBillType.SO);
                ht.Add("top", "select top 1 ");

                int whpsiSysNo = WhProductShelvingInspectionManager.GetInstance().GetSysNo(ht);

                if (whpsiSysNo == 0)
                {
                    oWhpsi.BillSysNo = soInfo.SysNo;
                    oWhpsi.WorkType = (int)AppEnum.WhWorkType.ProductInspection;
                    oWhpsi.BillType = (int)AppEnum.WhWorkBillType.SO;
                    oWhpsi.AllocatedUserSysNo = UserRatioManager.GetInstance().GetSOInspectionAllocatedMan(soInfo.SysNo);
                    oWhpsi.RealUserSysNo = oWhpsi.AllocatedUserSysNo;
                    oWhpsi.UpdateUserSysNo = 33;//IASϵͳ
                    oWhpsi.UpdateTime = DateTime.Now;
                    WhProductShelvingInspectionManager.GetInstance().Insert(oWhpsi);
                }
                else
                {
                    oWhpsi.SysNo = whpsiSysNo;
                    oWhpsi.BillSysNo = soInfo.SysNo;
                    oWhpsi.WorkType = (int)AppEnum.WhWorkType.ProductInspection;
                    oWhpsi.BillType = (int)AppEnum.WhWorkBillType.SO;
                    oWhpsi.AllocatedUserSysNo = UserRatioManager.GetInstance().GetSOInspectionAllocatedMan(soInfo.SysNo);
                    oWhpsi.RealUserSysNo = oWhpsi.AllocatedUserSysNo;
                    oWhpsi.UpdateUserSysNo = 33;//IASϵͳ
                    oWhpsi.UpdateTime = DateTime.Now;
                    WhProductShelvingInspectionManager.GetInstance().Update(oWhpsi);
                }

                scope.Complete();
            }
        }
コード例 #6
0
        public int Update(WhProductShelvingInspectionInfo oParam)
        {
            string sql = @"UPDATE Wh_ProductShelvingInspection SET
                            WorkType=@WorkType, BillType=@BillType,
                            BillSysNo=@BillSysNo, AllocatedUserSysNo=@AllocatedUserSysNo,
                            RealUserSysNo=@RealUserSysNo, UpdateUserSysNo=@UpdateUserSysNo,
                            UpdateTime=@UpdateTime
                            WHERE SysNo=@SysNo";
              SqlCommand cmd = new SqlCommand(sql);

              SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
              SqlParameter paramWorkType = new SqlParameter("@WorkType", SqlDbType.Int, 4);
              SqlParameter paramBillType = new SqlParameter("@BillType", SqlDbType.Int, 4);
              SqlParameter paramBillSysNo = new SqlParameter("@BillSysNo", SqlDbType.Int, 4);
              SqlParameter paramAllocatedUserSysNo = new SqlParameter("@AllocatedUserSysNo", SqlDbType.Int, 4);
              SqlParameter paramRealUserSysNo = new SqlParameter("@RealUserSysNo", SqlDbType.Int, 4);
              SqlParameter paramUpdateUserSysNo = new SqlParameter("@UpdateUserSysNo", SqlDbType.Int, 4);
              SqlParameter paramUpdateTime = new SqlParameter("@UpdateTime", SqlDbType.DateTime);

              if (oParam.SysNo != AppConst.IntNull)
              paramSysNo.Value = oParam.SysNo;
              else
              paramSysNo.Value = System.DBNull.Value;
              if (oParam.WorkType != AppConst.IntNull)
              paramWorkType.Value = oParam.WorkType;
              else
              paramWorkType.Value = System.DBNull.Value;
              if (oParam.BillType != AppConst.IntNull)
              paramBillType.Value = oParam.BillType;
              else
              paramBillType.Value = System.DBNull.Value;
              if (oParam.BillSysNo != AppConst.IntNull)
              paramBillSysNo.Value = oParam.BillSysNo;
              else
              paramBillSysNo.Value = System.DBNull.Value;
              if (oParam.AllocatedUserSysNo != AppConst.IntNull)
              paramAllocatedUserSysNo.Value = oParam.AllocatedUserSysNo;
              else
              paramAllocatedUserSysNo.Value = System.DBNull.Value;
              if (oParam.RealUserSysNo != AppConst.IntNull)
              paramRealUserSysNo.Value = oParam.RealUserSysNo;
              else
              paramRealUserSysNo.Value = System.DBNull.Value;
              if (oParam.UpdateUserSysNo != AppConst.IntNull)
              paramUpdateUserSysNo.Value = oParam.UpdateUserSysNo;
              else
              paramUpdateUserSysNo.Value = System.DBNull.Value;
              if (oParam.UpdateTime != AppConst.DateTimeNull)
              paramUpdateTime.Value = oParam.UpdateTime;
              else
              paramUpdateTime.Value = System.DBNull.Value;

              cmd.Parameters.Add(paramSysNo);
              cmd.Parameters.Add(paramWorkType);
              cmd.Parameters.Add(paramBillType);
              cmd.Parameters.Add(paramBillSysNo);
              cmd.Parameters.Add(paramAllocatedUserSysNo);
              cmd.Parameters.Add(paramRealUserSysNo);
              cmd.Parameters.Add(paramUpdateUserSysNo);
              cmd.Parameters.Add(paramUpdateTime);

              return SqlHelper.ExecuteNonQuery(cmd);
        }
コード例 #7
0
        public int Insert(WhProductShelvingInspectionInfo oParam)
        {
            string sql = @"INSERT INTO Wh_ProductShelvingInspection
                            (
                            WorkType, BillType, BillSysNo, AllocatedUserSysNo,
                            RealUserSysNo, UpdateUserSysNo, UpdateTime
                            )
                            VALUES (
                            @WorkType, @BillType, @BillSysNo, @AllocatedUserSysNo,
                            @RealUserSysNo, @UpdateUserSysNo, @UpdateTime
                            );set @SysNo = SCOPE_IDENTITY();";
              SqlCommand cmd = new SqlCommand(sql);

              SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
              SqlParameter paramWorkType = new SqlParameter("@WorkType", SqlDbType.Int, 4);
              SqlParameter paramBillType = new SqlParameter("@BillType", SqlDbType.Int, 4);
              SqlParameter paramBillSysNo = new SqlParameter("@BillSysNo", SqlDbType.Int, 4);
              SqlParameter paramAllocatedUserSysNo = new SqlParameter("@AllocatedUserSysNo", SqlDbType.Int, 4);
              SqlParameter paramRealUserSysNo = new SqlParameter("@RealUserSysNo", SqlDbType.Int, 4);
              SqlParameter paramUpdateUserSysNo = new SqlParameter("@UpdateUserSysNo", SqlDbType.Int, 4);
              SqlParameter paramUpdateTime = new SqlParameter("@UpdateTime", SqlDbType.DateTime);
              paramSysNo.Direction = ParameterDirection.Output;
              if (oParam.WorkType != AppConst.IntNull)
              paramWorkType.Value = oParam.WorkType;
              else
              paramWorkType.Value = System.DBNull.Value;
              if (oParam.BillType != AppConst.IntNull)
              paramBillType.Value = oParam.BillType;
              else
              paramBillType.Value = System.DBNull.Value;
              if (oParam.BillSysNo != AppConst.IntNull)
              paramBillSysNo.Value = oParam.BillSysNo;
              else
              paramBillSysNo.Value = System.DBNull.Value;
              if (oParam.AllocatedUserSysNo != AppConst.IntNull)
              paramAllocatedUserSysNo.Value = oParam.AllocatedUserSysNo;
              else
              paramAllocatedUserSysNo.Value = System.DBNull.Value;
              if (oParam.RealUserSysNo != AppConst.IntNull)
              paramRealUserSysNo.Value = oParam.RealUserSysNo;
              else
              paramRealUserSysNo.Value = System.DBNull.Value;
              if (oParam.UpdateUserSysNo != AppConst.IntNull)
              paramUpdateUserSysNo.Value = oParam.UpdateUserSysNo;
              else
              paramUpdateUserSysNo.Value = System.DBNull.Value;
              if (oParam.UpdateTime != AppConst.DateTimeNull)
              paramUpdateTime.Value = oParam.UpdateTime;
              else
              paramUpdateTime.Value = System.DBNull.Value;

              cmd.Parameters.Add(paramSysNo);
              cmd.Parameters.Add(paramWorkType);
              cmd.Parameters.Add(paramBillType);
              cmd.Parameters.Add(paramBillSysNo);
              cmd.Parameters.Add(paramAllocatedUserSysNo);
              cmd.Parameters.Add(paramRealUserSysNo);
              cmd.Parameters.Add(paramUpdateUserSysNo);
              cmd.Parameters.Add(paramUpdateTime);

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