コード例 #1
0
        // Constructor
        public TogetherFormViewModel(Together together)
        {
            Together = together;

            TogetherTypes = CreateTogetherTypes(Together.TogetherType);

            FeeTypes = CreateFeeTypes(Together.FeeType);
        }
コード例 #2
0
        private static SelectList CreateFeeTypes(FeeTypeEnum SelectedType)
        {
            Dictionary <int, string> feeTypes = new Dictionary <int, string>();

            foreach (int i in Enum.GetValues(typeof(FeeTypeEnum)))
            {
                feeTypes.Add(i, Together.GetStringFromFeeType((FeeTypeEnum)i));
            }
            return(new SelectList(feeTypes, "Key", "Value", (int)SelectedType));
        }
コード例 #3
0
        public static SelectList CreateTogetherTypesWithAll()
        {
            Dictionary <int, string> togetherTypes = new Dictionary <int, string>();

            foreach (int i in Enum.GetValues(typeof(TogetherTypeWithAllEnum)))
            {
                if (i == 0)
                {
                    togetherTypes.Add(0, "所有类型");
                }
                else
                {
                    togetherTypes.Add(i, Together.GetStringFromTogetherType((TogetherTypeEnum)i));
                }
            }
            return(new SelectList(togetherTypes, "Key", "Value", (int)TogetherTypeWithAllEnum.All));
        }
コード例 #4
0
 public void Delete(Together together)
 {
     db.Post.DeleteAllOnSubmit(together.Posts);
     db.Attendee.DeleteAllOnSubmit(together.Attendees);
     db.Together.DeleteOnSubmit(together);
 }
コード例 #5
0
 // 插入/删除
 public void Add(Together together)
 {
     db.Together.InsertOnSubmit(together);
 }
コード例 #6
0
 partial void DeleteTogether(Together instance);
コード例 #7
0
 partial void UpdateTogether(Together instance);
コード例 #8
0
 partial void InsertTogether(Together instance);