コード例 #1
0
        public void Post([FromUri] Pfile items)
        {
            //    Encryption.Encrypt
            try
            {
                result = falseresult("ข้อมูลไม่ถูกต้อง");
                CustomerMapDao map = new CustomerMapDao();
                int            _id = MobileEncryption.Decrypt(items.ID.UrlDescriptHttp()).Toint();
                string         Key = MobileEncryption.Decrypt(items.UserKeys.UrlDescriptHttp());
                var            Obj = map.FindByActive().Where(o => o.ID == _id && o.Keygen == Key).FirstOrDefault();
                if (Obj != null)
                {
                    SaveAccount.UpdateUser(Obj.ID, items.TitleID, items.Fname, items.Lname, items.DateOfBirth, items.OccupationID, items.SalaryID, items.Address, items.ProvinceID, items.PrefectureID, items.DistrictID, items.ZipCode,
                                           items.Tel, items.Tel_ext, items.Mobile, items.Fax, items.Email);
                    result = Trueresult("แก้ไขข้อมูลเรียบร้อย");
                }
                else
                {
                    result = falseresult("ข้อมูลไม่ถูกต้อง");
                }
            }
            catch (Exception ex)
            {
                SaveUtility.logError(ex);
                result = falseresult(ex.Message);
            }

            HttpContext.Current.Response.ContentType = "application/json";
            HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
            HttpContext.Current.Response.End();
        }
コード例 #2
0
        public ActionResult Complain(List <ComplainFileUploadModel> Step3ObjectData)
        {
            ComplainStep1 Step1 = (ComplainStep1)TempData["_ComplainStep1"];
            ComplainStep2 Step2 = (ComplainStep2)TempData["_ComplainStep2"];

            if (Step1 == null || Step2 == null)
            {
                return(RedirectToAction("Complain", "Manage"));
            }
            string _refID = "";


            int CompId = SaveComplain.AddnewComplain(Step1.Complain_Subject, 1, Helplibery.GetUserID(), Step1.CompanyName, Step1.CompanyDescription,
                                                     Step2.Description, Step2.ComplainID, Step2.lv1, Step2.Tm_CauseID, Step2.PurchaseID, null, Step2.PaymentID, null, Step2.MotiveID, null, Step1.attorneyLog, null, ref _refID);

            SaveComplain.StartTrack(CompId, 1, null, null);

            SaveUtility.SaveComplainFileUpload(Step3ObjectData, CompId);

            //SaveComplain.StartTrack(CompId);
            TempData.Clear();


            return(RedirectToAction("Confirm", "Manage"));
        }
コード例 #3
0
 public void _MChange(string Identity, string Email)
 {
     result = falseresult("ข้อมูลไม่ถูกต้อง");
     try
     {
         OCPB.Controllers.HomeController obj = new HomeController();
         var _resultMChange = obj._Forget(MobileEncryption.Decrypt(Identity.UrlDescriptHttp()), MobileEncryption.Decrypt(Email.UrlDescriptHttp()));
         if (_resultMChange.Status == true)
         {
             result = Trueresult(_resultMChange);
         }
         else
         {
             result = falseresult(_resultMChange);
         }
     }
     catch (Exception ex)
     {
         SaveUtility.logError(ex);
         result = falseresult(ex.Message);
     }
     HttpContext.Current.Response.ContentType = "application/json";
     HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
     HttpContext.Current.Response.End();
 }
コード例 #4
0
    public void CreateTextureFromSaveFile(TileMapSaveData st, SaveUtility saveUtility, LevelTilemap target)
    {
        Texture2D tex   = new Texture2D(st.sizeX, st.sizeY);
        var       datas = target.GetTileLevelDataFromSaveFile(st);

        for (int x = 0; x < st.sizeX; x++)
        {
            for (int y = 0; y < st.sizeY; y++)
            {
                tex.SetPixel(x, y, datas[x + y * st.sizeX].editorColor);
            }
        }
        // Encode texture into PNG
        byte[] bytes = tex.EncodeToPNG();

        //UnityEditor.AssetDatabase.CreateAsset(tex, "Assets/"+saveUtility.fileName+".asset");

        Object.DestroyImmediate(tex);

        //var asset = UnityEditor.AssetDatabase.LoadAssetAtPath<Texture2D>(saveUtility.path + saveUtility.fileName + ".png");

        //asset.filterMode = FilterMode.Point;
        File.WriteAllBytes(saveUtility.GetPath("png"), bytes);
        UnityEditor.AssetDatabase.Refresh();
    }
