コード例 #1
0
ファイル: db_Ref.cs プロジェクト: richagsingh/EECIP-master
        public static int DeleteT_OE_REF_ENTERPRISE_PLATFORM(int id)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                try
                {
                    T_OE_REF_ENTERPRISE_PLATFORM rec = new T_OE_REF_ENTERPRISE_PLATFORM {
                        ENT_PLATFORM_IDX = id
                    };
                    ctx.Entry(rec).State = System.Data.Entity.EntityState.Deleted;
                    ctx.SaveChanges();

                    return(1);
                }
                catch (Exception ex)
                {
                    LogEFException(ex);
                    return(0);
                }
            }
        }
コード例 #2
0
ファイル: db_Ref.cs プロジェクト: richagsingh/EECIP-master
        public static int InsertUpdatetT_OE_REF_ENTERPRISE_PLATFORM(int eNT_PLATFORM_IDX, string eNT_PLATFORM_NAME, string eNT_PLATFORM_DESC, string eNT_PLATFORM_EXAMPLE,
                                                                    int?sEQ_NO, bool?aCT_IND, int?cREATE_USER = 0)
        {
            using (EECIPEntities ctx = new EECIPEntities())
            {
                try
                {
                    Boolean insInd = false;

                    T_OE_REF_ENTERPRISE_PLATFORM e = (from c in ctx.T_OE_REF_ENTERPRISE_PLATFORM
                                                      where c.ENT_PLATFORM_IDX == eNT_PLATFORM_IDX
                                                      select c).FirstOrDefault();

                    if (e == null)
                    {
                        insInd = true;
                        e      = new T_OE_REF_ENTERPRISE_PLATFORM();
                    }


                    if (eNT_PLATFORM_NAME != null)
                    {
                        e.ENT_PLATFORM_NAME = eNT_PLATFORM_NAME;
                    }
                    if (eNT_PLATFORM_DESC != null)
                    {
                        e.ENT_PLATFORM_DESC = eNT_PLATFORM_DESC;
                    }
                    if (eNT_PLATFORM_EXAMPLE != null)
                    {
                        e.ENT_PLATFORM_EXAMPLE = eNT_PLATFORM_EXAMPLE;
                    }
                    if (sEQ_NO != null)
                    {
                        e.SEQ_NO = sEQ_NO;
                    }
                    if (e.SEQ_NO == null)
                    {
                        e.SEQ_NO = GetT_OE_REF_ENTERPRISE_PLATFORM_MaxSeq() + 1;
                    }
                    if (aCT_IND != null)
                    {
                        e.ACT_IND = aCT_IND ?? true;
                    }

                    e.MODIFY_DT      = System.DateTime.Now;
                    e.MODIFY_USERIDX = cREATE_USER;

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

                    ctx.SaveChanges();
                    return(e.ENT_PLATFORM_IDX);
                }
                catch (Exception ex)
                {
                    LogEFException(ex);
                    return(0);
                }
            }
        }