Ejemplo n.º 1
0
        private void button10_Click(object sender, EventArgs e)
        {
            DataAcquisitionResult result = new DataAcquisitionResult();
            List <TaskListBDTO>   dtos   = new List <TaskListBDTO>();
            TaskListBDTO          dto    = new TaskListBDTO();

            dto.processid = 50291;
            dtos.Add(dto);
            dto           = new TaskListBDTO();
            dto.processid = 50381;
            dtos.Add(dto);
            string server = "http://localhost:15988/api/TeamTask/DeleteTaskList";
            TaskListAPIParameterB param = new TaskListAPIParameterB();

            param.operator_name = "WebApi";
            param.operator_time = GenerateTimeStamp(DateTime.Now);
            param.sign          = GenSign(param.operator_name, param.operator_time);
            param.data          = dtos;
            Dictionary <string, string> dic = new Dictionary <string, string>();

            dic.Add("operator_name", param.operator_name);
            dic.Add("operator_time", param.operator_time);
            dic.Add("sign", param.sign);
            dic.Add("strdata", Serialize(param.data));

            try
            {
                HttpWebResponse        response = CreatePostHttpResponse(server, dic, null, null, Encoding.UTF8, null);
                System.IO.StreamReader sr       = new System.IO.StreamReader(response.GetResponseStream());
                string responseContent          = sr.ReadToEnd();
                sr.Close();

                DataAcquisitionResult rtn = Deserialize <DataAcquisitionResult>(responseContent);
                if (rtn.code != "1000")
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                return;
            }
        }
Ejemplo n.º 2
0
        public bool DeleteTaskList(TaskListBDTO dto)
        {
            bool fla = false;

            try
            {
                int       re   = 0;
                DbService ds   = new DbService(dbnfin, "MySQL");
                string    srt  = string.Format(@"delete  from Sys_TaskList where process_id={0}", dto.processid);
                int       sult = ds.DeleteSql(srt);
                if (sult > 0)
                {
                    fla = true;
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex.Message);
            }
            return(fla);
        }