Ejemplo n.º 1
0
        public void AddItemRelated(int sysno, int freightUserSysNo, DLItemInfo dlItem, int DLItemType, int updateUser)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                Hashtable ht = new Hashtable();
                ht.Add("SysNo", sysno);
                ht.Add("FreightUserSysNo", freightUserSysNo);
                ht.Add("SetDeliveryManTime", DateTime.Now);
                ht.Add("DLSysNo", dlItem.DLSysNo);

                if (DLItemType == (int)AppEnum.DLItemType.SaleOrder)
                    SaleManager.GetInstance().UpdateSOMaster(ht);
                else if (DLItemType == (int)AppEnum.DLItemType.RMARequest)
                    RMARequestManager.GetInstance().SetDeliveryMen(ht);
                else if (DLItemType == (int)AppEnum.DLItemType.RMARevert)
                    RMARevertManager.GetInstance().SetDeliveryMen(ht);
                else if (DLItemType == (int)AppEnum.DLItemType.RMAOutbound)
                    RMAOutBoundManager.GetInstance().SetDeliveryMen(ht);
                else if (DLItemType == (int)AppEnum.DLItemType.RMASendAccessory)
                    RMASendAccessoryManager.GetInstance().SetDeliveryMen(ht);
                else if (DLItemType == (int)AppEnum.DLItemType.StShift)
                    ShiftManager.GetInstance().UpdateShiftMaster(ht);

                DeliveryManSetListInfo oInfo = new DeliveryManSetListInfo();
                oInfo.ItemID = dlItem.ItemID;
                oInfo.SetUserSysNo = updateUser;
                oInfo.FreightUserSysNo = freightUserSysNo;
                oInfo.CreateTime = DateTime.Now;
                oInfo.DLSysNo = dlItem.DLSysNo;
                DeliveryManager.GetInstance().InsertDeliveryMenSetList(oInfo);

                DLManager.GetInstance().AddNewDLItem(dlItem);

                scope.Complete();
            }
        }
Ejemplo n.º 2
0
        public int Insert(DeliveryManSetListInfo oParam)
        {
            string sql = @"INSERT INTO DeliveryManSetList
                            (
                            ItemID, FreightUserSysNo, CreateTime
                            )
                            VALUES (
                            @ItemID, @FreightUserSysNo, @CreateTime
                            );set @SysNo = SCOPE_IDENTITY();";
               SqlCommand cmd = new SqlCommand(sql);

               SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int, 4);
               SqlParameter paramItemID = new SqlParameter("@ItemID", SqlDbType.NVarChar, 50);
               SqlParameter paramFreightUserSysNo = new SqlParameter("@FreightUserSysNo", SqlDbType.Int, 4);
               SqlParameter paramCreateTime = new SqlParameter("@CreateTime", SqlDbType.DateTime);
               paramSysNo.Direction = ParameterDirection.Output;
               if (oParam.ItemID != AppConst.StringNull)
               paramItemID.Value = oParam.ItemID;
               else
               paramItemID.Value = System.DBNull.Value;
               if (oParam.FreightUserSysNo != AppConst.IntNull)
               paramFreightUserSysNo.Value = oParam.FreightUserSysNo;
               else
               paramFreightUserSysNo.Value = System.DBNull.Value;
               if (oParam.CreateTime != AppConst.DateTimeNull)
               paramCreateTime.Value = oParam.CreateTime;
               else
               paramCreateTime.Value = System.DBNull.Value;

               cmd.Parameters.Add(paramSysNo);
               cmd.Parameters.Add(paramItemID);
               cmd.Parameters.Add(paramFreightUserSysNo);
               cmd.Parameters.Add(paramCreateTime);

               return SqlHelper.ExecuteNonQuery(cmd, out oParam.SysNo);
        }