コード例 #5
0
ファイル: AudioManager.cs プロジェクト: AndreaMaffe/SPIKE
    public void Start()
    {
        if (SceneManager.GetActiveScene().buildIndex == 0) //schermata home
        {
            Play("landing");
        }
        else if (SceneManager.GetActiveScene().buildIndex == 1) //SampleSceneRange
        {
            Play("build");
            Play("play");
            Mute("play");
        }

        saveManager = SaveManager.SaveManagerInstance;
        saveManager = SaveUtility.LoadObject(saveManager, "saveFile");
        //Debug.Log("Volume musica iniziale: " + saveManager.musicVolume);
        FindSoundSlider();
        if (musicToggle)
        {
            if (saveManager.musicVolume)
            {
                musicToggle.isOn     = false;
                AudioListener.volume = 1f;
            }
            else
            {
                musicToggle.isOn     = true;
                AudioListener.volume = 0;
            }
        }
    }
コード例 #6
0
        // PUT api/mcomplain/5
        //public void Put(int id, [FromBody]string value)
        //{
        //}

        // DELETE api/mcomplain/5
        public void Delete(string ID, string UserKeys, string Description, string Case_id, int CancelID)
        {
            result = falseresult("ข้อมูลไม่ถูกต้อง");
            try
            {
                CustomerMapDao CusMap = new CustomerMapDao();
                int            _id    = MobileEncryption.Decrypt(ID.UrlDescriptHttp()).Toint();
                string         Key    = MobileEncryption.Decrypt(UserKeys.UrlDescriptHttp());
                var            Cus    = CusMap.FindByActive().Where(o => o.ID == _id && o.Keygen == Key).FirstOrDefault();
                if (Cus != null)
                {
                    ComplainsMapDao Map     = new ComplainsMapDao();
                    var             CompObj = Map.FindByCustomerID(Cus.ID).Where(o => o.Complain_Code_ID == Case_id).FirstOrDefault();
                    if (CompObj != null)
                    {
                        SaveComplain.Cancel(CompObj.Keygen, Description, CancelID);
                        result = Trueresult("ยกเลิกข้อมูลสำเร็จ");
                    }
                    else
                    {
                        result = falseresult("ไม่พบข้อมูล");
                    }
                }
            }
            catch (Exception ex)
            {
                SaveUtility.logError(ex);
                result = falseresult(ex.Message);
            }

            HttpContext.Current.Response.ContentType = "application/json";
            HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
            HttpContext.Current.Response.End();
        }
コード例 #7
0
ファイル: ClueController.cs プロジェクト: wachara-yanu/OCPB
 public ActionResult Index(Clue obj, bool captchaValid, List <HttpPostedFileBase> Filename)
 {
     if (captchaValid)
     {
         if (ModelState.IsValid)
         {
             ClueMapDao clueMap = new ClueMapDao();
             if (obj.ID == 0)
             {
                 obj.Active     = true;
                 obj.CreateDate = DateTime.Now;
                 obj.Keygen     = Guid.NewGuid().ToString();
             }
             obj.Complain_Channel_id = 1;//เรื่องร้องทุกข์ Online
             clueMap.Add(obj);
             clueMap.CommitChange();
             SaveUtility.SaveClueFileUpload(Filename, "Clue", obj.Keygen);
             return(RedirectToAction("ClueModal", "Clue"));
         }
     }
     TempData.Clear();
     ModelState.AddModelError("", "ข้อมูลไม่ถูกต้อง");
     MvcCaptcha.ResetCaptcha("ClueCaptcha");
     return(View(obj));
 }
コード例 #8
0
ファイル: SaveUtility.cs プロジェクト: khill25/Carbon-editor
    public static void LoadAll()
    {
        // key "classType" is in every saved object
        // and is used when restoring the game object
        // we can Load the resource with that type by passing it in via reflection
        JSON json = new JSON();

        using (StreamReader s = new StreamReader("itemList.json")) {
            try {
                string rawFile = s.ReadToEnd();
                json.serialized = rawFile;
            } catch (IOException e) {
            }
        }

        foreach (JSON child in json.ToArray <JSON>("nodes"))
        {
            JSON        node               = child["node"] as JSON;
            string      assemblyName       = node["classType"] as string;
            System.Type type               = typeof(SaveUtility).Assembly.GetType(assemblyName);
            System.Collections.ArrayList l = SaveUtility.Load(node, assemblyName, type);
        }

        // Now that all the objects are loaded we can go ahead and set up the connections
        ObjectManager.instance.SetupAllNodes();

        foreach (int id in ObjectManager.instance.allNodes.Keys)
        {
            GameObject o    = ObjectManager.instance.allNodes[id];
            NodePrefab node = o.GetComponent <NodePrefab>();

            Debug.Log("NodeId: " + node.nodeId + "\n" + "Children: " + node.childNodes.Count
                      + "/n" + "Parents: " + node.connectedFromNodes.Count);
        }
    }
