예제 #1
0
        public async Task <IActionResult> PostFB(IFormFile uploads, string Text, string Person, string PersonLink)
        {
            string path1 = "/images/" + uploads.FileName;

            if (path1 == null)
            {
                path1 = "";
            }

            using (var fileStream = new FileStream(appEnvironment.WebRootPath + path1, FileMode.Create))
            {
                await uploads.CopyToAsync(fileStream);
            }
            Image image = new Image()
            {
                ImagePath = path1
            };

            imageManager.Insert(image);
            var fb = new FaceBook()
            {
                FBPost     = Text,
                PersonName = Person,
                PersonLink = PersonLink,
                Image_Id   = image.Id,
                Date       = DateTime.Now
            };

            faceBookManager.Insert(fb);

            return(RedirectToAction("FaceBook"));
        }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        //btn_Toggle.isChecked

        if (loading)
        {
            picture.fid = fid;
            if (!FaceBook.getfriendImages().ContainsKey(fid))
            {
                FacebookPictureDownloader.EnQueue(fid);

                /*
                 * FB.API(Util.GetPictureURL(fid, 128, 128), Facebook.HttpMethod.GET, pictureResult =>
                 * {
                 *  if (pictureResult.Error != null)
                 *  {
                 *      Debug.LogError(pictureResult.Error);
                 *  }
                 *  else
                 *  {
                 *      FaceBook.getfriendImages().Add(fid.ToString(), pictureResult.Texture);
                 *  }
                 * });
                 */
            }

            loading = false;
        }
    }
예제 #3
0
        private void postStatus()
        {
            try
            {
                //btnPostStatus.Enabled = false;
                int iCountDo = 0;
                while (iCountDo < gridData.Rows.Count)
                {
                    iCountDo = 0;
                    int iIndex = 0;
                    for (; iIndex < gridData.Rows.Count; iIndex++)
                    {
                        FaceBookController fbController = gridData.Rows[iIndex].Tag as FaceBookController; //gridData[GridConst.Controller, iIndex].Value as FaceBookController;
                        //Check account die
                        FaceBook fb = gridData.Rows[iIndex].DataBoundItem as FaceBook;
                        if (fb.Status != null && fb.Status != 1)
                        {
                        }
                        else
                        {
                            fb = DataProvider.DB.FaceBook.Find(fb.ID);
                        }
                        if (fb != null && fb.Status != null && fb.Status != 1)
                        {
                            fbController.SetStatusChanged("Having problems with this account");
                            iCountDo++;
                            continue;
                        }
                        //Check not update status
                        var posted = DataProvider.DB.PostStatus.Where(m => m.FaceBookID == fb.ID && m.SessionID == workingSession.ID).ToList();
                        if (posted.Count > 0)
                        {
                            fbController.SetStatusChanged("This account has Posted Status in this Session");
                            iCountDo++;
                            continue;
                        }

                        //Check Still working
                        if (fbController.IsWorking)
                        {
                            continue;
                        }
                        //Post status
                        fbController.PostStatus();
                        if (!fbController.WorkingFail)
                        {
                            //Sleep 1 minutes
                            System.Threading.Thread.Sleep(120000);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                TMessage.ShowException(ex);
            }
            finally
            {
            }
        }
예제 #4
0
 public string UploadPhoto(FaceBook model, string strLink)
 {
     try
     {
         Dictionary <string, object> dicData = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(model.MBLoginText);
         if (!string.IsNullOrEmpty(strLink))
         {
             NameValueCollection param = new NameValueCollection();
             param.Add("access_token", dicData["access_token"].ToString());
             param.Add("format", "json");
             param.Add("method", "post");
             param.Add("pretty", "0");
             param.Add("suppress_http_code", "1");
             param.Add("url", strLink);
             WebClientEx clientAPI = new WebClientEx();
             clientAPI.DoPost(param, "https://graph.facebook.com/v2.1/me/photos");
             if (!string.IsNullOrEmpty(clientAPI.ResponseText))
             {
                 dicData = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(clientAPI.ResponseText);
                 if (dicData.ContainsKey("id"))
                 {
                     string id = dicData["id"].ToString();
                     return(id);
                 }
             }
         }
     }
     catch { }
     return(string.Empty);
 }
예제 #5
0
    public void RequestButton()
    {
        SceneTitle.ButtonClickSound();
        string receiverFidList = "";

        // Server 전송

        foreach (RequestFriendItem temp in requestlist)
        {
            if (temp.btn_Toggle.value)
            {
                // Server Send Message. Or Send List.
                receiverFidList += temp.Fid + ",";
            }
        }

        if (!receiverFidList.Equals(""))
        {
            receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);

            try
            {
                string str = Localization.Localize("3017");
                FaceBook.CallAppRequestAsDirectRequestMessage("Invite You", CMainData.Username + str, receiverFidList, Callback);
            }
            catch (System.Exception e)
            {
                Debug.Log(e.Message);
            }
        }
    }
예제 #6
0
    public void sendButton(string fid)
    {
        ButtonClickSound();

        if (SceneGameOver.g_instance != null)
        {
            if (SceneGameOver.g_instance.buttonClickable)
            {
                /*if (GameOver_ServerConnection.g_instance != null)
                 * {
                 *  GameOver_ServerConnection.g_instance.SendMessage(fid, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1, checkSendMsg);
                 * }
                 */

                tempFid = fid;

                try
                {
                    FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), fid, Callback);// " 님이 당신에게 주사위를 선물했습니다.", fid);
                    //status = "Direct Request called";
                }
                catch (System.Exception e)
                {
                    Debug.Log(e.Message);
                }

                /*
                 * if (ServerConnection.g_instance != null)
                 * {
                 *  ServerConnection.g_instance.SendMessage(fid, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1, checkSendMsg);
                 * }
                 */
            }
        }
    }
