public bool UpDate(BasDataAuto model) { bool blFlag; try { var strb = new StringBuilder(); strb.Append(" Update bas_user "); strb.Append(" Set "); strb.Append("MG_Month = " + Hi.Common.Utils.IsNull(model.MgMonth, "0") + ","); strb.Append("MG_Day = " + model.MgDay + ","); strb.Append("MG_Hour = " + model.MgHour + ","); strb.Append("MG_Minite = " + model.MgMinites + ","); strb.Append("MG_Distance = " + model.MgDistance + ","); strb.Append("MG_Power = " + model.MgPower + ","); strb.Append(" where ID = " + model.Id.ToString()); blFlag = DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false; } catch (Exception ex) { throw ex; } return(blFlag); }
private void RefreshAutoData_Click(object sender, EventArgs e) { var model = new BasDataAuto { MgMonth = MG_Month.Text, MgDay = "1", MgHour = "2", MgMinites = "3", MgDistance = "4", MgPower = "5" }; DataAuto ownerData = IBLL.HiInstanceBll.DataAutoBll(); var blResult = IBLL.HiInstanceBll.DataAutoBll().Add(model); MessageBox.Show(blResult ? "Success" : "Fail"); }
public bool Add(BasDataAuto model) { if (model == null) { return(false); } var strb = new StringBuilder(); strb.Append(" Insert Into bas_Data_Auto "); strb.Append(" ( "); strb.Append("MG_Month, "); strb.Append("MG_Day, "); strb.Append("MG_Hour, "); strb.Append("MG_Minites, "); strb.Append("MG_Distance, "); strb.Append("MG_Power "); strb.Append(" )"); strb.Append(" Values( "); strb.Append("" + model.MgMonth + ", "); strb.Append("'" + model.MgDay + "', "); strb.Append("'" + model.MgHour + "', "); strb.Append("'" + model.MgMinites + "', "); strb.Append("'" + model.MgDistance + "', "); strb.Append("'" + model.MgPower + "' "); strb.Append(" )"); try { return(DataBase.ExecuteNonQuery(strb.ToString()) > 0 ? true : false); } catch (Exception ex) { Debug.WriteLine(ex.Message); return(false); } }
public bool Delete(BasDataAuto model) { throw new NotImplementedException(); }
public bool Add(BasDataAuto model) { return(_dal.Add(model)); }