예제 #1
0
        public static int DeleteT_OE_REF_TAGS(int id)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                try
                {
                    T_OE_REF_TAGS rec = new T_OE_REF_TAGS {
                        TAG_IDX = id
                    };
                    ctx.Entry(rec).State = System.Data.Entity.EntityState.Deleted;
                    ctx.SaveChanges();

                    return(1);
                }
                catch (Exception ex)
                {
                    LogEFException(ex);
                    return(0);
                }
            }
        }
예제 #2
0
        public static int DeleteT_OE_ORGANIZATION_EMAIL_RULE(Guid id, string email)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                try
                {
                    T_OE_ORGANIZATION_EMAIL_RULE rec = new T_OE_ORGANIZATION_EMAIL_RULE {
                        ORG_IDX = id, EMAIL_STRING = email
                    };
                    ctx.Entry(rec).State = System.Data.Entity.EntityState.Deleted;
                    ctx.SaveChanges();

                    return(1);
                }
                catch (Exception ex)
                {
                    LogEFException(ex);
                    return(0);
                }
            }
        }
예제 #3
0
파일: db_EECIP.cs 프로젝트: ljsweeny/EECIP
        public static int DeleteT_OE_PROJECTS(Guid id)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                try
                {
                    T_OE_PROJECTS rec = new T_OE_PROJECTS {
                        PROJECT_IDX = id
                    };
                    ctx.Entry(rec).State = System.Data.Entity.EntityState.Deleted;
                    ctx.SaveChanges();

                    return(1);
                }
                catch (Exception ex)
                {
                    db_Ref.LogEFException(ex);
                    return(0);
                }
            }
        }
예제 #4
0
        public static int DeleteT_OE_ORGANIZATION(Guid id)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                try
                {
                    //***************** VALIDATION (DONT DELETE ORG IF ANY USERS) **********************
                    List <T_OE_USERS> u = db_Accounts.GetT_OE_USERSByAgency(id);
                    if (u != null && u.Count > 0)
                    {
                        return(-1);
                    }

                    List <T_OE_PROJECTS> p = db_EECIP.GetT_OE_PROJECTS_ByOrgIDX(id);
                    if (p != null && p.Count > 0)
                    {
                        return(-2);
                    }

                    List <OrganizationEntServicesDisplayType> es = db_EECIP.GetT_OE_ORGANIZATION_ENT_SVCS_NoLeftJoin(id);
                    if (es != null && es.Count > 0)
                    {
                        return(-3);
                    }

                    T_OE_ORGANIZATION rec = new T_OE_ORGANIZATION {
                        ORG_IDX = id
                    };
                    ctx.Entry(rec).State = System.Data.Entity.EntityState.Deleted;
                    ctx.SaveChanges();

                    return(1);
                }
                catch (Exception ex)
                {
                    LogEFException(ex);
                    return(0);
                }
            }
        }