Пример #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            this.DataModule = this.ucSysModule1.GetData();
            if (this.DataModule != null)
            {
                CustomException ce = null;
                //  加入数据处理
                String json  = StringHelper.SerializeObject <CDictModule>(this.DataModule);
                String jsono = StringHelper.SerializeObject <List <CDictObject> >(this.DataObjectList);
                List <KeyValuePair <string, string> > parms = new List <KeyValuePair <string, string> >();
                parms.Add(new KeyValuePair <string, string>("moduleJson", json));
                parms.Add(new KeyValuePair <string, string>("objectJson", jsono));

                int rst = int.Parse(HttpDataHelper.HttpPostFormUrlWithInfo("BASE", "/setup/moduleadd", out ce, parms));
                if (rst == 1)
                {
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageHelper.ShowError("新增模块发生错误。\r\n" + ce.Message);
                }
            }
        }