예제 #1
0
        /// <summary>
        /// 增、删、改
        /// </summary>
        /// <param name="m">参见模型FIRERECORD_REPORT11_Model</param>
        /// <returns>参见模型Message</returns>
        public static Message Manager(FIRERECORD_REPORT11_Model m)
        {
            if (m.opMethod == "Add")
            {
                Message msgMENU = BaseDT.FIRERECORD_REPORT11.Add(m);
                if (msgMENU.Success == false)
                {
                    return(new Message(msgMENU.Success, msgMENU.Msg, ""));
                }
                return(new Message(msgMENU.Success, msgMENU.Msg, m.returnUrl));
            }

            return(new Message(false, "无效操作", m.returnUrl));
        }
예제 #2
0
        /// <summary>
        /// 火情档案_森林防火基础设施统计年报表二
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(FIRERECORD_REPORT11_Model m)
        {
            List <string> sqllist = new List <string>();

            string[] arrREPORTCODE  = m.REPORTCODE.Split(',');
            string[] arrREPORTVALUE = m.REPORTVALUE.Split(',');
            for (int i = 0; i < arrREPORTVALUE.Length - 1; i++)
            {
                #region 更新
                if (isExists(new FIRERECORD_REPORT11_SW {
                    BYORGNO = m.BYORGNO, REPORTYEAR = m.REPORTYEAR, REPORTCODE = arrREPORTCODE[i],
                }))
                {
                    StringBuilder sbUpdate = new StringBuilder();
                    sbUpdate.AppendFormat("UPDATE FIRERECORD_REPORT11 SET ");
                    sbUpdate.AppendFormat(" REPORTVALUE= '{0}'", ClsSql.EncodeSql(arrREPORTVALUE[i]));
                    sbUpdate.AppendFormat(" where BYORGNO= '{0}'", ClsSql.EncodeSql(m.BYORGNO));
                    sbUpdate.AppendFormat(" and REPORTYEAR= '{0}'", ClsSql.EncodeSql(m.REPORTYEAR));
                    sbUpdate.AppendFormat(" and REPORTCODE= '{0}'", ClsSql.EncodeSql(arrREPORTCODE[i]));
                    sqllist.Add(sbUpdate.ToString());
                }
                #endregion

                #region 添加
                else
                {
                    StringBuilder sbInsert = new StringBuilder();
                    sbInsert.AppendFormat("INSERT  INTO  FIRERECORD_REPORT11(BYORGNO,REPORTYEAR,REPORTCODE,REPORTVALUE)");
                    sbInsert.AppendFormat("VALUES(");
                    sbInsert.AppendFormat(" {0}", ClsSql.saveNullField(m.BYORGNO));
                    sbInsert.AppendFormat(",{0}", ClsSql.saveNullField(m.REPORTYEAR));
                    sbInsert.AppendFormat(",{0}", ClsSql.saveNullField(arrREPORTCODE[i]));
                    sbInsert.AppendFormat(",{0}", ClsSql.saveNullField(arrREPORTVALUE[i]));
                    sbInsert.AppendFormat(")");
                    sqllist.Add(sbInsert.ToString());
                }
                #endregion
            }
            var j = DataBaseClass.ExecuteSqlTran(sqllist);
            if (j >= 0)
            {
                return(new Message(true, "保存成功!", ""));
            }
            else
            {
                return(new Message(false, "保存失败,事物回滚机制!", ""));
            }
        }
예제 #3
0
        /// <summary>
        /// 获取森林防火基础设施统计报表二列表
        /// </summary>
        /// <param name="sw">参见模型FIRERECORD_REPORT11_Model</param>
        /// <returns>参见模型FIRERECORD_REPORT11_Model</returns>
        public static IEnumerable <FIRERECORD_REPORT11_Model> getListModel(FIRERECORD_REPORT11_SW sw)
        {
            var       result = new List <FIRERECORD_REPORT11_Model>();
            DataTable dt     = BaseDT.FIRERECORD_REPORT11.getDT(sw);

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                FIRERECORD_REPORT11_Model m = new FIRERECORD_REPORT11_Model();
                m.FIRERECORD_REPORT11ID = dt.Rows[i]["FIRERECORD_REPORT11ID"].ToString();
                m.BYORGNO     = dt.Rows[i]["BYORGNO"].ToString();
                m.REPORTYEAR  = dt.Rows[i]["REPORTYEAR"].ToString();
                m.REPORTCODE  = dt.Rows[i]["REPORTCODE"].ToString();
                m.REPORTVALUE = dt.Rows[i]["REPORTVALUE"].ToString();
                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            return(result);
        }
예제 #4
0
        /// <summary>
        /// 获取森林防火基础设施统计报表二单条数据
        /// </summary>
        /// <param name="sw">参见模型</param>
        /// <returns>参见模型</returns>
        public static FIRERECORD_REPORT11_Model getModel(FIRERECORD_REPORT11_SW sw)
        {
            DataTable dt = BaseDT.FIRERECORD_REPORT11.getDT(sw);
            FIRERECORD_REPORT11_Model m = new FIRERECORD_REPORT11_Model();
            DataTable dtORG             = BaseDT.T_SYS_ORG.getDT(new T_SYS_ORGSW {
                SYSFLAG = ConfigCls.getSystemFlag()
            });                                                                                               //获取单位

            if (dt != null && dt.Rows.Count > 0)
            {
                int i = 0;
                m.FIRERECORD_REPORT11ID = dt.Rows[i]["FIRERECORD_REPORT11ID"].ToString();
                m.BYORGNO     = dt.Rows[i]["BYORGNO"].ToString();
                m.REPORTYEAR  = dt.Rows[i]["REPORTYEAR"].ToString();
                m.REPORTCODE  = dt.Rows[i]["REPORTCODE"].ToString();
                m.REPORTVALUE = dt.Rows[i]["REPORTVALUE"].ToString();
            }
            dt.Clear();
            dt.Dispose();
            dtORG.Clear();
            dtORG.Dispose();
            return(m);
        }