예제 #7
0
        /// <summary>
        /// Send request from Model 1 to Model 2
        /// </summary>
        /// <param name="model1"></param>
        /// <param name="model2"></param>
        /// <returns></returns>
        public bool SendFriendRequest(FaceBook model1, FaceBook model2)
        {
            try
            {
                WebClientEx client = new WebClientEx();
                client.RequestType = WebClientEx.RequestTypeEnum.FaceBook;
                Dictionary <string, object> dicData = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(model1.MBLoginText);
                client.Authorization = dicData["access_token"].ToString();

                NameValueCollection param = new NameValueCollection();
                param.Add("uid", model2.FBID);
                param.Add("hf", "profile_button");
                param.Add("ref", "pb_likes");
                param.Add("format", "json");
                param.Add("locale", "en_US");
                param.Add("client_country_code", "VN");
                param.Add("fb_api_req_friendly_name", "sendFriendRequest");
                param.Add("fb_api_caller_class", "com.facebook.friends.protocol.SendFriendRequestMethod");

                client.DoPost(param, "https://graph.facebook.com/me/friends");
                if (!string.IsNullOrEmpty(client.ResponseText) && (client.ResponseText == "true" ||
                                                                   client.ResponseText.Contains("There is already a pending friend request to this user")))
                {
                    return(true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(false);
        }
예제 #8
0
        private void reloadGrid()
        {
            if (txtPackNo.SelectedItem is FBPackage)
            {
                FBPackage selectedPackage = txtPackNo.SelectedItem as FBPackage;
                gridData.DataSource = selectedPackage.FaceBooks;
                for (int iIndex = 0; iIndex < gridData.Columns.Count; iIndex++)
                {
                    gridData.Columns[iIndex].Visible = false;
                }
                gridData.Columns[TableFaceBookConst.Login].Visible  = true;
                gridData.Columns[TableFaceBookConst.Login].Width    = 200;
                gridData.Columns[TableFaceBookConst.Login].SortMode = DataGridViewColumnSortMode.NotSortable;

                DataGridViewTextBoxColumn colStt = new DataGridViewTextBoxColumn();
                colStt.Name       = GridMainFormConst.STT;
                colStt.HeaderText = GridMainFormConst.STT;
                colStt.Width      = 50;
                colStt.SortMode   = DataGridViewColumnSortMode.NotSortable;
                gridData.Columns.Insert(0, colStt);

                DataGridViewTextBoxColumn colStatus = new DataGridViewTextBoxColumn();
                colStatus.Name       = GridMainFormConst.Status;
                colStatus.HeaderText = GridMainFormConst.Status;
                colStatus.Width      = 300;
                colStatus.SortMode   = DataGridViewColumnSortMode.NotSortable;
                gridData.Columns.Insert(1, colStatus);

                for (int iIndex = 0; iIndex < gridData.Rows.Count; iIndex++)
                {
                    FaceBook fb = gridData.Rows[iIndex].DataBoundItem as FaceBook;
                    gridData[GridMainFormConst.STT, iIndex].Value = iIndex + 1;
                }
            }
        }
예제 #9
0
        public string GetFaceBookLoginURL(FaceBook model, string strDestURl)
        {
            string strURl = string.Empty;

            try
            {
                Dictionary <string, object> dicData = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(model.MBLoginText);
                string secret      = dicData["secret"].ToString();
                string session_key = dicData["session_key"].ToString();

                NameValueCollection param = new NameValueCollection();
                param.Add("api_key", AppSettings.api_key);
                param.Add("session_key", session_key);
                param.Add("t", Utilities.GetCurrentSecond());
                param.Add("uid", model.FBID);
                param.Add("url", strDestURl);

                string sig = Utilities.getSignFB(param, secret);
                //param.Add("sig", sig);

                strURl = "https://m.facebook.com/auth.php?api_key="
                         + AppSettings.api_key
                         + "&session_key=" + session_key
                         + "&sig=" + sig
                         + "&t=" + param["t"]
                         + "&uid=" + model.FBID
                         + "&url=" + param["url"];
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(strURl);
        }
예제 #10
0
        private void NuoiNick(int rowIndex)
        {
            Task t = new Task(() =>
            {
                if (!TaoChrome(rowIndex))
                {
                    return;
                }
                var facebook = new FaceBook(dgvAccounts, rowIndex, chromeDriver[rowIndex]);
                var rsLogin  = facebook.DangNhap();
                if (!rsLogin.rs)
                {
                    dgvAccounts["status", rowIndex].Value = "Đăng nhập thất bại";
                    return;
                }
                dgvAccounts["status", rowIndex].Value = "Đi tương tác";

                for (int i = 0; i < Convert.ToInt32(numberAction.Text); i++)
                {
                    CheckStopAppAuto(rowIndex);
                    facebook.TrithongMinh(1, chromeDriver[rowIndex]);
                    dgvAccounts["status", rowIndex].Value = $"Xong tương tác số {i + 1}";
                    ChoClickButtonFB(rowIndex, $"thao tác  {i + 2}");
                }
            });

            t.Start();
        }
예제 #11
0
        /// <summary>
        /// Model 1 accept friend Request from Model2
        /// </summary>
        /// <param name="model1"></param>
        /// <param name="model2"></param>
        /// <returns></returns>
        public bool AcceptFriendRequest(FaceBook model1, FaceBook model2)
        {
            try
            {
                WebClientEx client = new WebClientEx();
                client.RequestType = WebClientEx.RequestTypeEnum.FaceBook;
                Dictionary <string, object> dicData = new JavaScriptSerializer().Deserialize <Dictionary <string, object> >(model1.MBLoginText);
                client.Authorization = dicData["access_token"].ToString();

                NameValueCollection param = new NameValueCollection();
                param.Add("uid", model2.FBID);
                param.Add("confirm", "1");
                param.Add("ref", "m_jewel");
                param.Add("format", "json");
                param.Add("locale", "en_US");
                param.Add("client_country_code", "VN");
                param.Add("fb_api_req_friendly_name", "respondToFriendRequest");
                param.Add("method", "facebook.friends.confirm");
                param.Add("fb_api_caller_class", "com.facebook.friends.protocol.RespondToFriendRequestMethod");

                client.DoPost(param, "https://api.facebook.com/method/facebook.friends.confirm");
                if (!string.IsNullOrEmpty(client.ResponseText) && client.ResponseText == "true")
                {
                    return(true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(false);
        }
예제 #12
0
    public void HelpMessage(string fid, FriendTogetherItem helpObject)
    {
        SceneTitle.ButtonClickSound();

        tempSendFid    = fid;
        tempHelpObject = helpObject;

        all = false;

        try
        {
            FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), fid, Callback);//" 님이 당신에게 주사위를 선물했습니다.", fid);
            //status = "Direct Request called";
        }
        catch (Exception e)
        {
            Debug.Log(e.Message);
        }

        /*if (Title_ServerConnection.g_instance != null)
         * {
         *  sendList.Add(fid);
         *  Title_ServerConnection.g_instance.SendMessage(fid, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
         * }*/
        /*
         * if (ServerConnection.g_instance != null)
         * {
         *  sendList.Add(fid);
         *  ServerConnection.g_instance.SendMessage(fid, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
         * }
         */
    }
예제 #13
0
 void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         this.Enabled = false;
         FaceBook fb = new FaceBook();
         fb.Login = this.txtUserName.Text.Trim();
         fb.Pass  = this.txtPassword.Text.Trim();
         FaceBookController fbController = new FaceBookController();
         if (fbController.LoginMobile(fb))
         {
             this.model = fb;
             this.Close();
         }
         else
         {
             MessageBox.Show("Không thể đăng nhập !");
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         this.Enabled = true;
     }
 }
예제 #14
0
 private void menuLoginAgain_Click(object sender, EventArgs e)
 {
     if (gridData.Rows.Count > 0)
     {
         FaceBook           model        = gridData.Rows[gridData.CurrentCell.RowIndex].DataBoundItem as FaceBook;
         FaceBookController fbController = new FaceBookController();
         if (fbController.LoginMobile(model))
         {
             Global.DBContext.SaveChanges();
             gridData[GridMainFormConst.Status, gridData.CurrentCell.RowIndex].Value = "Đăng nhập thành công";
         }
         else
         {
             if (MessageBox.Show("Đăng nhập thất bại ! Xóa ?", "", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
             {
                 Global.DBContext.FaceBook.Remove(model);
                 Global.DBContext.SaveChanges();
                 reloadGrid();
             }
             else
             {
                 gridData[GridMainFormConst.Status, gridData.CurrentCell.RowIndex].Value = "Đăng nhập thất bại";
             }
         }
     }
 }
예제 #15
0
 private void uploadProfilePhoto(bool bDoAll)
 {
     try
     {
         MobileModermController.Disconnect();
         MobileModermController.Connect();
         List <Task> tasks = new List <Task>();
         for (int iIndex = 0; iIndex < gridData.Rows.Count; iIndex++)
         {
             if (this.IsDisposed)
             {
                 return;
             }
             FaceBook model = gridData.Rows[iIndex].DataBoundItem as FaceBook;
             //bool bPostOK = new FaceBookController().ChangeProfilePhoto(model);
             tasks.Add(Task.Factory.StartNew(() =>
             {
                 int iIndexPost       = iIndex;
                 bool bPostOK         = new FaceBookController().ChangeProfilePhoto(model);
                 MethodInvoker action = delegate
                 {
                     if (bPostOK)
                     {
                         gridData[GridMainFormConst.Status, iIndexPost].Value = "Upload Profile Photo OK";
                     }
                     else
                     {
                         gridData[GridMainFormConst.Status, iIndexPost].Value = "Upload Profile Photo Fail";
                     }
                 };
                 this.BeginInvoke(action);
             }));
             System.Threading.Thread.Sleep(1000);
         }
         while (tasks.Any(t => !t.IsCompleted))
         {
             Application.DoEvents();
             System.Threading.Thread.Sleep(1000);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         isBusy = false;
         if (!this.IsDisposed)
         {
             MethodInvoker action = delegate
             {
                 if (!bDoAll)
                 {
                     btnUploadProfilePhoto.Enabled = true;
                 }
             };
             this.BeginInvoke(action);
         }
     }
 }
예제 #16
0
    public void SetInit(int rank, string fid, string name, string score, string sendable, bool me)
    {
        this.fid = fid;

        if (this.label_rank != null)
        {
            this.label_rank.text = rank.ToString();
        }
        if (this.label_name != null)
        {
            this.label_name.text = name;
        }
        if (this.label_score != null)
        {
            this.label_score.text = score;
        }

        if (sendable.Equals("1"))
        {
            this.sendable = true;
        }
        else
        {
            this.sendable = false;
        }

        this.me = me;

        if (me)
        {
            label_rank.color = new Color(13.0f / 255.0f, 150.0f / 255.0f, 150.0f / 255.0f);
            this.sendable    = false;
            sendBtn.SetActive(false);
        }
        else if (this.sendable)
        {
            sendBtn.SetActive(true);
            sendunable.SetActive(false);
        }
        else
        {
            sendBtn.SetActive(true);
            sendunable.SetActive(true);
        }

        if (!me && rank > 3)
        {
            label_rank.color = new Color(8.0f / 255.0f, 8.0f / 255.0f, 8.0f / 255.0f);
        }

        picture.fid = fid;

        if (!FaceBook.getfriendImages().ContainsKey(fid))
        {
            FacebookPictureDownloader.EnQueue(fid);
        }

        this.init = true;
    }
예제 #17
0
 private void copyPassToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (gridData.Rows.Count > 0)
     {
         FaceBook model = gridData.Rows[gridData.CurrentCell.RowIndex].DataBoundItem as FaceBook;
         Clipboard.SetText(model.Pass);
     }
 }
예제 #18
0
    public void SendMessageAll()
    {
        SceneTitle.ButtonClickSound();
        // Server 전송

        string receiverFidList = "";

        foreach (FriendTogetherItem temp in currentList)
        {
            bool check = false;
            foreach (string t in sendList)
            {
                if (t.Equals(temp.Fid))
                {
                    check = true;
                    break;
                }
            }

            if (!check)
            {
                receiverFidList += temp.Fid + ",";
            }
        }

        if (!receiverFidList.Equals(""))
        {
            receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);
            //Debug.Log("receiver list is " + receiverFidList);

            /*if (Title_ServerConnection.g_instance != null)
             * {
             *  Title_ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
             * }*/

            tempSendFid = receiverFidList;
            all         = true;

            try
            {
                FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), receiverFidList, Callback);//+ " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
            }
            catch (System.Exception e)
            {
                Debug.Log(e.Message);
            }

            /*
             * if (ServerConnection.g_instance != null)
             * {
             *  ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
             * }
             */
        }

        //cleanData();
    }
예제 #19
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            string DBConnectionString = Configuration.GetConnectionString("diricoConnectionString");

            services.AddDbContext <diricoDBContext>(options => options.UseSqlServer(DBConnectionString));

            // Inject Azure Service --Singleton
            services.AddSingleton <IBlobConnectionFactory, AzureBlobConnectionFactory>();
            services.AddSingleton <IImageAnalyzer, AzureImageAnalyzer>();

            // Inject Loger service
            services.AddSingleton <ILoggerManager, LoggerManager>();

            // Inject Image and Video Services and Repository
            services.AddScoped <IBlobService, AzureBlobService>();
            services.AddScoped <IVideoConverter, AzureVideoConverter>();
            services.AddScoped <IImageConverter, AzureImageConverter>();
            services.AddScoped <IAssetRepository, AssetRepository>();

            //VariantAsset Config
            FaceBook faceBook = new FaceBook(null, null);
            Twitter  twitter  = new Twitter(null, null);

            VariantAssetConfig.Instance
            .AddSocialNetwork(faceBook)
            .AddSocialNetwork(twitter);



            // Allow All region in CORS
            services.AddCors(o => o.AddPolicy("AllowOrigin", builder =>
            {
                builder.AllowAnyOrigin()
                .AllowAnyMethod()
                .AllowAnyHeader();
            }));


            //services.ConfigureLoggerService();

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            // Add Swager Service
            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("v1", new Info {
                    Title = "dirico Task", Version = "v1"
                });
            });

            services.AddApiVersioning(options =>
            {
                options.ApiVersionReader = new QueryStringApiVersionReader();
                options.AssumeDefaultVersionWhenUnspecified = true;
                options.ApiVersionSelector = new CurrentImplementationApiVersionSelector(options);
            });
        }
