Exemplo n.º 1
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Mdy(JC_FIRE_PROP_Model m)
        {
            StringBuilder sb = new StringBuilder();

            //HID, HNAME, SN, PHONE, SEX, BIRTH, ONSTATE, BYORGNO
            sb.AppendFormat("UPDATE JC_FIRE_PROP");
            sb.AppendFormat(" set ");
            sb.AppendFormat("GHMJ={0}", ClsSql.saveNullField(m.GHMJ));
            sb.AppendFormat(",GHLDMJ={0}", ClsSql.saveNullField(m.GHLDMJ));
            sb.AppendFormat(",SHSLMJ={0}", ClsSql.saveNullField(m.SHSLMJ));
            sb.AppendFormat(",RYS={0}", ClsSql.saveNullField(m.RYS));
            sb.AppendFormat(",RYW={0}", ClsSql.saveNullField(m.RYW));
            sb.AppendFormat(",MGSD={0}", ClsSql.saveNullField(m.MGSD));
            sb.AppendFormat(",ZDQY={0}", ClsSql.saveNullField(m.ZDQY));
            sb.AppendFormat(",GJJL={0}", ClsSql.saveNullField(m.GJJL));
            sb.AppendFormat(",ZZH={0}", ClsSql.saveNullField(m.ZZH));
            sb.AppendFormat(",QHS={0}", ClsSql.saveNullField(m.QHS));
            sb.AppendFormat(",SSJB={0}", ClsSql.saveNullField(m.SSJB));
            sb.AppendFormat(",FIRELEVEL='{0}'", ClsSql.EncodeSql(m.FIRELEVEL));
            sb.AppendFormat(",FIRECODE='{0}'", ClsSql.EncodeSql(m.FIRECODE));
            sb.AppendFormat(" where JC_FIRE_PROPID= '{0}'", ClsSql.EncodeSql(m.JC_FIRE_PROPID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "修改成功!", ""));
            }
            else
            {
                logs.Error(sb.ToString());
                return(new Message(false, "修改失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据查询条件获取某一条用户信息记录,用于修改、删除
        /// </summary>
        /// <param name="sw">参见模型</param>
        /// <returns>参见模型</returns>
        public static JC_FIRE_PROP_Model getModel(JC_FIRE_PROP_SW sw)
        {
            DataTable dt = BaseDT.JC_FIRE_PROP.getDT(sw);//列表

            JC_FIRE_PROP_Model m = new JC_FIRE_PROP_Model();

            if (dt.Rows.Count > 0)
            {
                int i = 0;
                m.JC_FIRE_PROPID = dt.Rows[i]["JC_FIRE_PROPID"].ToString();
                m.JCFID          = dt.Rows[i]["JCFID"].ToString();
                m.GHMJ           = dt.Rows[i]["GHMJ"].ToString();
                m.GHLDMJ         = dt.Rows[i]["GHLDMJ"].ToString();
                m.SHSLMJ         = dt.Rows[i]["SHSLMJ"].ToString();
                m.RYS            = dt.Rows[i]["RYS"].ToString();
                m.RYW            = dt.Rows[i]["RYW"].ToString();
                m.MGSD           = dt.Rows[i]["MGSD"].ToString();
                m.ZDQY           = dt.Rows[i]["ZDQY"].ToString();
                m.GJJL           = dt.Rows[i]["GJJL"].ToString();
                m.ZZH            = dt.Rows[i]["ZZH"].ToString();
                m.QHS            = dt.Rows[i]["QHS"].ToString();
                m.SSJB           = dt.Rows[i]["SSJB"].ToString();
                m.FIRELEVEL      = dt.Rows[i]["FIRELEVEL"].ToString();
                m.FIRECODE       = dt.Rows[i]["FIRECODE"].ToString();
            }
            dt.Clear();
            dt.Dispose();
            return(m);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 获取所有
        /// </summary>
        /// <param name="sw"></param>
        /// <returns></returns>
        public static IEnumerable <JC_FIRE_PROP_Model> getListModel(JC_FIRE_PROP_SW sw)
        {
            var result = new List <JC_FIRE_PROP_Model>();

            DataTable dt = BaseDT.JC_FIRE_PROP.getDT(sw);//列表

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                JC_FIRE_PROP_Model m = new JC_FIRE_PROP_Model();
                m.JC_FIRE_PROPID = dt.Rows[i]["JC_FIRE_PROPID"].ToString();
                m.JCFID          = dt.Rows[i]["JCFID"].ToString();
                m.GHMJ           = dt.Rows[i]["GHMJ"].ToString();
                m.GHLDMJ         = dt.Rows[i]["GHLDMJ"].ToString();
                m.SHSLMJ         = dt.Rows[i]["SHSLMJ"].ToString();
                m.RYS            = dt.Rows[i]["RYS"].ToString();
                m.RYW            = dt.Rows[i]["RYW"].ToString();
                m.MGSD           = dt.Rows[i]["MGSD"].ToString();
                m.ZDQY           = dt.Rows[i]["ZDQY"].ToString();
                m.GJJL           = dt.Rows[i]["GJJL"].ToString();
                m.ZZH            = dt.Rows[i]["ZZH"].ToString();
                m.QHS            = dt.Rows[i]["QHS"].ToString();
                m.SSJB           = dt.Rows[i]["SSJB"].ToString();
                m.FIRELEVEL      = dt.Rows[i]["FIRELEVEL"].ToString();
                result.Add(m);
            }
            dt.Clear();
            dt.Dispose();
            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Del(JC_FIRE_PROP_Model m)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("delete JC_FIRE_PROP");
            sb.AppendFormat(" where JC_FIRE_PROPID= '{0}'", ClsSql.EncodeSql(m.JC_FIRE_PROPID));
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "删除成功!", ""));
            }
            else
            {
                logs.Error(sb.ToString());
                return(new Message(false, "删除失败,请检查各输入框是否正确!", ""));
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// 增、删、改
 /// </summary>
 /// <param name="m">参见模型</param>
 /// <returns>参见模型</returns>
 public static Message Manager(JC_FIRE_PROP_Model m)
 {
     if (m.opMethod == "Save")//传递Model,判断是否存在,如果不存在则为添加,否则为修改
     {
         if (!string.IsNullOrEmpty(m.JC_FIRE_PROPID))
         {
             if (!BaseDT.JC_FIRE_PROP.isExists(new JC_FIRE_PROP_SW {
                 JC_FIRE_PROPID = m.JC_FIRE_PROPID
             }))
             {
                 return(BaseDT.JC_FIRE_PROP.Add(m));
             }
             else
             {
                 return(BaseDT.JC_FIRE_PROP.Mdy(m));
             }
         }
         else
         {
             return(BaseDT.JC_FIRE_PROP.Add(m));
         }
     }
     if (m.opMethod == "Add")
     {
         //SystemCls.LogSave("3", "通知公告:" + m.INFOTITLE, ClsStr.getModelContent(m));
         Message msgUser = BaseDT.JC_FIRE_PROP.Add(m);
         return(new Message(msgUser.Success, msgUser.Msg, m.returnUrl));
     }
     if (m.opMethod == "Mdy")
     {
         //SystemCls.LogSave("4", "通知公告:" + m.INFOTITLE, ClsStr.getModelContent(m));
         Message msgUser = BaseDT.JC_FIRE_PROP.Mdy(m);
         return(new Message(msgUser.Success, msgUser.Msg, m.returnUrl));
     }
     if (m.opMethod == "Del")
     {
         //SystemCls.LogSave("5", "通知公告:" + m.INFOTITLE, ClsStr.getModelContent(m));
         Message msgUser = BaseDT.JC_FIRE_PROP.Del(m);
         return(new Message(msgUser.Success, msgUser.Msg, m.returnUrl));
     }
     return(new Message(false, "无效操作", ""));
 }
        /// <summary>
        /// 保存火险属性
        /// </summary>
        /// <returns></returns>
        public JsonResult SaveFireLevelSX()
        {
            string propid    = Request.Params["propid"];
            string jcfid     = Request.Params["jcfid"];
            string ghmj      = Request.Params["ghmj"];
            string ghldmj    = Request.Params["ghldmj"];
            string shslmj    = Request.Params["shslmj"];
            string rys       = Request.Params["rys"];
            string ryw       = Request.Params["ryw"];
            string mg        = Request.Params["mg"];
            string zd        = Request.Params["zd"];
            string gjjl      = Request.Params["gjjl"];
            string zzh       = Request.Params["zzh"];
            string qhs       = Request.Params["qhs"];
            string ssjb      = Request.Params["ssjb"];
            string firelevel = Request.Params["firelevel"];
            string firecode  = Request.Params["firecode"];

            var m = new JC_FIRE_PROP_Model();

            m.opMethod       = "Save";
            m.JC_FIRE_PROPID = propid;
            m.JCFID          = jcfid;
            m.GHMJ           = ghmj;
            m.GHLDMJ         = ghldmj;
            m.SHSLMJ         = shslmj;
            m.RYS            = rys;
            m.RYW            = ryw;
            m.MGSD           = mg;
            m.ZDQY           = zd;
            m.GJJL           = gjjl;
            m.ZZH            = zzh;
            m.QHS            = qhs;
            m.SSJB           = ssjb;
            m.FIRELEVEL      = firelevel;
            m.FIRECODE       = firecode;
            var ms = JC_FIRE_PROPCls.Manager(m);

            return(Json(ms));
        }
Exemplo n.º 7
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="m">参见模型</param>
        /// <returns>参见模型</returns>
        public static Message Add(JC_FIRE_PROP_Model m)
        {
            if (string.IsNullOrEmpty(m.JCFID))
            {
                return(new Message(false, "添加失败,请传递正确的火情序号!", ""));
            }
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat("INSERT INTO  JC_FIRE_PROP(   JCFID, GHMJ, GHLDMJ, SHSLMJ, RYS, RYW, MGSD, ZDQY, GJJL, ZZH, QHS, SSJB,FIRELEVEL,FIRECODE)");
            sb.AppendFormat("VALUES(");
            sb.AppendFormat("'{0}'", ClsSql.EncodeSql(m.JCFID));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.GHMJ));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.GHLDMJ));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.SHSLMJ));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.RYS));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.RYW));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.MGSD));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ZDQY));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.GJJL));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.ZZH));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.QHS));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.SSJB));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRELEVEL));
            sb.AppendFormat(",{0}", ClsSql.saveNullField(m.FIRECODE));
            sb.AppendFormat(")");
            bool bln = DataBaseClass.ExeSql(sb.ToString());

            if (bln == true)
            {
                return(new Message(true, "添加成功!", ""));
            }
            else
            {
                logs.Error(sb.ToString());
                return(new Message(false, "添加失败,请检查各输入框是否正确!", ""));
            }
        }