private void ShowInfo(int _id) { BLL.car_other_costbll bll = new BLL.car_other_costbll(); Model.car_other_costinfo model = bll.GetModel(_id); txtCode.Text = model.Code; txtTittle.Text = model.Tittle; ddlCar_Number.SelectedValue = model.Car.Car_Number; txtCost.Text = model.Cost.ToString(); ddlType_Code.SelectedValue = model.Type_Code; }
private bool DoAdd() { bool result = true; Model.car_other_costinfo model = new Model.car_other_costinfo(); BLL.car_other_costbll bll = new BLL.car_other_costbll(); model.Code = txtCode.Text.Trim(); model.Tittle = txtTittle.Text; model.Car = new Model.carinfo(); model.Car.Car_Number = ddlCar_Number.SelectedValue; string s = txtCost.Text; model.Cost = decimal.Parse(s == "" ? "0" : s); model.Type_Code = ddlType_Code.SelectedValue; if (bll.Add(model) < 1) { result = false; } return(result); }
private bool DoEdit(int _id) { bool result = true; BLL.car_other_costbll bll = new BLL.car_other_costbll(); Model.car_other_costinfo model = bll.GetModel(_id); model.Code = txtCode.Text.Trim(); model.Tittle = txtTittle.Text; model.Car = new Model.carinfo(); model.Car.Car_Number = ddlCar_Number.SelectedValue; string s = txtCost.Text; model.Cost = decimal.Parse(s == "" ? "0" : s); model.Type_Code = ddlType_Code.SelectedValue; if (!bll.Update(model)) { result = false; } return(result); }