Ejemplo n.º 1
0
        public int DeleteFreightManArea(int paramSysNo)
        {
            if (freightManAreaHash == null || !freightManAreaHash.ContainsKey(paramSysNo))
                throw new BizException("delete failed");

            int result = new ASPDac().DeleteFreightManArea(paramSysNo);
            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

            freightManAreaHash.Remove(paramSysNo);

            return result;
        }
Ejemplo n.º 2
0
        public int DeleteShipPayUn(int paramSysNo)
        {
            if (shipPayHash == null || !shipPayHash.ContainsKey(paramSysNo))
                throw new BizException("the un ShipType PayType record does not exist, delete failed");

            int result = new ASPDac().DeleteShipPay(paramSysNo);
            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

            shipPayHash.Remove(paramSysNo);

            return result;
        }
Ejemplo n.º 3
0
        public int UpdateArea(AreaInfo oParam)
        {
            if (!areaHash.ContainsKey(oParam.SysNo))
                throw new BizException("the area does not exist, update failed");

            int result = new ASPDac().UpdateArea(oParam);
            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

            areaHash.Remove(oParam.SysNo);
            areaHash.Add(oParam.SysNo, oParam);

            return result;
        }
Ejemplo n.º 4
0
        public int UpdateShipType(ShipTypeInfo oParam)
        {
            string sql = "select * from shiptype where shiptypeid=" + Util.ToSqlString(oParam.ShipTypeID) + " and sysno <>" + oParam.SysNo;
            DataSet ds = SqlHelper.ExecuteDataSet(sql);
            if (Util.HasMoreRow(ds))
                throw new BizException("the same ship type id exists");

            if (shipTypeHash == null || !shipTypeHash.ContainsKey(oParam.SysNo))
                throw new BizException("the ship type does not exist, update failed");

            int result = new ASPDac().UpdateShipType(oParam);
            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

            shipTypeHash.Remove(oParam.SysNo);
            shipTypeHash.Add(oParam.SysNo, oParam);

            return result;
        }
Ejemplo n.º 5
0
        public int InsertShipType(ShipTypeInfo oParam)
        {
            string sql = "select * from shiptype where shiptypeid = " + Util.ToSqlString(oParam.ShipTypeID);
            DataSet ds = SqlHelper.ExecuteDataSet(sql);
            if (Util.HasMoreRow(ds))
                throw new BizException("the same ship type id exists");

            oParam.SysNo = SequenceDac.GetInstance().Create("ShipType_Sequence");
            int result = new ASPDac().InsertShipType(oParam);
            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

            if (shipTypeHash == null)
                shipTypeHash = new Hashtable(10);
            shipTypeHash.Add(oParam.SysNo, oParam);
            return result;
        }
Ejemplo n.º 6
0
        public int InsertShipPayUn(ShipPayInfo oParam)
        {
            string sql = "select * from shiptype_paytype_un where ShipTypeSysNo = " + oParam.ShipTypeSysNo + " and PayTypeSysNo = " + oParam.PayTypeSysNo;
            DataSet ds = SqlHelper.ExecuteDataSet(sql);
            if (Util.HasMoreRow(ds))
                throw new BizException("this shiptype_paytype_un record exists");

            int result = new ASPDac().InsertShipPay(oParam);
            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

            if (shipPayHash == null)
                shipPayHash = new Hashtable(10);
            shipPayHash.Add(oParam.SysNo, oParam);
            return result;
        }
Ejemplo n.º 7
0
        public int InsertShipAreaPrice(ShipAreaPriceInfo oParam)
        {
            int result = new ASPDac().InsertShipAreaPrice(oParam);
            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

            if (shipAreaPriceHash == null)
                shipAreaPriceHash = new Hashtable(10);
            shipAreaPriceHash.Add(oParam.SysNo, oParam);
            return result;
        }
Ejemplo n.º 8
0
        public void InsertFreightManArea(string FreightMenList, string AreaSysNoList)
        {
            TransactionOptions options = new TransactionOptions();
            options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
            options.Timeout = TransactionManager.DefaultTimeout;

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options))
            {
                string[] FreightMen = FreightMenList.Split(',');
                string[] AreaSysNo = AreaSysNoList.Split(',');

                for (int i = 0; i < FreightMen.Length; i++)
                {
                    for (int j = 0; j < AreaSysNo.Length; j++)
                    {
                        string sql = "select * from FreightMan_Area where FreightUserSysNo = " + Int32.Parse(FreightMen[i]) + " and AreaSysNo = " + Int32.Parse(AreaSysNo[j]);
                        DataSet ds = SqlHelper.ExecuteDataSet(sql);
                        if (!Util.HasMoreRow(ds))
                        {
                            FreightManAreaInfo oParam = new FreightManAreaInfo();
                            oParam.FreightUserSysNo = Int32.Parse(FreightMen[i]);
                            oParam.AreaSysNo = Int32.Parse(AreaSysNo[j]);
                            int result = new ASPDac().InsertFreightManArea(oParam);
                            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

                            if (freightManAreaHash == null)
                                freightManAreaHash = new Hashtable(10);
                            freightManAreaHash.Add(oParam.SysNo, oParam);

                        }

                    }
                }
                scope.Complete();

            }
        }
Ejemplo n.º 9
0
        public int InsertArea(AreaInfo oParam)
        {
            if (!AppConfig.IsImportable)
                foreach (AreaInfo item in areaHash.Values)
                {
                    if (item.GetWholeName() == oParam.GetWholeName())
                        throw new BizException("area duplicated");
                }
            oParam.SysNo = SequenceDac.GetInstance().Create("Area_Sequence");
            int result = new ASPDac().InsertArea(oParam);
            SyncManager.GetInstance().SetDbLastVersion((int)AppEnum.Sync.ASP);

            areaHash.Add(oParam.SysNo, oParam);
            return result;
        }