//MODIFY CONSTRAINTS private void btnModify_AddCon_ItemClick(object sender, ItemClickEventArgs e) { GRBLinExpr func = (GRBLinExpr)MyGlobals.model.GetObjective(); if (func.Size != 0) { Form frm = new FrmAddCon(); frm.Show(); } else { MessageBox.Show("Your Objective Function is not initialized. \nPlease build your model."); } }
private void btnNext_Click(object sender, EventArgs e) { int int_sense = MyGlobals.model.Get(GRB.IntAttr.ModelSense); GRBLinExpr func = (GRBLinExpr)MyGlobals.model.GetObjective(); if ((int_sense == -1) || (int_sense == 1)) { if (func.Size != 0) { this.Hide(); Form frm = new FrmAddCon(); frm.Show(); this.Close(); } else { MessageBox.Show("Your Objective Function is not initialized. \nPlease build your model."); } } else { MessageBox.Show("Your Objective Function is not initialized. \nPlease build your model."); } }