void SetDataList(PMCplan_table PR) { if (state == "insert") { dataDGVlist.Add(PR); this.dataGridViewX1.DataSource = new List <PMCplan_table>(); this.dataGridViewX1.DataSource = dataDGVlist; } else if (state == "modify") { dataDGVlist[this.dataGridViewX1.CurrentRow.Index] = PR; this.dataGridViewX1.DataSource = new List <PMCplan_table>(); this.dataGridViewX1.DataSource = dataDGVlist; } }
void SetControls(PMCplan_table pmc) { comb_companyName.Text = pmc.CorporateName; txt_ZhiDan.Text = pmc.ZhiDan; txt_customer.Text = pmc.CustomerName; txt_Node.Text = pmc.Remarks; input_totalOrder.Value = pmc.TotalOrder; dti_shippingData.Value = pmc.ShippingDate; Dictionary <string, double> dic = new Dictionary <string, double>(); string str = ""; if (dic.ContainsKey(pmc.RequiredTimeGUID)) { dic = dataDicS[pmc.RequiredTimeGUID]; foreach (var item in dic) { str += item.Key + ":" + Convert.ToString(item.Value) + "(小时)" + "\r\n"; } } txt_ProductionRequired.Text = str; }