public void EcuacionPrimerGrado(ref Cls_Ecuacion_DAL Obj_Datos_EcuacionPrimerGrado) { if (Obj_Datos_EcuacionPrimerGrado.fvariable_a != 0) { Obj_Datos_EcuacionPrimerGrado.fvariable_x = ((Obj_Datos_EcuacionPrimerGrado.fvariable_x - Obj_Datos_EcuacionPrimerGrado.fvariable_b) / Obj_Datos_EcuacionPrimerGrado.fvariable_a); } else { Obj_Datos_EcuacionPrimerGrado.fvariable_x = 0; } }
private void btn_Calcular_Ecuaciones_Click(object sender, EventArgs e) { try { Cls_Ecuacion_BLL Obj_Calculos_BLL = new Cls_Ecuacion_BLL(); Cls_Ecuacion_DAL Obj_Datos_DAL = new Cls_Ecuacion_DAL(); Obj_Datos_DAL.fvariable_a = Convert.ToSingle(txt_A.Text); Obj_Datos_DAL.fvariable_b = Convert.ToSingle(txt_B.Text); Obj_Datos_DAL.fvariable_x = Convert.ToSingle(txt_C.Text); Obj_Calculos_BLL.EcuacionPrimerGrado(ref Obj_Datos_DAL); txt_Resultado.Text = Obj_Datos_DAL.fvariable_x.ToString("F1"); } catch (Exception error) { MessageBox.Show("Error" + error); } }