示例#1
0
        public PlanModule GetModule_DRToModel(DataRow dr)
        {
            PlanModule model = new PlanModule();

            if (dr != null)
            {
                model.ID           = ObjectConvertClass.static_ext_int(dr["nID"]);
                model.TrainNo1     = ObjectConvertClass.static_ext_string(dr["strTrainNo1"]);
                model.TrainInfo    = ObjectConvertClass.static_ext_string(dr["strTrainInfo"]);
                model.TrainNo2     = ObjectConvertClass.static_ext_string(dr["strTrainNo2"]);
                model.TrainNo      = ObjectConvertClass.static_ext_string(dr["strTrainNo"]);
                model.Remark       = ObjectConvertClass.static_ext_string(dr["strRemark"]);
                model.IsTomorrow   = ObjectConvertClass.static_ext_int(dr["bIsTomorrow"]);
                model.GroupID      = ObjectConvertClass.static_ext_int(dr["nGroupID"]);
                model.DayPlanType  = ObjectConvertClass.static_ext_int(dr["nDayPlanType"]);
                model.DaWenCheXing = ObjectConvertClass.static_ext_string(dr["strDaWenCheXing"]);
                model.DaWenCheHao1 = ObjectConvertClass.static_ext_string(dr["strDaWenCheHao1"]);
                model.DaWenCheHao2 = ObjectConvertClass.static_ext_string(dr["strDaWenCheHao2"]);
                model.DaWenCheHao3 = ObjectConvertClass.static_ext_string(dr["strDaWenCheHao3"]);
            }
            return(model);
        }
示例#2
0
        public int UpdateModule(PlanModule model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("Update Tab_Base_DayPlan_Item set ");
            strSql.Append(" strTrainNo1 = @strTrainNo1, ");
            strSql.Append(" strTrainInfo = @strTrainInfo, ");
            strSql.Append(" strTrainNo2 = @strTrainNo2, ");
            strSql.Append(" strTrainNo = @strTrainNo, ");
            strSql.Append(" strRemark = @strRemark, ");
            strSql.Append(" bIsTomorrow = @bIsTomorrow, ");
            strSql.Append(" nGroupID = @nGroupID, ");
            strSql.Append(" nDayPlanType = @nDayPlanType, ");
            strSql.Append(" strDaWenCheXing = @strDaWenCheXing, ");
            strSql.Append(" strDaWenCheHao1 = @strDaWenCheHao1, ");
            strSql.Append(" strDaWenCheHao2 = @strDaWenCheHao2, ");
            strSql.Append(" strDaWenCheHao3 = @strDaWenCheHao3 ");
            strSql.Append(" where nID = @nID ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@nID",             model.ID),
                new SqlParameter("@strTrainNo1",     model.TrainNo1),
                new SqlParameter("@strTrainInfo",    model.TrainInfo),
                new SqlParameter("@strTrainNo2",     model.TrainNo2),
                new SqlParameter("@strTrainNo",      model.TrainNo),
                new SqlParameter("@strRemark",       model.Remark),
                new SqlParameter("@bIsTomorrow",     model.IsTomorrow),
                new SqlParameter("@nGroupID",        model.GroupID),
                new SqlParameter("@nDayPlanType",    model.DayPlanType),
                new SqlParameter("@strDaWenCheXing", model.DaWenCheXing),
                new SqlParameter("@strDaWenCheHao1", model.DaWenCheHao1),
                new SqlParameter("@strDaWenCheHao2", model.DaWenCheHao2),
                new SqlParameter("@strDaWenCheHao3", model.DaWenCheHao3)
            };

            return(SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql.ToString(), parameters));
        }
示例#3
0
        public int AddModule(PlanModule model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into Tab_Base_DayPlan_Item");
            strSql.Append("(strTrainNo1,strTrainInfo,strTrainNo2,strTrainNo,strRemark,bIsTomorrow,nGroupID,nDayPlanType,strDaWenCheXing,strDaWenCheHao1,strDaWenCheHao2,strDaWenCheHao3)");
            strSql.Append("values(@strTrainNo1,@strTrainInfo,@strTrainNo2,@strTrainNo,@strRemark,@bIsTomorrow,@nGroupID,@nDayPlanType,@strDaWenCheXing,@strDaWenCheHao1,@strDaWenCheHao2,@strDaWenCheHao3)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@strTrainNo1",     model.TrainNo1),
                new SqlParameter("@strTrainInfo",    model.TrainInfo),
                new SqlParameter("@strTrainNo2",     model.TrainNo2),
                new SqlParameter("@strTrainNo",      model.TrainNo),
                new SqlParameter("@strRemark",       model.Remark),
                new SqlParameter("@bIsTomorrow",     model.IsTomorrow),
                new SqlParameter("@nGroupID",        model.GroupID),
                new SqlParameter("@nDayPlanType",    model.DayPlanType),
                new SqlParameter("@strDaWenCheXing", model.DaWenCheXing),
                new SqlParameter("@strDaWenCheHao1", model.DaWenCheHao1),
                new SqlParameter("@strDaWenCheHao2", model.DaWenCheHao2),
                new SqlParameter("@strDaWenCheHao3", model.DaWenCheHao3)
            };
            return(SqlHelper.ExecuteNonQuery(SqlHelper.ConnString, CommandType.Text, strSql.ToString(), parameters));
        }