Exemplo n.º 1
0
        public async static Task <Dsave_return> Save_exception(string Base, string Key, string Salt, Dictionary <string, object> Claims, Dictionary <string, object> bp)
        {
            var  Dr  = new Dsave_return();
            Mret M1  = null;
            var  Bpl = new Dictionary <string, object>(bp);

            Bpl["Call_vector"] = 6725;
            string Token = Enc256.Encode(Key, Salt, Claims);

            try
            {
                M1 = await Get_Data(Base, Token, Bpl);

                //   M1 = await Cli.Request().PostJsonAsync(Bpl).ReceiveJson<Mret>();
                if (M1.status == 200)
                {
                    Dr = JsonConvert.DeserializeObject <Dsave_return>(M1.body);
                }
                else
                {
                    Dr.code    = M1.status;
                    Dr.message = M1.message;
                }
            }
#pragma warning disable CS0168 // Variable is declared but never used
            catch (FlurlHttpException ex)
#pragma warning restore CS0168 // Variable is declared but never used
            {
                MessageBox.Show(ex.Message);
            }

            return(Dr);
        }
Exemplo n.º 2
0
        public async static Task <Dsave_return> Pat_delete_aysnc(string Base, string Key, string Salt, Dictionary <string, object> Claims, Dictionary <string, object> bp)
        {
            var  Dr  = new Dsave_return();
            Mret M1  = null;
            var  Bpl = new Dictionary <string, object>(bp);

            Bpl["Call_vector"] = 5184;
            string Token = Enc256.Encode(Key, Salt, Claims);

            try
            {
                M1 = await Get_Data(Base, Token, Bpl);

                if (M1.status == 200)
                {
                    Dr = JsonConvert.DeserializeObject <Dsave_return>(M1.body);
                }
                else
                {
                    Dr.code    = M1.status;
                    Dr.message = M1.message;
                }
            }
#pragma warning disable CS0168 // Variable is declared but never used
            catch (FlurlHttpException ex)
#pragma warning restore CS0168 // Variable is declared but never used
            {
                //    int i = 1;
            }
            //  }

            return(Dr);
        }
Exemplo n.º 3
0
        public async static Task <Dsave_return> Dsave_get_aysnc(string Base, string Key, string Salt, Dictionary <string, object> Claims, Dictionary <string, object> bp)
        {
            var  Dvr = new Dsave_return();
            Mret M1  = null;
            var  Bpl = new Dictionary <string, object>(bp);

            if (File.Exists("dsave_get_return.json"))
            {
                using (var sr = new StreamReader("dsave_get_return.json"))
                {
                    string l1d = sr.ReadToEnd();
                    Dvr = JsonConvert.DeserializeObject <Dsave_return>(l1d);
                    return(Dvr);
                }
            }

            Bpl["Call_vector"] = 7943;
            string Token = Enc256.Encode(Key, Salt, Claims);

            try
            {
                M1 = await Get_Data(Base, Token, Bpl);

                if (M1.status == 200)
                {
                    Dvr = JsonConvert.DeserializeObject <Dsave_return>(M1.body);
                }
                else
                {
                    Dvr.code    = M1.status;
                    Dvr.message = M1.message;
                }
            }
#pragma warning disable CS0168 // Variable is declared but never used
            catch (FlurlHttpException ex)
#pragma warning restore CS0168 // Variable is declared but never used
            {
                //   int i = 1;
            }

            return(Dvr);
        }