private void button2_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(textBox1.Text)) { //string PartList = ReadTxtContent(textBox1.Text); string Entity = ReadTxtContent(textBox1.Text); //List<Part> parts = new List<Part>() //{ // new Part {PartID=0,ProjectID=0,ShortName="数据测试",Name="116161_Black(4212+4213)_9003_V00",Specification="43.00X15.57X32.46",CreateDate=Convert.ToDateTime("0001-01-01T00:00:00"),ReleaseDate=Convert.ToDateTime("0001-01-01T00:00:00") // ,MaterialName="Unimax",Hardness="HRC54-56",BrandName="南烽",SupplierName="",Memo="",Quantity=1,Enabled=true,Version="00",TotalQty=1,Virtual=true,JobNo="9003",PartNumber="116161-9003"}, // //new Part {PartID=0,ProjectID=10,ShortName="Name2",Name="116161_Hot runner_1091_V20",PartListID=0 }, //}; //string str = JsonConvert.SerializeObject(parts); //List<Part> _parts = JsonConvert.DeserializeObject<List<Part>>(str); MGSetting _entity = JsonConvert.DeserializeObject <MGSetting>(Entity); //UGParts ugp = new UGParts("localhost", "50187"); MGInformation mgi = new MGInformation("localhost", "50187"); //ResponseInfo ri = ugp.SaveParts(_parts); int ri = mgi.AddOrUpdateMGDrawing(_entity); //string version = "011"; //version = version.Substring(version.Count()-2,2); //MessageBox.Show(version); } else { MessageBox.Show("!"); } }
private void button4_Click(object sender, EventArgs e) { MGSetting _entity = new MGSetting { DrawName = "DrawName", CADNames = "CADNames", Qty = 1, ProcessType = 1, Time = 18.20M, FeatureNote = "tttt", Material = "Material", HRC = "HRC", RawSize = "RawSize", Rev = 0, ReleaseFlag = true, MoldName = "111888" }; MGInformation mgi = new MGInformation("localhost", "50187"); int ri = mgi.AddOrUpdateMGDrawing(_entity); }