Пример #1
0
        //*********************** WQX TRANSACTION LOG*******************************
        public static int InsertUpdateWQX_TRANSACTION_LOG(int? lOG_ID, string tABLE_CD, int tABLE_IDX, string sUBMIT_TYPE, byte[] rESPONSE_FILE, 
            string rESPONSE_TXT, string cDX_SUBMIT_TRANS_ID, string cDX_SUBMIT_STATUS, string oRG_ID)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                //try
                //{
                    T_WQX_TRANSACTION_LOG t = new T_WQX_TRANSACTION_LOG();
                    if (lOG_ID != null)
                        t = (from c in ctx.T_WQX_TRANSACTION_LOG
                             where c.LOG_ID == lOG_ID
                             select c).First();

                    if (lOG_ID == null)
                        t = new T_WQX_TRANSACTION_LOG();

                    if (tABLE_CD != null) t.TABLE_CD = tABLE_CD;
                    t.TABLE_IDX = tABLE_IDX;
                    if (sUBMIT_TYPE != null) t.SUBMIT_TYPE = sUBMIT_TYPE;
                    if (rESPONSE_FILE != null) t.RESPONSE_FILE = rESPONSE_FILE;
                    if (rESPONSE_TXT != null) t.RESPONSE_TXT = rESPONSE_TXT;
                    if (cDX_SUBMIT_TRANS_ID != null) t.CDX_SUBMIT_TRANSID = cDX_SUBMIT_TRANS_ID;
                    if (cDX_SUBMIT_STATUS != null) t.CDX_SUBMIT_STATUS = cDX_SUBMIT_STATUS;
                    if (oRG_ID != null) t.ORG_ID = oRG_ID;

                    if (lOG_ID == null) //insert case
                    {
                        t.SUBMIT_DT = System.DateTime.Now;
                        ctx.AddToT_WQX_TRANSACTION_LOG(t);
                    }

                    ctx.SaveChanges();

                    return t.LOG_ID;
                //}
                //catch
                //{
                //    return 0;
                //}
            }
        }