Exemple #1
0
        /// <summary>
        /// 删除单个台账管理信息
        /// </summary>
        /// <param name="Parameter"></param>
        /// <returns></returns>
        public ReturnMsg DeleteEqui(InvokeEntity Parameter)
        {
            userInfo = BasePubCommon.FindLoginUserInfo(Parameter.token);
            var JO   = JsonConvert.DeserializeObject <JObject>(Parameter.obj.ToString());
            var code = JO["equiCode"].ToString();

            this.sqlConn = Parameter.SqlConnection;
            var  conn = new BaseSQL(sqlConn);
            bool flag = false;

            try
            {
                Fail("删除失败");
                //删除设备以及关联的表信息
                conn.BeginTrans();


                //删除设备信息
                string         Sql   = "delete from sfcdatequipmentinfo where code=@code";
                CmdParameter[] paras = new CmdParameter[1];
                paras[0] = new CmdParameter()
                {
                    DBtype = DBType.String, ParameterName = "@code", Value = code
                };
                flag = conn.ExeSql(Sql, paras);

                //删除附件信息
                Sql  = "delete from sfcdatattachment  where equipmentinfocode=@code";
                flag = conn.ExeSql(Sql, paras);

                //删除文档信息
                Sql  = "delete from sfcdatdocument  where equipmentinfocode=@code";
                flag = conn.ExeSql(Sql, paras);

                //删除图片信息
                Sql  = "delete from sfcdatpic  where equipmentinfocode=@code";
                flag = conn.ExeSql(Sql, paras);

                //删除维修记录
                Sql  = "delete from sfcdatmaintenancerecord  where equipmentcode=@code";
                flag = conn.ExeSql(Sql, paras);

                //删除调拨记录
                Sql  = "delete from sfcdattransferrecord  where equipmentinfocode=@code";
                flag = conn.ExeSql(Sql, paras);

                //删除报废记录
                Sql  = "delete from sfcdatscraprecord  where equipmentinfocode =@code";
                flag = conn.ExeSql(Sql, paras);

                //删除其它异动
                Sql  = "delete from sfcdatothermove  where equipmentinfocode =@code";
                flag = conn.ExeSql(Sql, paras);

                //删除定期检修
                Sql  = "delete from sfcdatrepairinfo  where equipmentcode =@code";
                flag = conn.ExeSql(Sql, paras);

                conn.Commit();
                Success();
                return(resultData);
            }
            catch (Exception ex)
            {
                conn.Rollback();
                return(resultData);
            }
        }