Ejemplo n.º 1
0
 partial void Deletetbl_Roles(tbl_Roles instance);
Ejemplo n.º 2
0
 partial void Updatetbl_Roles(tbl_Roles instance);
Ejemplo n.º 3
0
 partial void Inserttbl_Roles(tbl_Roles instance);
Ejemplo n.º 4
0
		private void detach_tbl_Roles(tbl_Roles entity)
		{
			this.SendPropertyChanging();
			entity.tbl_Status = null;
		}
Ejemplo n.º 5
0
        private bool InsertRole(RoleInfo entRole)
        {
            DbTransaction trans = null;
            TCRepositoryDataContext context = DataBaseUtils.GetContext();
            bool result = false;

            try
            {
                context.Connection.Open();
                trans = context.Connection.BeginTransaction();
                context.Transaction = trans;

                tbl_Roles dbRole = new tbl_Roles()
                {
                    Description = entRole.Description,
                    IdStatus = entRole.EntStatus.IdStatus,
                    Name = entRole.Name,
                    RoleCode = entRole.RoleCode
                };
                context.tbl_Roles.InsertOnSubmit(dbRole);
                context.SubmitChanges();

                List<ServicesLibrary.Entities.SiteMap> listSiteMap = entRole.EntListSiteMap;
                List<tbl_Roles_SiteMap> dbRolesSiteMap = (from s in listSiteMap
                                                          select new tbl_Roles_SiteMap()
                                                          {
                                                              IdRole = dbRole.IdRole,
                                                              IdSiteMap = s.IdSiteMap
                                                          }).ToList();
                context.tbl_Roles_SiteMap.InsertAllOnSubmit(dbRolesSiteMap);
                context.SubmitChanges();

                trans.Commit();

                result = true;
            }
            catch (SqlException excs)
            {
                if (trans != null)
                    trans.Rollback();

            }
            catch (Exception exc)
            {
                if (trans != null)
                    trans.Rollback();
            }
            finally
            {
                if (context.Connection.State == ConnectionState.Open)
                    context.Connection.Close();
            }
            return result;
        }
Ejemplo n.º 6
0
 private void AssignDataObjectToEntity(tbl_Roles dbRole, ref RoleInfo entRoleInfo)
 {
     entRoleInfo.IdRole = dbRole.IdRole;
     entRoleInfo.Name = dbRole.Name;
     entRoleInfo.Description = dbRole.Description;
     entRoleInfo.RoleCode = dbRole.RoleCode;
     entRoleInfo.EntStatus = new Status { IdStatus = dbRole.tbl_Status.IdStatus, Name = dbRole.tbl_Status.Name };
 }