コード例 #9
0
ファイル: HomeController.cs プロジェクト: wachara-yanu/OCPB
 public ActionResult Nation(IdentityCheck obj, string mode)
 {
     try
     {
         if (ModelState.IsValid)
         {
             CustomerMapDao map = new CustomerMapDao();
             if (map.FindIdentityCard(obj.IdentStr).Count == 0)
             {
                 return(Json(new ResultData()
                 {
                     Status = true, text = Url.Action("Register", "Home", new { mode = mode, key = Encryption.Encrypt(obj.IdentStr) })
                 }, JsonRequestBehavior.AllowGet));
                 //return Json(new { RedirectUrl =  });
             }
             else
             {
                 //return Json("Is Dupplicate!!!",JsonRequestBehavior.AllowGet );
                 return(Json(new ResultData()
                 {
                     Status = false, text = "Is Dupplicate!!!"
                 }, JsonRequestBehavior.AllowGet));
             }
         }
     }
     catch (Exception ex)
     {
         SaveUtility.logError(ex);
     }
     return(Json(new ResultData()
     {
         Status = false, text = "ข้อมูลไม่ถูกต้อง"
     }, JsonRequestBehavior.AllowGet));
 }
コード例 #10
0
        public void _GetTimelineHeader_From_Dep(string tokenId, int skip, int take)
        {
            if (string.IsNullOrEmpty(tokenId))
            {
                result = falseresult("UnAuthorized.");
            }
            //string key = Encryption.Decrypt(tokenId);
            //if (!IsValidateToken(key))
            //    result = falseresult("UnAuthorized.");
            if (!IsValidateToken(tokenId))
            {
                result = falseresult("UnAuthorized.");
            }


            if (skip < 1)
            {
                skip = 1;
            }

            if (take < 1)
            {
                take = 20;
            }

            try
            {
                AuthenticateTokenMapDao _authenMap = new AuthenticateTokenMapDao();

                //var objToken = _authenMap.FindByKeygen(key).FirstOrDefault();



                Department_ExMapDao _departMap = new Department_ExMapDao();

                //if (objToken != null)
                //{

                var Dep_ex = _departMap.FindByKeygen(TokenValid.ApiKey).FirstOrDefault();

                var comList = ComplainData.GetTimelineHeader_From_Dep(Dep_ex.ID);
                SaveUtility.SaveTransactionLog(TokenValid.ApiKey, "Get Time line Header", SaveUtility.TransStatus.Create, TokenValid.Keygen, IPAddress, "s");    //s: service
                result = Trueresult(comList);
                //}
                //else
                //{
                //    result = falseresult("UnAuthorized.");
                //}
            }
            catch (Exception ex)
            {
                SaveUtility.logError(ex);
                result = falseresult(ex.Message);
            }

            HttpContext.Current.Response.ContentType = "application/json";
            HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
            HttpContext.Current.Response.End();
        }
コード例 #11
0
        public void GetAttachmentFiles(string tokenId, string Case_Id)
        {
            //if (string.IsNullOrEmpty(tokenId))
            //    result = falseresult("UnAuthorized.");

            if (string.IsNullOrEmpty(tokenId))
            {
                result = falseresult("UnAuthorized.");
            }
            if (!IsValidateToken(tokenId))
            {
                result = falseresult("UnAuthorized.");
            }

            if (string.IsNullOrEmpty(Case_Id))
            {
                result = falseresult("Please provide Case Id.");
            }
            AuthenticateTokenMapDao _authenMap = new AuthenticateTokenMapDao();
            ComplainsMapDao         _Map       = new ComplainsMapDao();

            try
            {
                //var objToken = _authenMap.FindByKeygen(key).FirstOrDefault();
                //if (objToken != null)
                //{
                //********************* Get Complain list*********************
                //CaseID= Complain_Cause_id
                var comList = ComplainData.GetfileUploadByCaseId(TokenValid.ApiKey, Case_Id).Select(o => new
                {
                    o.Description,
                    o.Complain_file_ID,
                    o.FileName,
                    o.FileType,
                    o.CreateDate,
                    o.GUID
                }).ToList();
                SaveUtility.SaveTransactionLog(TokenValid.ApiKey, "Get Attachment Files", SaveUtility.TransStatus.Create, TokenValid.ApiKey, IPAddress, "s");    //s: service
                result = Trueresult(comList);
                // }
                //else
                //{
                //    result = falseresult("UnAuthorized.");
                //}
            }
            catch (Exception ex)
            {
                SaveUtility.logError(ex);
                result = falseresult(ex.Message);
            }
            finally
            {
                _Map       = null;
                _authenMap = null;
            }
            HttpContext.Current.Response.ContentType = "application/json";
            HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
            HttpContext.Current.Response.End();
        }
