コード例 #1
0
        public bool AddPrefixToDepartment(DepartmentPrefixItem entity)
        {
            bool result = false;

            using (ScheduleDataContext ctx = new ScheduleDataContext())
            {

                DepartmentPrefix misc = new DepartmentPrefix();

                misc.DepartmentID = entity.DepartmentId;
                misc.Prefix = entity.PrefixText;

                ctx.DepartmentPrefixes.InsertOnSubmit(misc);

                try
                {
                    ctx.SubmitChanges();
                    result = true;

                }
                catch (Exception ex)
                {
                    throw new Exception("Unable to add prefix: " + ex.Message);
                }

            }

            return result;
        }
コード例 #2
0
 partial void UpdateDepartmentPrefix(DepartmentPrefix instance);
コード例 #3
0
 partial void DeleteDepartmentPrefix(DepartmentPrefix instance);
コード例 #4
0
 partial void InsertDepartmentPrefix(DepartmentPrefix instance);