コード例 #1
0
 public void OnDestroy()
 {
     try
     {
         StageMgr.Dispose();
         UIMgr.Dispose();
         LevelMgr.Dispose();
         AssetBundleMgr.Dispose(IsDisposeAssetBundleInQuit);
         DataMgr.Dispose();
         Commander.Dispose();
     }
     catch {}
 }
コード例 #2
0
 public WO_Loot(int id, WorldObject at, MapPlayer onwer, ObjectsMgr manager)
     : base(manager.GetNewGuid() | Constants.IDRObject, manager)
 {
     _onwer     = onwer;
     _position  = at.Position;
     _rotation  = at.Rotation;
     _loot      = DataMgr.SelectLoot(id);
     _resource  = DataMgr.SelectResource(Constants.LootResource);
     OnSpawn   += WO_Loot_OnSpawn;
     OnDespawn += WO_Loot_OnDespawn;
     OnDestroy += WO_Loot_OnDestroy;
     Spawn();
 }
コード例 #3
0
ファイル: BIQCareSystem.cs プロジェクト: uon-crissp/IQCare
 public int RestoreDataBase(string Path, int FileNo)
 {
     lock (this)
     {
         ClsUtility.Init_Hashtable();
         ClsObject DataManager = new ClsObject();
         this.Connection        = DataMgr.GetConnection_Master();
         DataManager.Connection = this.Connection;
         ClsUtility.AddParameters("@Path", SqlDbType.VarChar, Path);
         ClsUtility.AddParameters("@Position", SqlDbType.Int, FileNo.ToString());
         return((Int32)DataManager.ReturnObject(ClsUtility.theParams, "pr_SystemAdmin_RestoreDB_Constella", ClsDBUtility.ObjectEnum.ExecuteNonQuery));
     }
 }