Ejemplo n.º 3
0
 private void map(DeliveryManSetListInfo oParam, DataRow tempdr)
 {
     oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]);
     oParam.ItemID = Util.TrimNull(tempdr["ItemID"]);
     oParam.SetUserSysNo = Util.TrimIntNull(tempdr["SetUserSysNo"]);
     oParam.FreightUserSysNo = Util.TrimIntNull(tempdr["FreightUserSysNo"]);
     oParam.CreateTime = Util.TrimDateNull(tempdr["CreateTime"]);
     oParam.DLSysNo = Util.TrimIntNull(tempdr["DLSysNo"]);
 }
Ejemplo n.º 4
0
        public void ChangeFreight(DLInfo oDLMasterInfo)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                //����DL������Ϣ
                UpdateDLMaster(oDLMasterInfo);

                DLInfo oDLInfo = Load(oDLMasterInfo.SysNo);

                //���¸�������������Ϣ

                DeliveryManSetListInfo deliveryInfo = new DeliveryManSetListInfo();
                deliveryInfo.SetUserSysNo = oDLMasterInfo.UpdateFreightManUserSysNo;
                deliveryInfo.FreightUserSysNo = oDLMasterInfo.FreightUserSysNo;
                deliveryInfo.CreateTime = DateTime.Now;
                deliveryInfo.DLSysNo = oDLMasterInfo.SysNo;
                foreach (DLItemInfo oItem in oDLInfo.ItemHash.Values)
                {
                    if (oItem.ItemType == (int)AppEnum.DLItemType.SaleOrder)
                    {
                        Hashtable ht = new Hashtable();
                        ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo);
                        ht.Add("SetDeliveryManTime", System.DateTime.Now);
                        ht.Add("DLSysNo", oDLMasterInfo.SysNo);
                        ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(1)));
                        SaleManager.GetInstance().UpdateSOMaster(ht);

                    }
                    else if (oItem.ItemType == (int)AppEnum.DLItemType.RMARequest)
                    {
                        Hashtable ht = new Hashtable();
                        ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo);
                        ht.Add("SetDeliveryManTime", System.DateTime.Now);
                        ht.Add("DLSysNo", oDLMasterInfo.SysNo);
                        ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2)));
                        RMARequestManager.GetInstance().SetDeliveryMen(ht);
                    }
                    else if (oItem.ItemType == (int)AppEnum.DLItemType.RMARevert)
                    {
                        Hashtable ht = new Hashtable();
                        ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo);
                        ht.Add("SetDeliveryManTime", System.DateTime.Now);
                        ht.Add("DLSysNo", oDLMasterInfo.SysNo);
                        ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2)));
                        RMARevertManager.GetInstance().SetDeliveryMen(ht);
                    }
                    else if (oItem.ItemType == (int)AppEnum.DLItemType.RMAOutbound)
                    {
                        Hashtable ht = new Hashtable();
                        ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo);
                        ht.Add("SetDeliveryManTime", System.DateTime.Now);
                        ht.Add("DLSysNo", oDLMasterInfo.SysNo);
                        ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2)));
                        RMAOutBoundManager.GetInstance().SetDeliveryMen(ht);
                    }
                    else if (oItem.ItemType == (int)AppEnum.DLItemType.RMASendAccessory)
                    {
                        Hashtable ht = new Hashtable();
                        ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo);
                        ht.Add("SetDeliveryManTime", System.DateTime.Now);
                        ht.Add("DLSysNo", oDLMasterInfo.SysNo);
                        ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2)));
                        RMASendAccessoryManager.GetInstance().SetDeliveryMen(ht);
                    }

                    deliveryInfo.ItemID = oItem.ItemID;
                    DeliveryManager.GetInstance().InsertDeliveryMenSetList(deliveryInfo);

                }
                scope.Complete();
            }
        }
Ejemplo n.º 5
0
 public void InsertDeliveryMenSetList(DeliveryManSetListInfo oParam)
 {
     new DeliveryDac().Insert(oParam);
 }