Ejemplo n.º 1
0
            public void Logout(LogoutCallback callback = null, ExceptionCallback ExCal = null)
            {
                DSRESTCommand cmd = getConnection().CreateCommand();

                cmd.setRequestType(DSHTTPRequestType.GET);
                cmd.setText("TCompanyTweet.Logout");
                cmd.prepare(get_TCompanyTweet_Logout_Metadata());
                InternalConnectionDelegate LogoutDel = () =>
                {
                    if (callback != null)
                    {
                        try
                        {
                            callback.DynamicInvoke();
                        }
                        catch (Exception ex)
                        {
                            if (ExCal != null)
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => ExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                            else
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => BaseExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                        }
                    }
                };

                getConnection().execute(cmd, this, LogoutDel, ExCal);
            }
Ejemplo n.º 2
0
            public void LoginUser(String UserName, LoginUserCallback callback = null, ExceptionCallback ExCal = null)
            {
                DSRESTCommand cmd = getConnection().CreateCommand();

                cmd.setRequestType(DSHTTPRequestType.GET);
                cmd.setText("TCompanyTweet.LoginUser");
                cmd.prepare(get_TCompanyTweet_LoginUser_Metadata());
                InternalConnectionDelegate LoginUserDel = () =>
                {
                    if (callback != null)
                    {
                        try
                        {
                            LoginUserReturns ret = new LoginUserReturns();
                            ret.ReturnMessage = cmd.getParameter(1).getValue().GetAsString();
                            ret.returnValue   = cmd.getParameter(2).getValue().GetAsBoolean();
                            callback.DynamicInvoke(ret);
                        }
                        catch (Exception ex)
                        {
                            if (ExCal != null)
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => ExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                            else
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => BaseExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                        }
                    }
                };

                cmd.getParameter(0).getValue().SetAsString(UserName);
                getConnection().execute(cmd, this, LoginUserDel, ExCal);
            }
Ejemplo n.º 3
0
            public void SetUsersToFollow(TJSONArray Users, SetUsersToFollowCallback callback = null, ExceptionCallback ExCal = null)
            {
                DSRESTCommand cmd = getConnection().CreateCommand();

                cmd.setRequestType(DSHTTPRequestType.POST);
                cmd.setText("TCompanyTweet.SetUsersToFollow");
                cmd.prepare(get_TCompanyTweet_SetUsersToFollow_Metadata());
                InternalConnectionDelegate SetUsersToFollowDel = () =>
                {
                    if (callback != null)
                    {
                        try
                        {
                            callback.DynamicInvoke();
                        }
                        catch (Exception ex)
                        {
                            if (ExCal != null)
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => ExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                            else
                            {
                                getConnection().syncContext.Send(new SendOrPostCallback(x => BaseExCal.DynamicInvoke(ex.InnerException)), null);
                            }
                        }
                    }
                };

                cmd.getParameter(0).getValue().SetAsJSONValue(Users);
                getConnection().execute(cmd, this, SetUsersToFollowDel, ExCal);
            }