public List<Maintenance> GetControl()
 {
     List<Maintenance> list = new List<Maintenance>();
     String command = "SELECT dzid,sbdm,bddm,ywmz,zwmz,dzlb,jtms FROM CW_YBdz_ygyb where ztbz=1 order by dzid desc";
     using (OracleConnection con = new OracleConnection(connectionString))
     {
         con.Open();
         OracleCommand queryCommand = new OracleCommand(command, con);
         //OracleCacheDependency dependency = new OracleCacheDependency(queryCommand);
         var reader = queryCommand.ExecuteReader();
         while (reader.Read())
         {
             Maintenance maintenance = new Maintenance();
             maintenance.ControlID = reader.GetInt32(0);
             maintenance.SocialSecurityCode = reader.GetValue(1).ToString();
             maintenance.LocalCode = reader.GetValue(2).ToString();
             maintenance.EnglishName = reader.GetValue(3).ToString();
             maintenance.ChineseName = reader.GetValue(4).ToString();
             maintenance.Type = reader.GetValue(5).ToString();
             maintenance.Description = reader.GetValue(6).ToString();
             list.Add(maintenance);
         }
     }
     return list;
 }
        public int SaveControl(Maintenance maintenance)
        {
            int result = 0;
            int controlID = GetControlID();
            String command = "";
            if (maintenance.ControlID == 0 || maintenance.ControlID == null)
            {
                command = @"insert into cw_ybdz_ygyb(dzid,sbdm,bddm,ywmz,zwmz,dzlb,jtms,ztbz) values(" + controlID + ",'"
                             + maintenance.SocialSecurityCode + "','" + maintenance.LocalCode + "','" + maintenance.EnglishName + "','" +
                             maintenance.ChineseName + "','" + maintenance.Type + "','" + maintenance.Description + "',1)";
            }
            else
            {
                command = @"update cw_ybdz_ygyb set sbdm='" + maintenance.SocialSecurityCode + "',bddm='" + maintenance.LocalCode
                                                    + "',ywmz='" + maintenance.EnglishName + "',zwmz='" + maintenance.ChineseName + "',dzlb='" +
                                                    maintenance.Type + "',jtms='" + maintenance.Description + "' where dzid=" + maintenance.ControlID;
            }
            using (OracleConnection con = new OracleConnection(connectionString))
            {
                con.Open();
                OracleCommand updateCommand = new OracleCommand(command, con);
                result = updateCommand.ExecuteNonQuery();
            }

            if (result != 0 && (maintenance.ControlID == 0 || maintenance.ControlID == null))
            {
                result = controlID;
            }
            return result;
        }