protected void SaveInfo() { if (rdbType.SelectedValue == "1") { Fertilizer_Common_Info info = new Fertilizer_Common_Info(int.Parse(txtKey.Text)); info.Common_Name = txtCommon_Name.Text; info.Save(); } else { Pesticide_Common_Info info = new Pesticide_Common_Info(int.Parse(txtKey.Text)); info.Common_Name = txtCommon_Name.Text; info.Save(); } }
protected void LoadInfo(string Key) { if (Key != "0") { string[] keys = Key.Split('-'); if (keys[1].ToInt() == 1) { Fertilizer_Common_Info info = new Fertilizer_Common_Info(keys[0].ToInt()); txtCommon_Name.Text = info.Common_Name; rdbType.SelectedValue = "1"; } else { Pesticide_Common_Info info2 = new Pesticide_Common_Info(keys[0].ToInt()); txtCommon_Name.Text = info2.Common_Name; rdbType.SelectedValue = "2"; } txtKey.Text = keys[0]; } }