示例#1
0
        private static void Read(string entityName)
        {
            string nameParseResult = TryParseProperty.TryParseStringProperty(Localize.PropertyName, entityName);

            Console.WriteLine(Localize.Reading + "...");
            try
            {
                CRUDOperations.ReadEntity(nameParseResult, Guid.Empty, false);
                Console.WriteLine(String.Format(Localize.Done, entityName, Localize.Read));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
示例#2
0
        private static void ReadById(string entityName)
        {
            Guid guidParseResult = TryParseProperty.TryParseGuidProperty(Localize.PropertyId, entityName);

            Console.WriteLine(Localize.Reading + "...");
            try
            {
                CRUDOperations.ReadEntity(String.Empty, guidParseResult, true);
                Console.WriteLine(String.Format(Localize.Done, entityName, Localize.Read));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
示例#3
0
        private static void Delete(string entityName)
        {
            Guid IdParseResult = TryParseProperty.TryParseGuidProperty(Localize.PropertyId, entityName);

            Console.WriteLine(Localize.Deleting + "...");
            try
            {
                CRUDOperations.DeleteEntity(IdParseResult);
                Console.WriteLine(String.Format(Localize.Done, entityName, Localize.Deleted));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
示例#4
0
        private static void Create(string entityName)
        {
            string   nameParseResult         = TryParseProperty.TryParseStringProperty(Localize.PropertyName, entityName);
            int      completenessParseResult = TryParseProperty.TryParseIntProperty(Localize.PropertyCompleteness, entityName);
            DateTime createdOnParseResult    = TryParseProperty.TryParseDateTimeProperty(Localize.PropertyCreatedOn, entityName);
            Guid     typeIdParseResult       = TryParseProperty.TryParseGuidProperty(Localize.PropertyTypeId, entityName);

            Console.WriteLine(Localize.Creating + "...");
            try
            {
                CRUDOperations.CreateEntity(nameParseResult, completenessParseResult, createdOnParseResult, typeIdParseResult);
                Console.WriteLine(String.Format(Localize.Done, entityName, Localize.Created));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }