public Subcompanyinfo CreateSubcompanyinfo(Subcompanyinfo info)
 {
     try
     {
         Management.BeginTransaction();
         Management.CreateSubcompanyinfo(info);
         Management.Commit();
     }
     catch
     {
         Management.Rollback();
         throw;
     }
     return info;
 }
        public Subcompanyinfo CreateSubcompanyinfo(Subcompanyinfo info)
        {
            try
            {
                string sqlCommand = @"INSERT INTO ""SUBCOMPANYINFO"" (""SUBCOMPANYID"",""SUBCOMPANYNAME"",""FGSSORTID"",""SUBCOMPANYCODE"") VALUES (:Subcompanyid,:Subcompanyname,:Fgssortid,:Subcompanycode)";
                this.Database.AddInParameter(":Subcompanyid", info.Subcompanyid);//DBType:NUMBER
                this.Database.AddInParameter(":Subcompanyname", info.Subcompanyname);//DBType:VARCHAR2
                this.Database.AddInParameter(":Fgssortid", info.Fgssortid);//DBType:VARCHAR2
                this.Database.AddInParameter(":Subcompanycode", info.Subcompanycode);//DBType:VARCHAR2
                this.Database.ExecuteNonQuery(sqlCommand);

            }
            finally
            {
                this.Database.ClearParameter();
            }
            return info;
        }
 public Subcompanyinfo UpdateSubcompanyinfoBySubcompanyid(Subcompanyinfo info)
 {
     try
     {
         this.Database.AddInParameter(":Subcompanyid", info.Subcompanyid);//DBType:NUMBER
         this.Database.AddInParameter(":Subcompanyname", info.Subcompanyname);//DBType:VARCHAR2
         this.Database.AddInParameter(":Fgssortid", info.Fgssortid);//DBType:VARCHAR2
         this.Database.AddInParameter(":Subcompanycode", info.Subcompanycode);//DBType:VARCHAR2
         string sqlCommand = @"UPDATE ""SUBCOMPANYINFO"" SET  ""SUBCOMPANYNAME""=:Subcompanyname , ""FGSSORTID""=:Fgssortid , ""SUBCOMPANYCODE""=:Subcompanycode WHERE  ""SUBCOMPANYID""=:Subcompanyid";
         this.Database.ExecuteNonQuery(sqlCommand);
     }
     finally
     {
         this.Database.ClearParameter();
     }
     return info;
 }