コード例 #12
0
        protected void TokenData(string APIKey, string Password)
        {
            if (string.IsNullOrEmpty(APIKey))
            {
                result = falseresult("UnAuthorized...");
            }

            else if (string.IsNullOrEmpty(Password))
            {
                result = falseresult("Please provide Password...");
            }

            else if (string.IsNullOrEmpty(IPAddress))
            {
                result = falseresult("Please provide IP Address...");
            }

            //if (!CheckPassEnscrypt(Password, ref Password))
            //{ result = falseresult("UnAuthorized..."); }
            else
            {
                Department_ExMapDao map = new Department_ExMapDao();
                try
                {
                    OfficerToken _token   = new OfficerToken();
                    string       newToken = Guid.NewGuid().ToString();
                    string       _Pass    = Encryption.Encrypt(Password);
                    var          _obj     = map.FindByKeygen(APIKey.Trim());

                    var obj = _obj.Where(o => o.Password == _Pass).FirstOrDefault();
                    if (obj != null)
                    {
                        GetAuthToken(_token, APIKey, newToken, IPAddress);
                        //_token.Username = "";
                        //_token.Org_id = obj.ID.ToString();
                        _token.Org_name    = obj.External_dept_Name;
                        _token.Office_name = obj.External_dept_Name;
                        SaveUtility.SaveTransactionLog(newToken, "GetToken", SaveUtility.TransStatus.Create, APIKey, IPAddress, "s"); //s: service
                        result = Trueresult(_token);
                    }
                    else
                    {
                        result = falseresult("Invalid Token and Password...");
                    }
                }
                catch (Exception ex)
                {
                    SaveUtility.logError(ex);
                    result = falseresult(ex.Message.ToString());
                }
                finally
                {
                    map = null;
                }
            }
            HttpContext.Current.Response.ContentType = "application/json";
            HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
            HttpContext.Current.Response.End();
        }
コード例 #13
0
    public void SetFXVolume(float volume)
    {
        FxVolume = (fxEnabled) ? volume : 0;
        fxVolumeEvent?.Invoke(volume);

        save.fxVolume = volume;
        SaveUtility.WriteConfig(save);
    }
コード例 #14
0
    public void SetMusicVolume(float volume)
    {
        MusicVolume = (musicEnabled) ? volume : 0;
        musicVolumeEvent?.Invoke(volume);

        save.musicVolume = volume;
        SaveUtility.WriteConfig(save);
    }
