public void AddOnepro(string ProName, string ProPath, string datetime, int proType) { Dictionary <string, promesg> Protable = new Dictionary <string, promesg>(); Protable = readjson(proType); if (Protable == null) { Dictionary <string, promesg> protable = new Dictionary <string, promesg>(); promesg mesg = new promesg(); mesg.proname = ProName; mesg.propath = ProPath; protable.Add(datetime, mesg); writejson(protable, proType); } else { promesg mesg = new promesg(); mesg.proname = ProName; mesg.propath = ProPath; Protable.Add(datetime, mesg); writejson(Protable, proType); } }
public promesg QueryPromesg(int proType, string createtime) { Dictionary <string, promesg> Protable = new Dictionary <string, promesg>(); Protable = readjson(proType); promesg mesg = new promesg(); if (Protable == null) { } else { mesg.proname = Protable[createtime].proname; mesg.propath = Protable[createtime].propath; } return(mesg); }
public FormModel() { InitializeComponent(); if (field.NowProType == 0) { LAB_ProCreTime.Text = field.NowProCreateTime; promesg promesg = proDB.QueryPromesg(0, field.NowProCreateTime); LAB_ProName.Text = promesg.proname; propath = promesg.propath; LAB_ProType.Text = "弱像素分割项目"; using (StreamReader reader = new StreamReader(propath + "\\models.json")) { models = Newtonsoft.Json.JsonConvert.DeserializeObject <List <DateTime> >(reader.ReadToEnd()); } foreach (DateTime i in models) { dSkinListBox1.Items.Add(i.ToString("yyyyMMddHHmmss")); } } else if (field.NowProType == 1) { LAB_ProCreTime.Text = field.NowProCreateTime; promesg promesg = proDB.QueryPromesg(0, field.NowProCreateTime); LAB_ProName.Text = promesg.proname; propath = promesg.propath; LAB_ProType.Text = "大分类项目"; using (StreamReader reader = new StreamReader(propath + "\\models.json")) { models = Newtonsoft.Json.JsonConvert.DeserializeObject <List <DateTime> >(reader.ReadToEnd()); } foreach (DateTime i in models) { dSkinListBox1.Items.Add(i.ToString("yyyyMMddHHmmss")); } } else if (field.NowProType == 2) { MessageBox.Show("没有导入项目"); // this.Close(); } //if(dSkinListBox1) }