private bool DoAdd() { bool result = true; Model.car_repair_recordinfo model = new Model.car_repair_recordinfo(); BLL.car_repair_recordbll bll = new BLL.car_repair_recordbll(); model.Code = txtCode.Text.Trim(); model.Repare_Time = txtRepare_Time.Text; model.Car = new Model.carinfo(); model.Car.Car_Number = ddlCar_Number.SelectedValue; string s = txtMileage.Text; model.Mileage = Convert.ToInt32(s.Trim() == "" ? "0" : s); s = txtNext_Mileage.Text; model.Next_Mileage = Convert.ToInt32(s.Trim() == "" ? "0" : s); model.Maintenance_Item = new Model.car_maintenance_iteminfo(); model.Maintenance_Item.Code = ddlMaintenance_Item.SelectedValue; model.Repair_Plant_Code = ddlRepair_Plant.SelectedValue; model.Reason = txtReason.Text; model.Driver = new Model.car_driverinfo(); model.Driver.Driver_Code = ddlDriver_Code.SelectedValue; if (bll.Add(model) < 1) { result = false; } else { BLL.carbll carbl = new BLL.carbll(); carbl.UpdateField(model.Car.Car_Number, " Status=2"); } return(result); }
private bool DoAdd() { bool result = true; Model.car_repair_recordinfo model = new Model.car_repair_recordinfo(); BLL.car_repair_recordbll bll = new BLL.car_repair_recordbll(); model.Code = ddlCode.Text; model.Repare_Time_Finish = txtRepare_Time_Finish.Text; if (bll.Add(model) < 1) { result = false; } return(result); }