コード例 #15
0
ファイル: LevelTilemap.cs プロジェクト: claudyy/TileMap
    public void CreateSaveFile(TileMapSaveData st, SaveUtility saveUtility)
    {
        XmlSerializer serializer = new XmlSerializer(typeof(TileMapSaveData));
        FileStream    stream     = new FileStream(saveUtility.GetPath(), FileMode.Create);

        serializer.Serialize(stream, st);
        stream.Close();
# if UNITY_EDITOR
コード例 #16
0
ファイル: HomeController.cs プロジェクト: wachara-yanu/OCPB
        public ActionResult RegisterTH(Customer obj)
        {
            try
            {
                ModelState.Remove("IdentityID");
                if (ModelState.IsValid)
                {
                    obj.IdentityID = obj.tempIden.UrlDescriptHttp();

                    /*
                     * var rst = _RegisterTH(obj);
                     * if(rst.Status == true)
                     * {
                     * rst.text = Url.Action("Index", "Home");
                     * }
                     */

                    //return Json(rst,JsonRequestBehavior.AllowGet);

                    CustomerMapDao map = new CustomerMapDao();
                    if (map.FindIdentityCard(obj.IdentityID).Count == 0)
                    {
                        //obj.IdentityID = obj.IdentValid.UrlDescriptHttp();
                        int            ID      = SaveAccount.Register(obj.IdentityID, obj.TitleID, obj.Fname, obj.Lname, obj.Sex, obj.DateOfBirthStr, obj.Address, obj.DistrictID, obj.PrefectureID, obj.ProvinceID, obj.ZipCode, obj.Tel, obj.Tel_ext, obj.Mobile, obj.Fax, obj.Email, obj.OccupationID, obj.SalaryID, obj.TypeCustomer, obj.FromApp, obj.IsOversea);
                        CustomerMapDao _CusMap = new CustomerMapDao();
                        obj = _CusMap.FindById(ID);
                        if (!string.IsNullOrEmpty(obj.Email))
                        {
                            SendEmail.SendMail(obj.Email, "สํานักงานคณะกรรมการคุ้มครองผู้บริโภค ยินดีต้อนรับเข้าสู่การเป็นสมาชิก", RenderPartialViewToString("regisTemplate", obj));
                            //SendMail.Send(obj.Email, "สํานักงานคณะกรรมการคุ้มครองผู้บริโภค ยินดีต้อนรับเข้าสู่การเป็นสมาชิก", RenderPartialViewToString("ChangePassword", obj));
                        }

                        if (!string.IsNullOrEmpty(obj.Mobile))
                        {
                            //SmsLibs.SendSMS(obj.Mobile, SmsLibs.TypeMessage.register);
                            SmsLibs.SendSMS(obj.Mobile, string.Format(SmsLibs.CallStr(SmsLibs.TypeMessage.register), obj.IdentityID, Encryption.Decrypt(obj.Password)));
                        }

                        return(Json(new ResultData()
                        {
                            Status = true, text = Url.Action("Index", "Home")
                        }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new ResultData()
                        {
                            Status = false, text = Resources.Message.MsgDuplicate
                        }, JsonRequestBehavior.AllowGet));
                    }
                }
            }
            catch (Exception ex)
            {
                SaveUtility.logError(ex);
            }
            return(View(obj));
        }
コード例 #17
0
    public void Execute()
    {
        int availableSaveSlot = SaveUtility.GetAvailableSaveSlot();

        saveSlot.Value = availableSaveSlot;

        SceneManager.LoadScene(firstScene.Value);
        SceneManager.LoadScene(playerScene.Value, LoadSceneMode.Additive);
    }
コード例 #18
0
    public void Execute(int slotNumber)
    {
        saveSlot.Value = slotNumber;

        SaveGame getSaveGame = SaveUtility.LoadSave(slotNumber);

        SceneManager.LoadScene(getSaveGame.lastScene);
        SceneManager.LoadScene(playerScene.Value, LoadSceneMode.Additive);
    }
コード例 #19
0
    private void WriteSaveToFile()
    {
        TimeSpan currentTimePlayed = DateTime.Now - cachedSaveData.saveDate;
        TimeSpan allTimePlayed     = cachedSaveData.timePlayed;

        cachedSaveData.timePlayed = allTimePlayed + currentTimePlayed;

        SaveUtility.WriteSave(cachedSaveData, saveSlot.Value);
    }
コード例 #20
0
        public void Load(string creatureName)
        {
            Clear();

            CreatureData data = JsonUtility.FromJson <CreatureData>(SaveUtility.Load(creatureName + ".json"));

            for (int i = 0; i < data.bones.Count; i++)
            {
                Bone bone = data.bones[i];
                Add(i, bone.Position, bone.Rotation, bone.Size);
            }
            for (int i = 0; i < data.attachedBodyParts.Count; i++)
            {
                AttachedBodyPart attachedBodyPart = data.attachedBodyParts[i];

                BodyPartController bpc = Instantiate(DatabaseManager.GetDatabaseEntry <BodyPart>("Body Parts", attachedBodyPart.BodyPartID).Prefab, root.GetChild(attachedBodyPart.BoneIndex)).GetComponent <BodyPartController>();
                bpc.gameObject.name = attachedBodyPart.BodyPartID;

                SerializableTransform.RecurseUpdate(bpc.transform, attachedBodyPart.Transform);

                SetupBodyPart(bpc);
                AttachBodyPart(bpc);
                AddToStatistics(bpc.name);

                if (Mathf.Abs(bpc.transform.position.x) > settings.MergeThreshold)
                {
                    bpc.Flipped.transform.position = new Vector3(-bpc.transform.position.x, bpc.transform.position.y, bpc.transform.position.z);
                    bpc.Flipped.transform.rotation = Quaternion.Euler(bpc.transform.rotation.eulerAngles.x, -bpc.transform.rotation.eulerAngles.y, -bpc.transform.rotation.eulerAngles.z);

                    if (bpc is LimbController)
                    {
                        LimbController limb        = bpc as LimbController;
                        LimbController flippedLimb = limb.FlippedLimb;

                        for (int j = 0; j < limb.Bones.Length; j++)
                        {
                            float x = -limb.Bones[j].position.x;
                            float y = limb.Bones[j].position.y;
                            float z = limb.Bones[j].position.z;

                            flippedLimb.Bones[j].position = new Vector3(x, y, z);
                        }
                    }
                }
                else
                {
                    bpc.Flipped.gameObject.SetActive(false);
                }
            }
            SetColours(data.primaryColour, data.secondaryColour);
            SetPattern(data.patternID);

            SetSelected(false);
            SetTextured(Textured);
            SetInteractable(Interactable);
        }
コード例 #21
0
ファイル: LoadManager.cs プロジェクト: chameleonkid/Secrets
    public void ClickLoadButton()
    {
        loadPanel.SetActive(true);

        var saveNames = SaveUtility.GetSaveNames();

        saveSlot1.GetComponentInChildren <Text>().text = saveNames[0];
        saveSlot2.GetComponentInChildren <Text>().text = saveNames[1];
        saveSlot3.GetComponentInChildren <Text>().text = saveNames[2];
    }
コード例 #22
0
    public void Start()
    {
        numberIfDeathsText.text = LevelManager.TotalNumberOfDeaths.ToString();
        allButtons = new GameObject[levelAmountTest];
        //Carichiamo l'oggetto SaveManager per ottenere i dati salvati del gioco
        saveManager = SaveManager.SaveManagerInstance;
        saveManager = SaveUtility.LoadObject(saveManager, "saveFile");

        CreateLevelButtons();
    }
コード例 #23
0
ファイル: SavePoint.cs プロジェクト: chameleonkid/Secrets
    private void Awake()
    {
        saveMenu.SetActive(false);

        var saveNames = SaveUtility.GetSaveNames();

        saveSlot1.text = saveNames[0];
        saveSlot2.text = saveNames[1];
        saveSlot3.text = saveNames[2];
    }
コード例 #24
0
        public void _SaveClue(string tokenId, string title, string description, string Consumer_firstname, string Consumer_lastname, string Consumer_Email, string Consumer_Mobile, string address, string Amphur_text, string Province_text)
        {
            if (string.IsNullOrEmpty(tokenId))
            {
                result = falseresult("UnAuthorized.");
            }
            //string key = Encryption.Decrypt(tokenId);
            //if (!IsValidateToken(key))
            //    result = falseresult("UnAuthorized.");

            if (!IsValidateToken(tokenId))
            {
                result = falseresult("UnAuthorized.");
            }

            ClueMapDao clueMap = new ClueMapDao();
            AuthenticateTokenMapDao _authenMap = new AuthenticateTokenMapDao();
            Department_ExMapDao     _departMap = new Department_ExMapDao();

            //var objToken = _authenMap.FindByKeygen(key).FirstOrDefault();
            try
            {
                int? ChannelID = _departMap.FindByKeygen(TokenValid.ApiKey).FirstOrDefault().ChanelID;
                Clue obj       = new Clue();
                obj.Active              = true;
                obj.CreateDate          = DateTime.Now;
                obj.Keygen              = Guid.NewGuid().ToString();
                obj.Title               = title;
                obj.Address             = address;
                obj.Description         = description;
                obj.Amphur_text         = Amphur_text;
                obj.Province_text       = Province_text;
                obj.Complain_Channel_id = ChannelID;
                obj.Fname               = Consumer_firstname;
                obj.Lname               = Consumer_lastname;
                obj.Mobile              = Consumer_Mobile;
                obj.Email               = Consumer_Email;
                clueMap.Add(obj);
                clueMap.CommitChange();
                SaveUtility.SaveTransactionLog(obj.Keygen, "Save Clue", SaveUtility.TransStatus.Create, TokenValid.Keygen, IPAddress, "s"); //s: service
                clueMap = null;
                result  = Trueresult("ระบบได้รับคำแจ้งเบาแสเรียบร้อยแล้ว");
            }
            catch (Exception ex)
            {
                clueMap    = null;
                _authenMap = null;
                SaveUtility.logError(ex);
                result = falseresult(ex.Message);
            }
            HttpContext.Current.Response.ContentType = "application/json";
            HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
            HttpContext.Current.Response.End();
        }
コード例 #25
0
 public virtual void StartDeath()
 {
     player.SetActiveRagdoll(true);
     SpawnBloodParticles();
     LevelManager.NumberOfDeaths      += 1;
     LevelManager.TotalNumberOfDeaths += 1;
     saveManager = SaveManager.SaveManagerInstance;
     saveManager = SaveUtility.LoadObject(saveManager, "saveFile");
     saveManager.totalDeathsCounter = LevelManager.TotalNumberOfDeaths;
     SaveUtility.SaveObject(saveManager, "saveFile");
     GameObject.Find("NumberOfAttemptsText").GetComponent <Text>().text = "NUMBER OF DEATHS: " + LevelManager.NumberOfDeaths;
 }
コード例 #26
0
    public void ToggleMusic()
    {
        musicEnabled = !musicEnabled;

        MusicVolume = (musicEnabled) ? save.musicVolume : 0;

        musicMutedEvent?.Invoke(!musicEnabled);

        save.musicEnabled = musicEnabled;

        SaveUtility.WriteConfig(save);
    }
コード例 #27
0
    private static void SaveStarsNumber()
    {
        SaveManager saveManager = SaveManager.SaveManagerInstance;

        saveManager = SaveUtility.LoadObject <SaveManager>(saveManager, "saveFile");

        if (saveManager.stars[CurrentLevelIndex] < GetNumberOfStars())
        {
            saveManager.stars[CurrentLevelIndex] = GetNumberOfStars();
            SaveUtility.SaveObject(saveManager, "saveFile");
        }
    }
コード例 #28
0
    public void ToggleSound()
    {
        fxEnabled = !fxEnabled;

        FxVolume = (fxEnabled) ? save.fxVolume : 0;

        fxMutedEvent?.Invoke(!fxEnabled);

        save.fxEnabled = fxEnabled;

        SaveUtility.WriteConfig(save);
    }
コード例 #29
0
        //[HttpGet]
        //public void GetToken(string APIKey, string Password)
        //{
        //    string IPAddress = HttpContext.Current.Request.UserHostAddress;
        //    if (string.IsNullOrEmpty(APIKey))
        //        result = falseresult("UnAuthorized...");

        //    if (string.IsNullOrEmpty(Password))
        //        result = falseresult("Please provide Password...");

        //    if (string.IsNullOrEmpty(IPAddress))
        //        result = falseresult("Please provide IP Address...");

        //    //if (!CheckPassEnscrypt(Password, ref Password))
        //    //{ result = falseresult("UnAuthorized..."); }
        //    else
        //    {

        //        Department_ExMapDao map = new Department_ExMapDao();
        //        try
        //        {
        //            OfficerToken _token = new OfficerToken();
        //            string newToken = Guid.NewGuid().ToString();
        //            var obj = map.FindByKeygen(APIKey).Where(o => o.Password == Encryption.Encrypt(Password)).FirstOrDefault();
        //            if (obj != null)
        //            {
        //                GetAuthToken(_token, APIKey, newToken, IPAddress);
        //                //_token.Username = "";
        //                //_token.Org_id = obj.ID.ToString();
        //                _token.Org_name = obj.External_dept_Name;
        //                _token.Office_name = obj.External_dept_Name;
        //                SaveUtility.SaveTransactionLog(newToken, "GetToken", SaveUtility.TransStatus.Create, APIKey, IPAddress, "s"); //s: service
        //                result = Trueresult(_token);
        //            }
        //            else
        //            {
        //                result = falseresult("Invalid Token and Password...");
        //            }
        //        }
        //        catch (Exception ex)
        //        {
        //            SaveUtility.logError(ex);
        //            result = falseresult(ex.Message.ToString());
        //        }
        //        finally
        //        {
        //            map = null;
        //        }
        //    }
        //    HttpContext.Current.Response.ContentType = "application/json";
        //    HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
        //    HttpContext.Current.Response.End();
        //}
        //[HttpPost]
        //public void GetToken([FromBody]string value)
        //{
        //    //string IPAddress = HttpContext.Current.Request.UserHostAddress;
        //    //if (string.IsNullOrEmpty(APIKey))
        //    //    result = falseresult("UnAuthorized...");

        //    //if (string.IsNullOrEmpty(Password))
        //    //    result = falseresult("Please provide Password...");

        //    //if (string.IsNullOrEmpty(IPAddress))
        //    //    result = falseresult("Please provide IP Address...");

        //    ////if (!CheckPassEnscrypt(Password, ref Password))
        //    ////{ result = falseresult("UnAuthorized..."); }
        //    //else
        //    //{

        //    //    Department_ExMapDao map = new Department_ExMapDao();
        //    //    try
        //    //    {
        //    //        OfficerToken _token = new OfficerToken();
        //    //        string newToken = Guid.NewGuid().ToString();
        //    //        var obj = map.FindByKeygen(APIKey).Where(o => o.Password == Encryption.Encrypt(Password)).FirstOrDefault();
        //    //        if (obj != null)
        //    //        {
        //    //            GetAuthToken(_token, APIKey, newToken, IPAddress);
        //    //            //_token.Username = "";
        //    //            //_token.Org_id = obj.ID.ToString();
        //    //            _token.Org_name = obj.External_dept_Name;
        //    //            _token.Office_name = obj.External_dept_Name;
        //    //            SaveUtility.SaveTransactionLog(newToken, "GetToken", SaveUtility.TransStatus.Create, APIKey, IPAddress, "s"); //s: service
        //    //            result = Trueresult(_token);
        //    //        }
        //    //        else
        //    //        {
        //    //            result = falseresult("Invalid Token and Password...");
        //    //        }
        //    //    }
        //    //    catch (Exception ex)
        //    //    {
        //    //        SaveUtility.logError(ex);
        //    //        result = falseresult(ex.Message.ToString());
        //    //    }
        //    //    finally
        //    //    {
        //    //        map = null;
        //    //    }
        //    //}
        //    HttpContext.Current.Response.ContentType = "application/json";
        //    HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
        //    HttpContext.Current.Response.End();
        //}


        #endregion



        //  [WebMethod(Description = "Get Timeline Header เป็นเมธอดสำหรับใช้ดึงข้อมูล ที่เกียวข้องกับหน่วยงานนั้นๆ <br />"
        //+ "Skip: ลำดับข้อมูลที่ต้องการเริ่มต้น เช่น เริ่มแถวที่ 1 <br />"
        //+ "take: จำนวนข้อมูลที่ต้องการ เช่น 10 ,20 แถว<br />"
        //+ "IsCloseJob: สถานะเรืองร้องทุกข์ (null=ทั้งหมด ,0=กำลังดำเนินการ ,1=ยุติการดำเนินการ)")]
        public void GetTimelineHeader(string tokenId, int skip, int take, string IsCloseJob)
        {
            if (string.IsNullOrEmpty(tokenId))
            {
                result = falseresult("UnAuthorized.");
            }
            string key = Encryption.Decrypt(tokenId);

            if (!IsValidateToken(key))
            {
                result = falseresult("UnAuthorized.");
            }



            if (skip < 1)
            {
                skip = 1;
            }

            if (take < 1)
            {
                take = 20;
            }

            try
            {
                AuthenticateTokenMapDao _authenMap = new AuthenticateTokenMapDao();

                var objToken = _authenMap.FindByKeygen(key).FirstOrDefault();
                if (objToken != null)
                {
                    var comList = ComplainData.GetComplainTimeLine(objToken.ApiKey, skip, take, 0, null);
                    SaveUtility.SaveTransactionLog(objToken.ApiKey, "Get Time line Header", SaveUtility.TransStatus.Create, key, objToken.Owner_ip, "s"); //s: service
                    result = Trueresult(comList);
                }
                else
                {
                    result = falseresult("UnAuthorized.");
                }
            }
            catch (Exception ex)
            {
                SaveUtility.logError(ex);
                result = falseresult(ex.Message);
            }

            HttpContext.Current.Response.ContentType = "application/json";
            HttpContext.Current.Response.Write(JsonConvert.SerializeObject(result));
            HttpContext.Current.Response.End();
        }
コード例 #30
0
    public override void OnLoadSystem()
    {
        cachedSaveData = SaveUtility.LoadSave(saveSlot.Value);

        if (cachedSaveData == null)
        {
            CreateNewSave();
            isNewGame = true;
        }

        onSceneWarp?.AddListener(OnSceneWarp);
        onWarpStart?.AddListener(OnWarpStart);
        onWarpEnd?.AddListener(OnWarpEnd);
    }