예제 #20
0
        static void Main()
        {
            Common.Version = "v2.11";
            Common.Token   = "EAAAAUaZA8jlABABEm7uVeQlyDoF7M7lJxj08WwO4oROL4MN1QY3Lh0CyZCWg3g1ORUWnsBPQohviY3kIBTQUwKxxbqzQwdmhPuENR4CbS5MNZCNWhCYoWIW2eTgQTGIIHdnYe8PfAGNhKIJQrhk8LIxcuG3vZAEZD";
            var feed = FaceBook.GetHome(FaceBook.GetFriends("me", "1000"), "200");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
예제 #21
0
    public void RequestButton()
    {
        SceneTitle.ButtonClickSound();

        string receiverFidList = "";

        // Server 전송

        foreach (RequestFriendItem temp in ItemList)
        {
            if (temp.btn_Toggle.value && temp.Fid != null)
            {
                // Server Send Message. Or Send List.
                receiverFidList += temp.Fid + ",";
            }
        }

        if (!receiverFidList.Equals(""))
        {
            receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);

            tempFid = receiverFidList;

            //Debug.Log("receiver list is " + receiverFidList);

            //Title_ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);

            try
            {
                FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), receiverFidList, Callback);// + " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
                //status = "Direct Request called";
            }
            catch (System.Exception e)
            {
                Debug.Log(e.Message);
            }

            /*
             * if (ServerConnection.g_instance != null)
             * {
             *  ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1);
             * }
             */
        }

        /*
         * this.gameObject.SetActive(false);
         *
         * if (SceneTitle.instance != null)
         * {
         *  SceneTitle.instance.changeIsMain(true);
         * }
         */
    }
