コード例 #1
0
ファイル: DataAuto.cs プロジェクト: fengxing1121/Hi
        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);
        }
コード例 #2
0
        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");
        }
コード例 #3
0
ファイル: DataAuto.cs プロジェクト: fengxing1121/Hi
        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);
            }
        }
コード例 #4
0
ファイル: DataAuto.cs プロジェクト: fengxing1121/Hi
 public bool Delete(BasDataAuto model)
 {
     throw new NotImplementedException();
 }
コード例 #5
0
ファイル: DataAuto.cs プロジェクト: fengxing1121/Hi
 public bool Add(BasDataAuto model)
 {
     return(_dal.Add(model));
 }