partial void DeleteGarbage(Garbage instance);
 partial void InsertGarbage(Garbage instance);
 partial void UpdateGarbage(Garbage instance);
Exemple #4
0
        /// <summary>
        /// InsertGarbage
        /// </summary>
        /// <param name="binId"></param>
        private int InsertGarbage(Guid binId, Guid userId)
        {
            try
            {
                var garbageId = Guid.NewGuid();
                var tag = GenerateTag(userId);
                Garbage garbage = new Garbage
                {
                    Id = garbageId,
                    Tag = tag,
                    BinId = binId,
                    CreateDateTime = DateTime.Now
                };

                context.Garbages.InsertOnSubmit(garbage);
                SubmitData();

                InsertOrder(tag, "WET", true, true, 0);
                InsertOrder(tag, "DRY", true, true, 0);

                return 211;
            }
            catch (Exception ex)
            {
                return 100;
            }
        }