예제 #22
0
        private void uploadPhotoAndCoiverToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Task task = Task.Factory.StartNew(() =>
            {
                FaceBookController fbController = new FaceBookController();
                FaceBook model = gridData.Rows[gridData.SelectedCells[0].RowIndex].DataBoundItem as FaceBook;
                fbController.UpdatePhotoAndCover(model);
            });

            task.Wait();
        }
예제 #23
0
    public void acceptMessage(string fid, int type)
    {
        SceneTitle.ButtonClickSound();

        foreach (Message temp in CMainData.message)
        {
            if (temp.Fid.Equals(fid) && temp.Type == type)
            {
                //Server로 데이터 전송

                /*if (Title_ServerConnection.g_instance != null)
                 * {
                 *  Title_ServerConnection.g_instance.ReceiveMessage(temp, (int)RECEIVEMESSAGEACTIONTYPE.ACCEPT);
                 *
                 *  CMainData.message.Remove(temp);
                 *  temp.Obj.transform.parent = this.gameObject.transform.parent;
                 *  Destroy(temp.Obj);
                 * }*/

                if (type != 3)
                {
                    if (ServerConnection.g_instance != null)
                    {
                        ServerConnection.g_instance.ReceiveMessage(temp, (int)RECEIVEMESSAGEACTIONTYPE.ACCEPT);

                        CMainData.message.Remove(temp);
                        temp.Obj.transform.parent = this.gameObject.transform.parent;
                        Destroy(temp.Obj);
                    }
                }
                else
                {
                    tempMessageObj = temp;
                    try
                    {
                        FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), temp.Fid, Callback);// + " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
                        //status = "Direct Request called";
                    }
                    catch (System.Exception e)
                    {
                        Debug.Log(e.Message);
                    }
                }

                break;
            }
        }
        if (label_message_num != null)
        {
            label_message_num.text = StringData.getString(StringData.label_message_num_key).Replace("%s", CMainData.message.Count.ToString());
        }
        messageGrid.repositionNow = true;
    }