コード例 #4
0
ファイル: BClinicalSummary.cs プロジェクト: uon-crissp/IQCare
        public int SaveUpdateClinicalSummaryData(ClinicalSummary obj, int userID)
        {
            CLogger.WriteLog(ELogLevel.INFO, "BPatientAdherence.SaveUpdateClinicalSummaryData() method called");
            bool      flag     = true;
            int       visitId  = 0;
            ClsObject clsObjTP = new ClsObject();

            try
            {
                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, obj.Ptn_pk.ToString());
                ClsUtility.AddParameters("@Visit_Id", SqlDbType.Int, obj.Visit_Id.ToString());
                ClsUtility.AddParameters("@location_id", SqlDbType.Int, obj.location_id.ToString());
                ClsUtility.AddParameters("@Form_filling_date", SqlDbType.Int, obj.Form_filling_date);
                ClsUtility.AddParameters("@CliniciansName", SqlDbType.VarChar, obj.CliniciansName.ToString());
                ClsUtility.AddParameters("@Telephone", SqlDbType.VarChar, obj.Telephone.ToString());
                ClsUtility.AddParameters("@Email", SqlDbType.VarChar, obj.Email.ToString());
                ClsUtility.AddParameters("@PrimaryReason", SqlDbType.VarChar, obj.PrimaryReason.ToString());
                ClsUtility.AddParameters("@ClinicalEvaluation", SqlDbType.VarChar, obj.ClinicalEvaluation.ToString());
                ClsUtility.AddParameters("@NumberOfAdherence", SqlDbType.Int, obj.NumberOfAdherence.ToString());
                ClsUtility.AddParameters("@NumberOfHomeVisit", SqlDbType.Int, obj.NumberOfHomeVisit.ToString());
                ClsUtility.AddParameters("@SupportStructures", SqlDbType.VarChar, obj.SupportStructures.ToString());
                ClsUtility.AddParameters("@EvidenceOfAdherence", SqlDbType.VarChar, obj.EvidenceOfAdherence.ToString());
                ClsUtility.AddParameters("@NumberOfDOTS", SqlDbType.Int, obj.NumberOfDOTS.ToString());
                ClsUtility.AddParameters("@PoorAdherence", SqlDbType.VarChar, obj.PoorAdherence.ToString());
                ClsUtility.AddParameters("@EvaluationForOtherText", SqlDbType.VarChar, obj.EvaluationForOtherText.ToString());
                ClsUtility.AddParameters("@EvaluationForOtherVal", SqlDbType.VarChar, obj.EvaluationForOtherVal.ToString());
                ClsUtility.AddParameters("@CommentOnTreatment", SqlDbType.VarChar, obj.CommentOnTreatment.ToString());
                ClsUtility.AddParameters("@HasDrugResistance", SqlDbType.VarChar, obj.HasDrugResistance.ToString());
                ClsUtility.AddParameters("@HasFacilityMultidisciplinary", SqlDbType.VarChar, obj.HasFacilityMultidisciplinary.ToString());
                ClsUtility.AddParameters("@MDTMembers", SqlDbType.VarChar, obj.MDTMembers.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, userID.ToString());

                visitId = (int)clsObjTP.ReturnObject(ClsUtility.theParams, "Pr_SaveUpdateClinicalSummaryData", ClsDBUtility.ObjectEnum.ExecuteNonQuery);
                return(visitId);
            }
            catch (Exception ex)
            {
                flag = false;
                CLogger.WriteLog(ELogLevel.ERROR, "BPatientAdherence.SaveUpdateClinicalSummaryData() Method:" + ex.ToString());
                throw ex;
            }
            finally
            {
                clsObjTP = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
コード例 #5
0
ファイル: Main.cs プロジェクト: WeeirJoe/Joe
    void Create()
    {
        Log = new Log();
        LayerManager.Init();
        //不受状态机控制,仅打开和关闭的
        PersistMgr = PersistDialogMgr.Ins;
        //面板管理器.
        DialogStateManager = new MainDialogMgr();
        //顺序排队弹出框.
        PopupStateManager = new MainPopupStateManager();
        //各类游戏数据.
        GameStateMgr  = GameStateMgr.Ins;
        AppInfo       = AppInfo.Ins;
        CombatData    = CombatData.Ins;
        GameNotice    = new GameNotice();
        MeteorManager = MeteorManager.Ins;
        ScriptMng     = ScriptMng.Ins;

        ActionInterrupt = ActionInterrupt.Ins;

        BuffMng       = BuffMng.Ins;
        EventBus      = new EventBus();
        NetWorkBattle = NetWorkBattle.Ins;
        SceneMng      = SceneMng.Ins;

        //FrameSyncLocal = FrameSyncLocal.Ins;
        FrameSyncServer = FrameSyncServer.Ins;

        MeteorBehaviour = MeteorBehaviour.Ins;
        DropMng         = DropMng.Ins;
        //原版相关资源的加载器.
        MenuResLoader    = MenuResLoader.Ins;
        SkcLoader        = SkcLoader.Ins;
        BncLoader        = BncLoader.Ins;
        FMCLoader        = FMCLoader.Ins;
        GMBLoader        = GMBLoader.Ins;
        GMCLoader        = GMCLoader.Ins;
        DesLoader        = DesLoader.Ins;
        FMCPoseLoader    = FMCPoseLoader.Ins;
        SFXLoader        = SFXLoader.Ins;
        AmbLoader        = AmbLoader.Ins;
        DataMgr          = DataMgr.Ins;
        SfxMeshGenerator = SfxMeshGenerator.Ins;
        RoomMng          = RoomMng.Ins;
        SoundManager     = SoundManager.Ins;
        DlcMng           = DlcMng.Ins;
        PathMng          = PathMng.Ins;
        DownloadManager  = DownloadManager.Ins;
        DontDestroyOnLoad(gameObject);
        Log.WriteError(string.Format("GameStart AppVersion:{0}", Main.Ins.AppInfo.AppVersion()));
    }
コード例 #6
0
        public int SaveUpdateSatellite(String ID, String SatelliteID, String SatelliteName, String status, int priority, int Flag, int UserID, String Createdate)
        {
            try
            {
                this.Connection = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject SatelliteMgr = new ClsObject();
                SatelliteMgr.Connection = this.Connection;
                SatelliteMgr.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();

                ClsUtility.AddParameters("@SatelliteID", SqlDbType.VarChar, SatelliteID);
                ClsUtility.AddParameters("@SatelliteName", SqlDbType.VarChar, SatelliteName);
                ClsUtility.AddParameters("@DeleteFlag", SqlDbType.Int, status.ToString());
                ClsUtility.AddParameters("@SRNo", SqlDbType.Int, priority.ToString());
                ClsUtility.AddParameters("@UserID", SqlDbType.Int, UserID.ToString());
                int RowsAffected=0;
                if (Flag == 0)
                {
                    RowsAffected = (Int32)SatelliteMgr.ReturnObject(ClsUtility.theParams, "pr_Admin_SaveSatellite_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
                }
                else if (Flag == 1)
                {
                    ClsUtility.AddParameters("@ID", SqlDbType.Int, ID.ToString());
                    RowsAffected = (Int32)SatelliteMgr.ReturnObject(ClsUtility.theParams, "pr_Admin_UpdateSatellite_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
                }
                /*********/
                if (RowsAffected == 0)
                {
                    MsgBuilder theBL = new MsgBuilder();
                    theBL.DataElements["MessageText"] = "Error in Saving Reason record. Try Again..";
                    AppException.Create("#C1", theBL);
                }

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return Convert.ToInt32(RowsAffected);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                    DataMgr.ReleaseConnection(this.Connection);
            }

        }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        //根据解锁关卡记录,设置关卡是否锁定
        if (lvlMgr.unlock_levelID < id)
        {
            LockObj.SetActive(true);
            isLock = true;
        }

        float scale = 2;

        //初始化关卡数字显示
        if (id < 10)
        {
            //完全用代码动态创建一个Image对象,并作为num的子节点
            GameObject    obj = new GameObject("num1", typeof(Image));
            RectTransform rtf = obj.GetComponent <RectTransform>();
            rtf.SetParent(numTrans);
            //设置数字
            Image img = obj.GetComponent <Image>();
            img.sprite = lvlMgr.spr_nums[id];
            img.SetNativeSize();    //图片原始尺寸
            rtf.localScale    = new Vector3(2, 2, 1);
            rtf.localPosition = Vector3.zero;
        }
        else if (id < 100)
        {
            //十位数
            GameObject    obj = new GameObject("num1", typeof(Image));
            RectTransform rtf = obj.GetComponent <RectTransform>();
            rtf.SetParent(numTrans);
            //设置数字
            Image img = obj.GetComponent <Image>();
            img.sprite = lvlMgr.spr_nums[id / 10];
            img.SetNativeSize();    //图片原始尺寸
            rtf.localScale    = new Vector3(2, 2, 1);
            rtf.localPosition = new Vector3(-scale * rtf.rect.width / 2 - 1, 0, 0);

            //个位数
            GameObject    obj2 = new GameObject("num2", typeof(Image));
            RectTransform rtf2 = obj2.GetComponent <RectTransform>();
            rtf2.SetParent(numTrans);
            //设置数字
            Image img2 = obj2.GetComponent <Image>();
            img2.sprite = lvlMgr.spr_nums[id % 10];
            img2.SetNativeSize();    //图片原始尺寸
            rtf2.localScale    = new Vector3(2, 2, 1);
            rtf2.localPosition = new Vector3(scale * rtf2.rect.width / 2 + 1, 0, 0);
        }
        levelInfo = DataMgr.Instance().levelData.levels[id - 1];
    }
コード例 #8
0
ファイル: WO_NPC.cs プロジェクト: GeekBrony/LoE-Ghost.Server
 public WO_NPC(DB_WorldObject data, ObjectsMgr manager)
     : base(manager.GetNewGuid() | Constants.ReleaseGuide, manager)
 {
     _data = data;
     if (!DataMgr.Select(data.ObjectID, out _npc))
     {
         ServerLogger.LogError($"NPC id {data.ObjectID} doesn't exist");
     }
     if ((_npc.Flags & NPCFlags.Dialog) > 0)
     {
         _dialog = _server.Dialogs.GetDialog(_npc.Dialog);
     }
     if ((_npc.Flags & NPCFlags.Trader) > 0)
     {
         shop_ser = new SER_Shop(_npc.Items, $"{_npc.Pony.Name}'s shop");
     }
     if ((_npc.Flags & NPCFlags.Wears) > 0)
     {
         DB_Item entry; byte slot;
         _wears    = new Dictionary <int, InventoryItem>();
         wears_ser = new SER_Wears(_wears);
         foreach (var item in _npc.Wears)
         {
             if (item > 0 && DataMgr.Select(item, out entry))
             {
                 slot = entry.Slot.ToWearableIndex();
                 if (_wears.ContainsKey(slot))
                 {
                     ServerLogger.LogWarn($"NPC id {data.ObjectID} duplicate wear slot {entry.Slot}");
                 }
                 else
                 {
                     _wears[slot] = new InventoryItem(item);
                 }
             }
         }
     }
     OnSpawn   += WO_NPC_OnSpawn;
     OnDespawn += WO_NPC_OnDespawn;
     OnDestroy += WO_NPC_OnDestroy;
     if ((_npc.Flags & NPCFlags.ScriptedMovement) > 0)
     {
         AddComponent(new ScriptedMovement(_npc.Movement, this));
     }
     else
     {
         AddComponent(new NullMovement(this));
     }
     m_char = new Character(_npc.ID, -1, _npc.Level, -1, _npc.Pony, null);
     Spawn();
 }
コード例 #9
0
ファイル: BMigration.cs プロジェクト: palladiumkenya/IQCareKe
        public int MigrateData(string cmd, int Location, string DBName, int CommandId)
        {
            //////SqlConnection theCon = (SqlConnection)Entity.GetConnection(ConStr);
            //////SqlTransaction theTran = theCon.BeginTransaction();
            try
            {
                //////this.Connection = theCon;
                //////this.Transaction = theTran;
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject objMigration = new ClsObject();
                objMigration.Connection  = this.Connection;
                objMigration.Transaction = this.Transaction;

                //////Entity theObject = new Entity();
                //////theObject.Connection = this.Connection;
                //////theObject.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@dbname", SqlDbType.VarChar, DBName);
                if (Location > 0)
                {
                    ClsUtility.AddParameters("@Loc", SqlDbType.Int, Location.ToString());
                }
                int RowsEffected = (int)objMigration.ReturnObject(ClsUtility.theParams, cmd, ClsUtility.ObjectEnum.ExecuteNonQuery);

                string thecmd = "update migration set complete = 1 where id = " + CommandId;
                ClsUtility.Init_Hashtable();
                int rowseffected = (int)objMigration.ReturnObject(ClsUtility.theParams, thecmd, ClsUtility.ObjectEnum.ExecuteNonQuery);
                //////theTran.Commit();
                //////theCon.Close();
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(RowsEffected);
            }
            catch
            {
                //theTran.Rollback();
                DataMgr.RollBackTransation(this.Transaction);
                throw;
                //////throw ex;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
コード例 #10
0
        public int SaveUpdatePatientARTCareSummary(int patientID, int VisitID, int LocationID, Hashtable ht, int userID, int DataQualityFlag)
        {
            int       retval = 0;
            DataSet   theDS;
            ClsObject ARTCareSummaryMgr = new ClsObject();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ARTCareSummaryMgr.Connection  = this.Connection;
                ARTCareSummaryMgr.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@patientid", SqlDbType.Int, patientID.ToString());
                ClsUtility.AddParameters("@locationid", SqlDbType.Int, LocationID.ToString());
                ClsUtility.AddParameters("@Visit_ID", SqlDbType.Int, VisitID.ToString());
                ClsUtility.AddParameters("@visitdate", SqlDbType.DateTime, ht["visitdate"].ToString());
                //ClsUtility.AddParameters("@CohortMonth", SqlDbType.VarChar, ht["CohortMonth"].ToString());
                //ClsUtility.AddParameters("@CohortYear", SqlDbType.VarChar, ht["CohortYear"].ToString());
                ClsUtility.AddParameters("@OtherfacilityRegimen", SqlDbType.VarChar, ht["OtherfacilityRegimen"].ToString());
                ClsUtility.AddParameters("@OtherfacilityRegimenStartDate", SqlDbType.DateTime, ht["OtherfacilityRegimenStartDate"].ToString());
                ClsUtility.AddParameters("@OtherfacilityWHOStage", SqlDbType.Int, ht["OtherfacilityWHOStage"].ToString());
                ClsUtility.AddParameters("@OtherfacilityCD4", SqlDbType.Decimal, ht["OtherfacilityCD4"].ToString());
                ClsUtility.AddParameters("@OtherfacilityCD4Percent", SqlDbType.Decimal, ht["OtherfacilityCD4Percent"].ToString());
                ClsUtility.AddParameters("@OtherfacilityWeight", SqlDbType.Decimal, ht["OtherfacilityrWeight"].ToString());
                ClsUtility.AddParameters("@OtherfacilityHeight", SqlDbType.Decimal, ht["OtherfacilityHeight"].ToString());
                ClsUtility.AddParameters("@OtherfacilityClinicalStage", SqlDbType.Int, ht["OtherfacilityClinicalStage"].ToString());
                ClsUtility.AddParameters("@dataquality", SqlDbType.Int, DataQualityFlag.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, userID.ToString());
                theDS = (DataSet)ARTCareSummaryMgr.ReturnObject(ClsUtility.theParams, "pr_Clinical_SaveUpdateARTCareSummaryNigeria", ClsDBUtility.ObjectEnum.DataSet);
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }

            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }

            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            return(retval);
        }
コード例 #11
0
        //public int SaveNewLabType(string LabTypeName, int UserID)
        //{
        //    try
        //    {
        //        this.Connection = DataMgr.GetConnection();
        //        this.Transaction = DataMgr.BeginTransaction(this.Connection);

        //        ClsObject LabManager = new ClsObject();
        //        LabManager.Connection = this.Connection;
        //        LabManager.Transaction = this.Transaction;

        //        oUtility.Init_Hashtable();
        //        oUtility.AddParameters("@LabTypeName", SqlDbType.VarChar, LabTypeName);
        //        oUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());

        //        DataRow theDR;
        //        int RowsAffected = (Int32)LabManager.ReturnObject(oUtility.theParams, "pr_Admin_AddLabtype_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
        //        if (RowsAffected == 0)
        //        {
        //            MsgBuilder theBL = new MsgBuilder();
        //            theBL.DataElements["MessageText"] = "Error in Saving Lab type record. Try Again..";
        //            AppException.Create("#C1", theBL);
        //        }


        //        DataMgr.CommitTransaction(this.Transaction);
        //        DataMgr.ReleaseConnection(this.Connection);
        //        return Convert.ToInt32(RowsAffected);
        //    }
        //    catch
        //    {
        //        throw;
        //    }
        //    finally
        //    {
        //        if (this.Connection != null)
        //            DataMgr.ReleaseConnection(this.Connection);
        //    }
        //}
        //public int UpdateLabType(int LabTypeID, string LabTypeName, int UserID)
        //{
        //    try
        //    {
        //        this.Connection = DataMgr.GetConnection();
        //        this.Transaction = DataMgr.BeginTransaction(this.Connection);

        //        ClsObject LabManager = new ClsObject();
        //        LabManager.Connection = this.Connection;
        //        LabManager.Transaction = this.Transaction;

        //        oUtility.Init_Hashtable();
        //        oUtility.AddParameters("@LabTypeName", SqlDbType.VarChar, LabTypeName);
        //        oUtility.AddParameters("@LabTypeID", SqlDbType.Int, LabTypeID.ToString());
        //        oUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());

        //        DataRow theDR;
        //        int RowsAffected = (Int32)LabManager.ReturnObject(oUtility.theParams, "Pr_Admin_UpdateLabType_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);
        //        if (RowsAffected == 0)
        //        {
        //            MsgBuilder theBL = new MsgBuilder();
        //            theBL.DataElements["MessageText"] = "Error in Saving Lab type record. Try Again..";
        //            AppException.Create("#C1", theBL);
        //        }


        //        DataMgr.CommitTransaction(this.Transaction);
        //        DataMgr.ReleaseConnection(this.Connection);
        //        return Convert.ToInt32(RowsAffected);
        //    }
        //    catch
        //    {
        //        throw;
        //    }
        //    finally
        //    {
        //        if (this.Connection != null)
        //            DataMgr.ReleaseConnection(this.Connection);
        //    }
        //}


        public DataTable UpdateLab(int LabID, string LabName, int LabDepartmentID, int LabTypeID, int UserID, int DeleteFlag, string DataType, decimal MaxBoundary, decimal MinBoundary, int LabValueId, int Sequence)
        {
            try
            {
                DataTable theAffectedDT;
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject LabManager = new ClsObject();
                LabManager.Connection  = this.Connection;
                LabManager.Transaction = this.Transaction;

                oUtility.Init_Hashtable();
                oUtility.AddParameters("@LabName", SqlDbType.VarChar, LabName);
                oUtility.AddParameters("@UserId", SqlDbType.Int, UserID.ToString());
                oUtility.AddParameters("@LabDepartmentId", SqlDbType.Int, LabDepartmentID.ToString());
                oUtility.AddParameters("@LabTypeId", SqlDbType.Int, LabTypeID.ToString());
                oUtility.AddParameters("@LabTestId", SqlDbType.Int, LabID.ToString());
                oUtility.AddParameters("@DeleteFlag", SqlDbType.Int, DeleteFlag.ToString());
                oUtility.AddParameters("@DataType", SqlDbType.NVarChar, DataType.ToString());
                oUtility.AddParameters("@MaxBoundary", SqlDbType.Decimal, MaxBoundary.ToString());
                oUtility.AddParameters("@MinBoundary", SqlDbType.Decimal, MinBoundary.ToString());
                oUtility.AddParameters("@LabValueId", SqlDbType.Int, LabValueId.ToString());

                oUtility.AddParameters("@Sequence", SqlDbType.Int, Sequence.ToString());
                //DataRow theDR;
                theAffectedDT = (DataTable)LabManager.ReturnObject(oUtility.theParams, "Pr_Admin_UpdateLabTest_Constella", ClsUtility.ObjectEnum.DataTable);
                if (theAffectedDT.Rows[0][0].ToString() == "-1")
                {
                    MsgBuilder theBL = new MsgBuilder();
                    theBL.DataElements["MessageText"] = "Error in Saving Lab test record. Try Again..";
                    AppException.Create("#C1", theBL);
                }


                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(theAffectedDT);
            }
            catch
            {
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
コード例 #12
0
ファイル: WO_NPC.cs プロジェクト: Ignis34Rus/LoE-Ghost.Server
        private void RPC_06_11(NetMessage arg1, NetMessageInfo arg2)
        {
            int       itemID = arg1.ReadInt32();
            int       amount = arg1.ReadInt32();
            byte      islot  = arg1.ReadByte();
            MapPlayer player = _server[arg2.Sender.Id];

            if (player.Shop == this && DataMgr.Select(itemID, out DB_Item item) && (item.Flags & ItemFlags.Salable) > 0 && player.Items.HasInSlot(islot, itemID, amount))
            {
                player.Items.RemoveFromSlot(islot, amount);
                player.Char.Data.Bits += (item.Price * amount);
                player.View.SetBits(player.Char.Data.Bits);
            }
        }
コード例 #13
0
ファイル: LineMgr.cs プロジェクト: dennis1009/GameStart
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;
        if (timer >= timegap)
        {
            DataMgr.Instance().CalcPrice();
            CalcPoint();
            lineRenderer.SetPositions(PointArray);
/*            MoveCamera();*/
            timer = 0;
            UIMgr uiMgr = FindObjectOfType <UIMgr>();
            uiMgr.m_price.text = DataMgr.Instance().curprice.ToString("f2");
        }
    }
コード例 #14
0
        /// <summary>
        /// Gets the report queries.
        /// </summary>
        /// <param name="reportId">The report identifier.</param>
        /// <returns></returns>
        /// <exception cref="System.NotImplementedException"></exception>
        QueryCollection IReportIQTools.GetReportQueries(int reportId)
        {
            try
            {
                QueryCollection qCollection   = new QueryCollection();
                ClsObject       ReportManager = new ClsObject();
                ClsUtility.Init_Hashtable();
                string  queryStatement;
                DataMgr dataManager = new DataMgr();
                ClsUtility.AddParameters("@ReportID", SqlDbType.Int, reportId.ToString());
                queryStatement = @"Select Distinct	Q.QryID QueryID,
				                SB.sbCatID SubCategoryID,
				                SB.sbCategory SubCategory,
				                Q.qryName QueryName,
				                Q.qryDefinition Defination,
				                Q.qryDescription Description
                From dbo.aa_sbCategory SB
                Inner Join aa_Category C
	                On SB.CatID = C.CatID
                Inner Join dbo.aa_Queries Q On Q.qryID = SB.QryID
                Where (SB.DeleteFlag Is Null Or SB.DeleteFlag = 0) 
                And SB.QryID Is Not Null 
                And C.CatID=@ReportID;";
                DataTable dt = (DataTable)ReportManager.ReturnIQToolsObject(ClsUtility.theParams, queryStatement, ClsDBUtility.ObjectEnum.DataTable, ConnectionMode.REPORT);
                if (dt == null)
                {
                    return(null);
                }
                foreach (DataRow row in dt.Rows)
                {
                    //Query q = new
                    qCollection.Add(new Query()
                    {
                        QueryID       = Convert.ToInt16(row["QueryID"]),
                        Name          = row["QueryName"].ToString(),
                        SubCategoryID = Convert.ToInt16(row["SubCategoryID"]),
                        SubCategory   = row["SubCategory"].ToString(),
                        Defination    = row["Defination"].ToString(),
                        Description   = row["Description"].ToString()
                    });
                }
                ;

                return(qCollection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #15
0
ファイル: WO_NPC.cs プロジェクト: GeekBrony/LoE-Ghost.Server
 public WO_NPC(WO_NPC original, MapPlayer owner)
     : base(original._manager.GetNewGuid() | Constants.CRObject, original._manager)
 {
     _owner    = owner;
     _original = original;
     _npc      = original._npc;
     _data     = original._data;
     if ((_npc.Flags & NPCFlags.Dialog) > 0)
     {
         _dialog = _server.Dialogs.GetClone(_npc.Dialog, owner);
     }
     if ((_npc.Flags & NPCFlags.Trader) > 0)
     {
         shop_ser = new SER_Shop(_npc.Items, $"{_npc.Pony.Name}'s shop");
     }
     if ((_npc.Flags & NPCFlags.Wears) > 0)
     {
         DB_Item entry; byte slot;
         _wears    = new Dictionary <int, InventoryItem>();
         wears_ser = new SER_Wears(_wears);
         foreach (var item in _npc.Wears)
         {
             if (item > 0 && DataMgr.Select(item, out entry))
             {
                 slot = entry.Slot.ToWearableIndex();
                 if (_wears.ContainsKey(slot))
                 {
                     ServerLogger.LogWarn($"NPC id {_data.ObjectID} duplicate wear slot {entry.Slot}");
                 }
                 else
                 {
                     _wears[slot] = new InventoryItem(item);
                 }
             }
         }
     }
     OnSpawn   += WO_NPC_OnSpawn;
     OnDespawn += WO_NPC_OnDespawn;
     OnDestroy += WO_NPC_OnDestroy;
     if ((_npc.Flags & NPCFlags.ScriptedMovement) > 0)
     {
         AddComponent(new ScriptedMovement(original._movement as ScriptedMovement, this));
     }
     else
     {
         AddComponent(new NullMovement(this));
     }
     m_char = new Character(_npc.ID, -1, _npc.Level, -1, _npc.Pony, null);
     Spawn();
 }
コード例 #16
0
        /// <summary>
        /// Imports the reports from iq tools.
        /// </summary>
        /// <param name="overwrite">if set to <c>true</c> [overwrite].</param>
        /// <exception cref="System.NotImplementedException"></exception>
        public void ImportReportsFromIQTools(bool overwrite = false)
        {
            lock (this)
            {
                ClsObject ReportManager = new ClsObject();
                ClsUtility.Init_Hashtable();
                string  queryStatement;
                DataMgr dataManager = new DataMgr();
                //  string sourceDB = dataManager.Reports_DatabaseName;
                // string destinationDB = dataManager.EMR_DatabaseName;

                //if (overwrite)
                //{
                //    queryStatement = "Truncate table dbo.IQToolsExcelReports";

                //    ReportManager.ReturnObject(ClsUtility.theParams, queryStatement, ClsUtility.ObjectEnum.ExecuteNonQuery);
                //    ReportManager.Connection = null;
                //}
                queryStatement = @"SELECT catID,Category FROM aa_Category WHERE  excel=1;";

                DataTable dt = (DataTable)ReportManager.ReturnIQToolsObject(ClsUtility.theParams, queryStatement, ClsDBUtility.ObjectEnum.DataTable, ConnectionMode.REPORT);

                if (dt != null)
                {
                    ReportManager.Connection = null;
                    dt.TableName             = "reports";
                    //dt.Namespace = "fromiqtools";

                    System.IO.StringWriter writer = new System.IO.StringWriter();
                    dt.WriteXml(writer, true);
                    queryStatement = "pr_IQTools_ImportReports";
                    //                      @"Insert Into dbo.IQToolsExcelReports(IQToolsCaTID,ReportName,ReportStylesheet)
                    //                                        Select
                    //                                                a.c.value('catID[1]','int'),
                    //                                                a.c.Category('Category[1]','varchar(200)')
                    //                                        From @x.nodes(//reports) a(c);";
                    ClsUtility.Init_Hashtable();
                    if (overwrite)
                    {
                        ClsUtility.AddParameters("@overwrite", SqlDbType.Bit, (overwrite) ? "1" : "0");
                    }
                    ClsUtility.AddParameters("@data", SqlDbType.Xml, writer.ToString());
                    ReportManager.ReturnObject(ClsUtility.theParams, queryStatement, ClsDBUtility.ObjectEnum.ExecuteNonQuery);
                }


                // return (DataSet)ReportManager.ReturnObject(ClsUtility.theParams, "pr_Reports_Patient_Constella", ClsUtility.ObjectEnum.DataSet);
            }
        }
コード例 #17
0
        private void UnwearItem(WornSlot wslot, byte islot)
        {
            DB_Item item; InventoryItem witem;
            var     index = wslot.Index;

            if (m_wears.TryGetValue(index, out witem))
            {
                if (DataMgr.Select(witem.Id, out item))
                {
                    int itemSlot = islot;
                    if (!GetInventorySlot(islot).IsEmpty)
                    {
                        itemSlot = GetFreeSlot();
                    }
                    if (itemSlot != -1)
                    {
                        if (SetSlot(itemSlot, item, witem, 1) == 0)
                        {
                            m_wears.Remove(index);
                            m_wearSlotsUsed &= ~wslot.Position;
                            m_view.UnwearItem(wslot.Value, m_wearSlotsUsed);
                            if ((item.Flags & ItemFlags.Stats) > 0)
                            {
                                _mPlayer.Stats.UpdateStats();
                            }
                        }
                        else
                        {
                            _player.SystemMsg($"Couldn't unwear item {item.Name}");
                            m_view.WearItem(witem, wslot.Value, m_wearSlotsUsed);
                        }
                    }
                    else
                    {
                        _player.SystemMsg($"You inventory is full");
                        m_view.WearItem(witem, wslot.Value, m_wearSlotsUsed);
                    }
                }
                else
                {
                    _player.SystemMsg($"Item {witem.Id} not found");
                    m_view.WearItem(witem, wslot.Value, m_wearSlotsUsed);
                }
            }
            else
            {
                _player.SystemMsg($"Wear slot {wslot.Position} is empty");
            }
        }
コード例 #18
0
ファイル: BAppointment.cs プロジェクト: kwatuha/IQCareKe
        /// <summary>
        /// Updates the patientppointment details.
        /// </summary>
        /// <param name="AppointmentId">The appointment identifier.</param>
        /// <param name="AppDate">The application date.</param>
        /// <param name="AppReasonId">The application reason identifier.</param>
        /// <param name="UserId">The user identifier.</param>
        /// <param name="AppProviderId">The application provider identifier.</param>
        /// <param name="Updationdate">The updationdate.</param>
        /// <param name="ModuleId">The module identifier.</param>
        /// <param name="AppNote">The application note.</param>
        /// <returns></returns>
        public int UpdatePatientppointmentDetails(int AppointmentId, DateTime AppDate, int AppReasonId, int UserId, int AppProviderId, DateTime Updationdate, int?ModuleId = null, string AppNote = "")
        {
            lock (this)
            {
                try
                {
                    int theAffectedRows = 0;
                    this.Connection  = DataMgr.GetConnection();
                    this.Transaction = DataMgr.BeginTransaction(this.Connection);

                    ClsObject obj = new ClsObject();
                    obj.Connection  = this.Connection;
                    obj.Transaction = this.Transaction;

                    ClsUtility.Init_Hashtable();
                    ClsUtility.AddExtendedParameters("@AppointmentId", SqlDbType.Int, AppointmentId);
                    ClsUtility.AddExtendedParameters("@AppDate", SqlDbType.DateTime, AppDate);
                    ClsUtility.AddExtendedParameters("@AppReasonId", SqlDbType.Int, AppReasonId);
                    ClsUtility.AddExtendedParameters("@UserId", SqlDbType.Int, UserId);
                    ClsUtility.AddExtendedParameters("@AppProviderId", SqlDbType.Int, AppProviderId);
                    ClsUtility.AddExtendedParameters("@Updationdate", SqlDbType.DateTime, Updationdate);
                    if (ModuleId.HasValue)
                    {
                        ClsUtility.AddExtendedParameters("@ModuleId", SqlDbType.Int, ModuleId.Value);
                    }
                    if (AppNote != "")
                    {
                        ClsUtility.AddParameters("@AppNote", SqlDbType.VarChar, AppNote);
                    }
                    theAffectedRows = (int)obj.ReturnObject(ClsUtility.theParams, "pr_Scheduler_UpdatePatientAppointmentDetails_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);

                    DataMgr.CommitTransaction(this.Transaction);
                    DataMgr.ReleaseConnection(this.Connection);
                    return(theAffectedRows);
                }
                catch
                {
                    DataMgr.RollBackTransation(this.Transaction);
                    throw;
                }
                finally
                {
                    if (this.Connection != null)
                    {
                        DataMgr.ReleaseConnection(this.Connection);
                    }
                }
            }
        }
コード例 #19
0
ファイル: BCustomFields.cs プロジェクト: uon-coehm/IQCare
        public int SaveCustomFieldValues(string sqlstr)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject CustomFields = new ClsObject();
                CustomFields.Connection  = this.Connection;
                CustomFields.Transaction = this.Transaction;


                oUtility.Init_Hashtable();
                oUtility.AddParameters("@QryString", SqlDbType.VarChar, sqlstr);

                int RowsAffected = (Int32)CustomFields.ReturnObject(oUtility.theParams, "pr_General_Dynamic_Insert", ClsUtility.ObjectEnum.ExecuteNonQuery);

                /*
                 * if (RowsAffected == 0)
                 * {
                 *  MsgBuilder theBL = new MsgBuilder();
                 *  theBL.DataElements["MessageText"] = "Error in Saving Custom Fields record. Try Again..";
                 *  AppException.Create("#C1", theBL);
                 * }
                 * else
                 * {
                 *  MsgBuilder theBL = new MsgBuilder();
                 *  theBL.DataElements["MessageText"] = "Saved Custom Fields record...";
                 *  AppException.Create("#C1", theBL);
                 * }
                 */

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(RowsAffected);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
コード例 #20
0
ファイル: BKNHMEI.cs プロジェクト: uon-coehm/IQCare
        public int SaveKNHMEILabResult(DataTable theDT, int userId, int PatientId, int VisitId)
        {
            ClsObject KNHMEIManager = new ClsObject();
            int       retlab        = 0;

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                KNHMEIManager.Connection  = this.Connection;
                KNHMEIManager.Transaction = this.Transaction;
                oUtility.Init_Hashtable();

                oUtility.AddParameters("@patientid", SqlDbType.Int, PatientId.ToString());
                oUtility.AddParameters("@Visit_ID", SqlDbType.Int, VisitId.ToString());
                retlab = (int)KNHMEIManager.ReturnObject(oUtility.theParams, "pr_Clinical_DeleteKNHMEILabResult_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);

                foreach (DataRow theDR in theDT.Rows)
                {
                    oUtility.Init_Hashtable();
                    oUtility.AddParameters("@patientid", SqlDbType.Int, PatientId.ToString());
                    oUtility.AddParameters("@LabVisitID", SqlDbType.Int, theDR["LabVisitId"].ToString());
                    oUtility.AddParameters("@Visit_ID", SqlDbType.Int, VisitId.ToString());
                    oUtility.AddParameters("@ParameterId", SqlDbType.Int, theDR["ParameterID"].ToString());
                    oUtility.AddParameters("@PrevResult", SqlDbType.VarChar, theDR["PrevResult"].ToString());
                    oUtility.AddParameters("@PrevResultDate", SqlDbType.VarChar, theDR["PrevResultDate"].ToString());
                    oUtility.AddParameters("@UserId", SqlDbType.Int, userId.ToString());
                    retlab = (int)KNHMEIManager.ReturnObject(oUtility.theParams, "pr_Clinical_SaveKNHMEILabResult_Futures", ClsUtility.ObjectEnum.ExecuteNonQuery);
                }
                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }

            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                KNHMEIManager = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            return(retlab);
        }
コード例 #21
0
ファイル: BDrug.cs プロジェクト: wamathaga/IQCare-4.X.0
        public void SavePharmacyRefill_Web(DataTable dt, int iserId, int dispensedBy, string DispensedByDate, string deleteScript)
        {
            DataTable thePharmacyDT = new DataTable();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);
                ClsObject theManager = new ClsObject();

                foreach (DataRow theDR in dt.Rows)
                {
                    ClsUtility.Init_Hashtable();
                    ClsUtility.AddParameters("@ptn_pharmacy_pk", SqlDbType.Int, theDR["orderId"].ToString());
                    ClsUtility.AddParameters("@drug_pk", SqlDbType.Int, theDR["DrugId"].ToString());
                    ClsUtility.AddParameters("@batchid", SqlDbType.Int, theDR["BatchId"].ToString());
                    //ClsUtility.AddParameters("@DispensedQuantity", SqlDbType.Decimal, theDR["RefillQty"].ToString() == "" ? "0" : theDR["RefillQty"].ToString());
                    ClsUtility.AddParameters("@DispensedQuantity", SqlDbType.Decimal, theDR["QtyDispensed"].ToString() == "" ? "0" : theDR["QtyDispensed"].ToString());
                    ClsUtility.AddParameters("@DispensedBy", SqlDbType.Int, dispensedBy.ToString());
                    if (DispensedByDate.ToString() != "")
                    {
                        ClsUtility.AddParameters("@DispensedByDate", SqlDbType.VarChar, DispensedByDate.ToString());
                    }
                    ClsUtility.AddParameters("@PrintPrescriptionStatus", SqlDbType.Int, theDR["PrintPrescriptionStatus"].ToString() == "True" ? "1" : "0");
                    ClsUtility.AddParameters("@comments", SqlDbType.Int, theDR["comments"].ToString());
                    if (deleteScript != "")
                    {
                        ClsUtility.AddParameters("@deleteScript", SqlDbType.VarChar, deleteScript);
                    }

                    theManager.ReturnObject(ClsUtility.theParams, "pr_SCM_SavePharmacyPartialDispense_Web", ClsDBUtility.ObjectEnum.DataTable);
                }

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
コード例 #22
0
 public ScriptedMovement(ushort id, CreatureObject parent)
     : base(parent)
 {
     _state     = 0;
     _entry     = new SyncEntry();
     _direction = Vector3.UnitZ;
     _position  = _creature.SpawnPosition;
     _rotation  = _creature.SpawnRotation.ToRadians();
     if (DataMgr.Select(id, out _entries))
     {
         Execute();
     }
     parent.OnSpawn   += ScriptedMovement_OnSpawn;
     parent.OnDestroy += ScriptedMovement_OnDestroy;
 }
コード例 #23
0
 // Use this for initialization
 void Start()
 {
     //这里控制是否使用数据库
     useDb = false;
     // 初始化计时时间
     statusTime    = Time.time;
     operationTime = Time.time;
     AllTanks      = topController.AllPlayers;
     manager       = new DataMgr();
     manager.Initial();
     if (useDb && PhotonNetwork.isMasterClient)
     {
         manager.GetGameId();
     }
 }
コード例 #24
0
 public WO_Switch(DB_WorldObject data, ObjectsMgr manager)
     : base(data, manager)
 {
     if (!DataMgr.Select(data.Data01, out m_map))
     {
         ServerLogger.LogError($"Map Switch {data.Guid} map {data.Data01} doesn't exist");
     }
     else
     {
         m_view = _server.Room.SceneViewManager.CreateNetworkedSceneObjectView(_data.Guid);
         m_view.SubscribeToRpc(1, RPC_001);
         OnDestroy += WO_Switch_OnDestroy;
     }
     Spawn();
 }
コード例 #25
0
ファイル: EquipPanel.cs プロジェクト: atom-chen/NewDarkLight
    public void SetPar(Transform trans, EquipModel item)
    {
        GameObject go = GameObject.Instantiate(itemPrefab);

        go.transform.SetParent(trans);
        go.GetComponent <RectTransform>().sizeDelta = new Vector2(50, 50);
        go.transform.localPosition = Vector3.zero;
        go.transform.localScale    = Vector3.one;
        Sprite tempSprite = Resources.Load <Sprite>("Image/" + item.Id);

        go.GetComponent <Image>().sprite = tempSprite;
        Item gm = DataMgr.GetInstance().GetItemByID(item.Id);

        go.GetComponent <BagItem>().Init(gm, tempSprite);
    }
コード例 #26
0
ファイル: CountDown.cs プロジェクト: dennis1009/GameStart
    // Update is called once per frame

    IEnumerator  TimeCountDown()
    {
        while (TotalTime >= 0)
        {
            m_time.text = TotalTime.ToString();
            yield return(new WaitForSeconds(1));

            TotalTime--;
        }
        if (TotalTime <= 0)
        {
            DataMgr.Instance().Init();
            SceneManager.LoadScene(1);
        }
    }
コード例 #27
0
    private void AddChars()
    {
        List <Character> allChar = Fight.Inst.GetAllCharacter(attacker.camp);

        for (int num = 0; num < MaxNum && slots.Count > 0;)
        {
            int      id       = Buff;
            HeroData jsd_hero = DataMgr.GetHero(id);
            if (jsd_hero != null)
            {
                Monster monster = new Monster();
                monster.LV           = attacker.lv;
                monster.STRENGTHENID = attacker.strengthenid;
                monster.Data         = jsd_hero;

                int idx  = Fight.Rand(0, slots.Count);
                int slot = slots[idx];

                Character c = Character.Create(monster);
                c.isFenLie = true;
                c.SetCamp(attacker.camp);
                c.InitUI();
                c.slot   = slot;
                c.SrcPos = Fight.Inst.GetSlotPos(c.camp, slot);
                if (c.camp == CampType.Friend)
                {
                    c.SrcRotation = Quaternion.Euler(new Vector3(0, 90f, 0));
                    c.direction   = new Vector3(1f, 0f, 0f);
                }
                else
                {
                    c.SrcRotation = Quaternion.Euler(new Vector3(0, -90f, 0));
                    c.direction   = new Vector3(-1f, 0f, 0f);
                }
                c.position = attacker.position;
                c.ReqPassiveSkill();
                c.visible = false;

                addChars.Add(c);
                allChar.Add(c);

                slots.RemoveAt(idx);
                ++num;
            }
        }

        Fight.Inst.SortAllChar(attacker.camp);
    }
コード例 #28
0
ファイル: BCustomFields.cs プロジェクト: uon-coehm/IQCare
        public int DeleteCustomFields(int CustomFieldID, int DFlag)
        {
            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                ClsObject CustomFields = new ClsObject();
                CustomFields.Connection  = this.Connection;
                CustomFields.Transaction = this.Transaction;


                oUtility.Init_Hashtable();

                oUtility.AddParameters("@CustomFieldID", SqlDbType.Int, CustomFieldID.ToString());
                oUtility.AddParameters("@ActivateFlag", SqlDbType.Int, DFlag.ToString());
                int RowsAffected = (Int32)CustomFields.ReturnObject(oUtility.theParams, "pr_Admin_DeleteCustomField_Constella", ClsUtility.ObjectEnum.ExecuteNonQuery);

                /*
                 * if (RowsAffected == 0)
                 * {
                 *  MsgBuilder theBL = new MsgBuilder();
                 *  theBL.DataElements["MessageText"] = "Error in Deleting Custom Fields record. Try Again..";
                 *  AppException.Create("#C1", theBL);
                 * }
                 * else
                 * {
                 *
                 * }
                 */

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                return(RowsAffected);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
コード例 #29
0
ファイル: BDrug.cs プロジェクト: uon-coehm/IQCare
        public void SavePharmacyRefill_Web(DataTable dt, int iserId, DateTime DispensedByDate, int patientID, int locationID, string appointmentDate, int userID, int empID)
        {
            DataTable thePharmacyDT = new DataTable();

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);
                ClsObject theManager = new ClsObject();

                foreach (DataRow theDR in dt.Rows)
                {
                    oUtility.Init_Hashtable();
                    oUtility.AddParameters("@ptn_pharmacy_pk", SqlDbType.Int, theDR["orderId"].ToString());
                    oUtility.AddParameters("@drug_pk", SqlDbType.Int, theDR["DrugId"].ToString());
                    oUtility.AddParameters("@batchid", SqlDbType.VarChar, theDR["BatchId"].ToString());
                    oUtility.AddParameters("@DispensedQuantity", SqlDbType.VarChar, theDR["RefillQty"].ToString());
                    oUtility.AddParameters("@DispensedBy", SqlDbType.Int, iserId.ToString());
                    oUtility.AddParameters("@DispensedByDate", SqlDbType.DateTime, DispensedByDate.ToString());
                    oUtility.AddParameters("@comments", SqlDbType.VarChar, theDR["comments"].ToString());

                    oUtility.AddParameters("@Ptn_Pk", SqlDbType.Int, patientID.ToString());
                    oUtility.AddParameters("@LocationId", SqlDbType.Int, locationID.ToString());
                    oUtility.AddParameters("@AppointmentDate", SqlDbType.VarChar, appointmentDate.ToString());
                    oUtility.AddParameters("@UserId", SqlDbType.Int, userID.ToString());
                    oUtility.AddParameters("@EmpID", SqlDbType.Int, empID.ToString());
                    oUtility.AddParameters("@PillCount", SqlDbType.VarChar, theDR["PillCount"].ToString());


                    theManager.ReturnObject(oUtility.theParams, "pr_SCM_SavePharmacyPartialDispense_Web", ClsUtility.ObjectEnum.DataTable);
                }

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
        }
コード例 #30
0
        public int SaveAllergyInfo(int Id, int Ptn_Pk, string AllergyType, string Allergen, string otherAllergen, string severity, string typeReaction, int UserId, int DeleteFlag, string dataAllergy)
        {
            ClsObject FamilyInfo = new ClsObject();
            int       retval     = 0;

            try
            {
                this.Connection  = DataMgr.GetConnection();
                this.Transaction = DataMgr.BeginTransaction(this.Connection);

                FamilyInfo.Connection  = this.Connection;
                FamilyInfo.Transaction = this.Transaction;

                oUtility.Init_Hashtable();
                oUtility.AddParameters("@Id", SqlDbType.Int, Id.ToString());
                oUtility.AddParameters("@Ptn_pk", SqlDbType.Int, Ptn_Pk.ToString());
                oUtility.AddParameters("@vAllergyType", SqlDbType.VarChar, AllergyType.ToString());
                oUtility.AddParameters("@vAllergen", SqlDbType.VarChar, Allergen.ToString());
                oUtility.AddParameters("@votherAllergen", SqlDbType.VarChar, otherAllergen.ToString());
                oUtility.AddParameters("@vTypeReaction", SqlDbType.VarChar, typeReaction.ToString());
                oUtility.AddParameters("@vSeverity", SqlDbType.VarChar, severity.ToString());
                oUtility.AddParameters("@UserId", SqlDbType.Int, UserId.ToString());
                oUtility.AddParameters("@DeleteFlag", SqlDbType.Int, DeleteFlag.ToString());
                oUtility.AddParameters("@DBKey", SqlDbType.VarChar, ApplicationAccess.DBSecurity);
                //if (dataAllergy.DayOfYear != 1)
                //{
                oUtility.AddParameters("@vDataAllergy", SqlDbType.VarChar, dataAllergy.ToString());
                //}
                retval = (int)FamilyInfo.ReturnObject(oUtility.theParams, "Pr_Clinical_SaveAllergyInfo", ClsUtility.ObjectEnum.ExecuteNonQuery);

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
            }
            catch
            {
                DataMgr.RollBackTransation(this.Transaction);
                throw;
            }
            finally
            {
                FamilyInfo = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            return(retval);
        }
コード例 #31
0
ファイル: DataMgr.cs プロジェクト: zhaoyabo/GameBase
    /// <summary>
    /// 获取单利对象
    /// </summary>
    /// <returns></returns>
    public static DataMgr getInstance()
    {
        if (g_instance == null)
        {
            g_instance = new DataMgr();
        }

        return g_instance;
    }
コード例 #32
0
ファイル: DataMgr.cs プロジェクト: blinkstar73/My-TankAttack
 void Awake()
 {
     // 싱글턴 인스턴스 할당
     instance = this;
 }
コード例 #33
0
	void Awake ()
    {
        instance = this;
	}