예제 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            JZWCF.JZWCFClient wcf = new JZWCF.JZWCFClient();
            string            str = wcf.PostSource(CreateSearchModel());
            ExcuteResultMsg   msg = str.ToJsonObject <ExcuteResultMsg>();

            if (msg.Code == ResultCode.Success)
            {
                var lst = msg.Result.ToJsonObject <List <JZ.Models.Test> >();
                if (lst != null && lst.Count > 0)
                {
                    lst[0].Value = Guid.NewGuid().ToString();
                    str          = wcf.PostSource(CreateEditModel(lst[0]));
                    msg          = str.ToJsonObject <ExcuteResultMsg>();
                    if (msg.Code == ResultCode.Success)
                    {
                        MessageBox.Show("修改成功\n\r" + str);
                    }
                    else
                    {
                        MessageBox.Show("修改失败:" + str);
                    }
                }
                else
                {
                    MessageBox.Show("没有查询到数据");
                    return;
                }
            }
            else
            {
                MessageBox.Show("查询数据失败:" + str);
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            JZWCF.JZWCFClient wcf = new JZWCF.JZWCFClient();
            string            str = wcf.PostSource(CreateAddModel());
            ExcuteResultMsg   msg = str.ToJsonObject <ExcuteResultMsg>();

            if (msg.Code == ResultCode.Success)
            {
                MessageBox.Show("成功\n\r" + str);
            }
            else
            {
                MessageBox.Show("失败:" + str);
            }
        }