Example #1
0
        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);
                }
            }
        }
Example #2
0
        public static Guid?InsertUpdatetT_OE_PROJECTS(Guid?pROJECT_IDX, Guid?oRG_IDX, string pROJ_NAME, string pROJ_DESC, int?mEDIA_TAG, int?sTART_YEAR,
                                                      string pROJ_STATUS, int?dATE_LAST_UPDATE, string rECORD_SOURCE, string pROJECT_URL, int?mOBILE_IND, string mOBILE_DESC, int?aDV_MON_IND,
                                                      string aDV_MON_DESC, int?bP_MODERN_IND, string bP_MODERN_DESC, string cOTS, string vENDOR, bool aCT_IND, bool?sYNC_IND, int?cREATE_USER = 0,
                                                      bool?updateSearch = false)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                try
                {
                    Boolean insInd = false;

                    T_OE_PROJECTS e = (from c in ctx.T_OE_PROJECTS
                                       where c.PROJECT_IDX == pROJECT_IDX
                                       select c).FirstOrDefault();

                    if (e == null)
                    {
                        insInd           = true;
                        e                = new T_OE_PROJECTS();
                        e.PROJECT_IDX    = Guid.NewGuid();
                        e.CREATE_DT      = System.DateTime.Now;
                        e.CREATE_USERIDX = cREATE_USER;
                    }
                    else
                    {
                        e.MODIFY_DT      = System.DateTime.Now;
                        e.MODIFY_USERIDX = cREATE_USER;
                    }

                    if (oRG_IDX != null)
                    {
                        e.ORG_IDX = oRG_IDX.ConvertOrDefault <Guid>();
                    }
                    if (pROJ_NAME != null)
                    {
                        e.PROJ_NAME = pROJ_NAME;
                    }
                    if (pROJ_DESC != null)
                    {
                        e.PROJ_DESC = pROJ_DESC;
                    }
                    if (mEDIA_TAG != null)
                    {
                        e.MEDIA_TAG = mEDIA_TAG;
                    }
                    if (sTART_YEAR != null)
                    {
                        e.START_YEAR = sTART_YEAR;
                    }
                    if (pROJ_STATUS != null)
                    {
                        e.PROJ_STATUS = pROJ_STATUS;
                    }
                    if (dATE_LAST_UPDATE != null)
                    {
                        e.DATE_LAST_UPDATE = dATE_LAST_UPDATE;
                    }
                    if (rECORD_SOURCE != null)
                    {
                        e.RECORD_SOURCE = rECORD_SOURCE;
                    }
                    if (e.RECORD_SOURCE == null)
                    {
                        e.RECORD_SOURCE = "Agency supplied";
                    }
                    if (pROJECT_URL != null)
                    {
                        e.PROJECT_URL = pROJECT_URL;
                    }
                    if (mOBILE_IND != null)
                    {
                        e.MOBILE_IND = mOBILE_IND;
                    }
                    if (mOBILE_DESC != null)
                    {
                        e.MOBILE_DESC = mOBILE_DESC;
                    }
                    if (aDV_MON_IND != null)
                    {
                        e.ADV_MON_IND = aDV_MON_IND;
                    }
                    if (aDV_MON_DESC != null)
                    {
                        e.ADV_MON_DESC = aDV_MON_DESC;
                    }
                    if (bP_MODERN_IND != null)
                    {
                        e.BP_MODERN_IND = bP_MODERN_IND;
                    }
                    if (bP_MODERN_DESC != null)
                    {
                        e.BP_MODERN_DESC = bP_MODERN_DESC;
                    }
                    if (cOTS != null)
                    {
                        e.COTS = cOTS;
                    }
                    if (vENDOR != null)
                    {
                        e.VENDOR = vENDOR;
                    }
                    e.ACT_IND = aCT_IND;
                    if (sYNC_IND != null)
                    {
                        e.SYNC_IND = sYNC_IND ?? false;
                    }

                    if (insInd)
                    {
                        ctx.T_OE_PROJECTS.Add(e);
                    }

                    ctx.SaveChanges();
                    return(e.PROJECT_IDX);
                }
                catch (Exception ex)
                {
                    db_Ref.LogEFException(ex);
                    return(null);
                }
            }
        }
Example #3
0
 //INITIALIZE
 public ProjectImportType()
 {
     T_OE_PROJECT = new T_OE_PROJECTS();
     VALIDATE_CD  = true;
 }