예제 #24
0
 private void menuReNameToUSAll_Click(object sender, EventArgs e)
 {
     for (int iINdex = 0; iINdex < gridData.Rows.Count; iINdex++)
     {
         FaceBook           model        = gridData.Rows[iINdex].DataBoundItem as FaceBook;
         FaceBookController fbController = new FaceBookController();
         fbController.RenameToUS(model);
         if (Global.DBContext.ChangeTracker.HasChanges())
         {
             Global.DBContext.SaveChanges();
         }
     }
 }
예제 #25
0
 private void menuReNameToUS_Click(object sender, EventArgs e)
 {
     if (gridData.Rows.Count > 0)
     {
         FaceBook           model        = gridData.Rows[gridData.CurrentCell.RowIndex].DataBoundItem as FaceBook;
         FaceBookController fbController = new FaceBookController();
         fbController.RenameToUS(model);
         if (Global.DBContext.ChangeTracker.HasChanges())
         {
             Global.DBContext.SaveChanges();
         }
     }
 }
예제 #26
0
 private void feedAccessTokenToolStripMenuItem_Click(object sender, EventArgs e)
 {
     for (int iINdex = 0; iINdex < gridData.Rows.Count; iINdex++)
     {
         Task task = Task.Factory.StartNew(() =>
         {
             FaceBookController fbController = new FaceBookController();
             FaceBook model = gridData.Rows[iINdex].DataBoundItem as FaceBook;
             fbController.FeedAccessToken(model);
         });
         task.Wait();
     }
 }
