예제 #1
0
 partial void DeleteBin(Bin instance);
예제 #2
0
 partial void InsertBin(Bin instance);
예제 #3
0
 partial void UpdateBin(Bin instance);
예제 #4
0
        /// <summary>
        /// InsertBin
        /// </summary>
        /// <param name="key"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public int InsertBin(string key, string status)
        {
            try
            {
                var userId = context.Auths.Where(@w => @w.Key == key).First().UserId;
                short binStatus = Convert.ToInt16(status);
                Guid binId = Guid.NewGuid();

                Bin bin = new Bin
                {
                    Id = binId,
                    Status = binStatus,
                    UserId = userId
                };

                context.Bins.InsertOnSubmit(bin);
                InsertGarbage(binId, userId);
                SubmitData();
                return 210;
            }
            catch (Exception ex)
            {
                return 100;
            }
        }