)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Category (Ia.Statistics.Cl.Models)

Public general use code classes and xml files that we've compiled and used over the years:

    1: using System;
    2: using System.ComponentModel.DataAnnotations.Schema;
    3: using System.ComponentModel.DataAnnotations;
    4: using System.Collections.Generic;
    5:  
    6: namespace Ia.Statistics.Cl.Models
    7: {
    8:     ////////////////////////////////////////////////////////////////////////////
    9:  
   10:     /// <summary publish="true">
   11:     ///
   12:     /// </summary>
   13:     /// 
   14:     /// <remarks> 
   15:     /// Copyright © 2006-2025 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   16:     ///
   17:     /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
   18:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   19:     ///
   20:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   21:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   22:     /// 
   23:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   24:     /// 
   25:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   26:     /// </remarks> 
   27:     public class Category
   28:     {
   29:         /// <summary/>
   30:         [Key, DatabaseGenerated(DatabaseGeneratedOption.None)]
   31:         public int Id { get; set; }
   32:  
   33:         /// <summary/>
   34:         public int SiteId { get; set; }
   35:  
   36:         /// <summary/>
   37:         public string Name { get; set; }
   38:  
   39:         /// <summary/>
   40:         public string Url { get; set; }
   41:  
   42:         /// <summary/>
   43:         public DateTime Created { get; set; }
   44:  
   45:         /// <summary/>
   46:         public virtual ICollection<Product> Products { get; set; }
   47:  
   48:         ////////////////////////////////////////////////////////////////////////////
   49:  
   50:         /// <summary>
   51:         ///
   52:         /// </summary>
   53:         public static int CategoryId(Site site, int xmlId)
   54:         {
   55:             int id;
   56:  
   57:             if (site != null)
   58:             {
   59:                 id = site.Id * 10000 + xmlId;
   60:             }
   61:             else id = Ia.Statistics.Cl.Models.Default.UndefinedOrInvalidOrUnknown;
   62:  
   63:             return id;
   64:         }
   65:  
   66:         ////////////////////////////////////////////////////////////////////////////
   67:         ////////////////////////////////////////////////////////////////////////////
   68:     }
   69:  
   70:     ////////////////////////////////////////////////////////////////////////////
   71:     ////////////////////////////////////////////////////////////////////////////
   72: }