예제 #27
0
    public void RequestButton()
    {
        SceneTitle.ButtonClickSound();
        // Server 전송

        string receiverFidList = "";

        foreach (RequestFriendItem temp in requestlist)
        {
            if (temp.btn_Toggle.value)
            {
                // Server Send Message. Or Send List.
                receiverFidList += temp.Fid + ",";
            }
        }

        if (!receiverFidList.Equals(""))
        {
            receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);

            tempFid = receiverFidList;

            //Debug.Log("receiver list is " + receiverFidList);

            /*
             * if (Title_ServerConnection.g_instance != null)
             * {
             *  Title_ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.HELP + 1);
             * }
             */

            try
            {
                string str = Localization.Localize("3016");
                Debug.Log(CMainData.Username + str);
                FaceBook.CallAppRequestAsDirectRequestMessage("Dice Request", CMainData.Username + str, receiverFidList, Callback);
            }
            catch (System.Exception e)
            {
                Debug.Log(e.Message);
            }

            /*
             * if (ServerConnection.g_instance != null)
             * {
             *  ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.HELP + 1);
             * }
             */
        }
    }
예제 #28
0
    public void allMessage()
    {
        ButtonClickSound();

        if (SceneGameOver.g_instance != null)
        {
            if (SceneGameOver.g_instance.buttonClickable)
            {
                if (SceneGameOver.ResultInstance != null)
                {
                    string receiverFidList = "";
                    foreach (Ranking_MsgSend temp in ranking_msg)
                    {
                        if (temp.Sendable && !receiverFidList.Contains(temp.Fid))
                        {
                            receiverFidList += temp.Fid + ",";
                        }
                    }

                    if (!receiverFidList.Equals(""))
                    {
                        receiverFidList = receiverFidList.Substring(0, receiverFidList.Length - 1);
                        //Debug.Log("receiver list is " + receiverFidList);

                        tempFid = receiverFidList;

                        allBtn.SetActive(false);
                        //GameOver_ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1, checkSendMsg);

                        try
                        {
                            FaceBook.CallAppRequestAsDirectRequestMessage("Help You!", CMainData.Username + " " + Localization.Localize("3018"), receiverFidList, Callback);// " 님이 당신에게 주사위를 선물했습니다.", receiverFidList);
                            //status = "Direct Request called";
                        }
                        catch (System.Exception e)
                        {
                            Debug.Log(e.Message);
                        }

                        /*
                         * if (ServerConnection.g_instance != null)
                         * {
                         *  ServerConnection.g_instance.SendMessage(receiverFidList, (int)SENDMESSAGEACTIONTYPE.NORMAL + 1, checkSendMsg);
                         * }
                         */
                    }
                }
            }
        }
    }
예제 #29
0
 private void menuCopyURL_Click(object sender, EventArgs e)
 {
     if (gridData.Rows.Count > 0)
     {
         FaceBook           model        = gridData.Rows[gridData.CurrentCell.RowIndex].DataBoundItem as FaceBook;
         FaceBookController fbController = new FaceBookController();
         string             strURL       = fbController.GetFaceBookLoginURL(model, "https://www.facebook.com/me");
         if (!string.IsNullOrEmpty(strURL))
         {
             Clipboard.SetText(strURL);
             //MessageBox.Show("Đã copy URL vào clipboad");
         }
     }
 }
예제 #30
0
        private void RunMenu(ActionMenu actionMenu, int rowIndex)
        {
            Task t = new Task(() =>
            {
                if (!TaoChrome(rowIndex))
                {
                    return;
                }
                var facebook = new FaceBook(dgvAccounts, rowIndex, chromeDriver[rowIndex]);
                if (actionMenu == ActionMenu.OpenChrome)
                {
                    return;
                }
                else
                {
                    var rsLogin = facebook.DangNhap();
                    if (!rsLogin.rs)
                    {
                        return;
                    }
                    switch (actionMenu)
                    {
                    case ActionMenu.OpenFacebook:
                        break;

                    case ActionMenu.BackUpFacebookOnlyImageFriend:
                        facebook.BackUpFacebookOnlyImageFriend(chromeDriver[rowIndex], rowIndex);
                        break;

                    case ActionMenu.BackUpFacebookAll:
                        facebook.BackUpFacebookAll(chromeDriver[rowIndex], rowIndex);
                        break;

                    case ActionMenu.ChayDangKiHana:
                        break;

                    case ActionMenu.QuetThanhVienGroup:
                        facebook.QuetThanhVienGroup(chromeDriver[rowIndex], rowIndex);
                        break;

                    case ActionMenu.CommentGroup:
                        break;
                    }
                }
            });

            t.Start();
        }