Esempio n. 1
0
 public static int DeleteT_WQX_IMPORT_LOG(int iMPORT_ID)
 {
     using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
     {
         try
         {
             T_WQX_IMPORT_LOG r = new T_WQX_IMPORT_LOG();
             r = (from c in ctx.T_WQX_IMPORT_LOG
                  where c.IMPORT_ID == iMPORT_ID select c).FirstOrDefault();
             ctx.DeleteObject(r);
             ctx.SaveChanges();
             return 1;
         }
         catch
         {
             return 0;
         }
     }
 }
Esempio n. 2
0
        public static int UpdateWQX_IMPORT_LOG_MarkPendingSampImportAsComplete(string oRG_ID)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_WQX_IMPORT_LOG t = new T_WQX_IMPORT_LOG();
                    t = (from c in ctx.T_WQX_IMPORT_LOG
                         where c.IMPORT_PROGRESS == "P"
                         && c.TYPE_CD == "Sample"
                         select c).FirstOrDefault();

                    t.IMPORT_STATUS = "Success";
                    t.IMPORT_PROGRESS = "100";
                    t.IMPORT_PROGRESS_MSG = "Import complete.";

                    ctx.SaveChanges();

                    return t.IMPORT_ID;
                }
                catch
                {
                    return 0;
                }
            }
        }
 /// <summary>
 /// Create a new T_WQX_IMPORT_LOG object.
 /// </summary>
 /// <param name="iMPORT_ID">Initial value of the IMPORT_ID property.</param>
 /// <param name="oRG_ID">Initial value of the ORG_ID property.</param>
 /// <param name="tYPE_CD">Initial value of the TYPE_CD property.</param>
 /// <param name="fILE_NAME">Initial value of the FILE_NAME property.</param>
 /// <param name="fILE_SIZE">Initial value of the FILE_SIZE property.</param>
 public static T_WQX_IMPORT_LOG CreateT_WQX_IMPORT_LOG(global::System.Int32 iMPORT_ID, global::System.String oRG_ID, global::System.String tYPE_CD, global::System.String fILE_NAME, global::System.Int32 fILE_SIZE)
 {
     T_WQX_IMPORT_LOG t_WQX_IMPORT_LOG = new T_WQX_IMPORT_LOG();
     t_WQX_IMPORT_LOG.IMPORT_ID = iMPORT_ID;
     t_WQX_IMPORT_LOG.ORG_ID = oRG_ID;
     t_WQX_IMPORT_LOG.TYPE_CD = tYPE_CD;
     t_WQX_IMPORT_LOG.FILE_NAME = fILE_NAME;
     t_WQX_IMPORT_LOG.FILE_SIZE = fILE_SIZE;
     return t_WQX_IMPORT_LOG;
 }
Esempio n. 4
0
        //*********************** IMPORT LOG *******************************
        public static int InsertUpdateWQX_IMPORT_LOG(int? iMPORT_ID, string oRG_ID, string tYPE_CD, string fILE_NAME, int fILE_SIZE, string iMPORT_STATUS, string iMPORT_PROGRESS,
            string iMPORT_PROGRESS_MSG, byte[] iMPORT_FILE, string uSER_ID)
        {
            using (OpenEnvironmentEntities ctx = new OpenEnvironmentEntities())
            {
                try
                {
                    T_WQX_IMPORT_LOG t = new T_WQX_IMPORT_LOG();
                    if (iMPORT_ID != null)
                        t = (from c in ctx.T_WQX_IMPORT_LOG
                             where c.IMPORT_ID == iMPORT_ID
                             select c).First();

                    if (iMPORT_ID == null)
                        t = new T_WQX_IMPORT_LOG();

                    if (oRG_ID != null) t.ORG_ID = oRG_ID;
                    if (tYPE_CD != null) t.TYPE_CD = tYPE_CD.Substring(0,5);
                    if (fILE_NAME!= null) t.FILE_NAME = fILE_NAME;
                    t.FILE_SIZE = fILE_SIZE;
                    if (iMPORT_STATUS != null) t.IMPORT_STATUS = iMPORT_STATUS;
                    if (iMPORT_PROGRESS != null) t.IMPORT_PROGRESS = iMPORT_PROGRESS;
                    if (iMPORT_PROGRESS_MSG != null) t.IMPORT_PROGRESS_MSG = iMPORT_PROGRESS_MSG;
                    if (iMPORT_FILE != null) t.IMPORT_FILE = iMPORT_FILE;
                    if (uSER_ID != null) t.CREATE_USERID = uSER_ID;

                    if (iMPORT_ID == null) //insert case
                    {
                        t.CREATE_DT = DateTime.Now;
                        ctx.AddToT_WQX_IMPORT_LOG(t);
                    }
                    else
                    {
                    }

                    ctx.SaveChanges();

                    return t.IMPORT_ID;
                }
                catch
                {
                    return 0;
                }
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the T_WQX_IMPORT_LOG EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToT_WQX_IMPORT_LOG(T_WQX_IMPORT_LOG t_WQX_IMPORT_LOG)
 {
     base.AddObject("T_WQX_IMPORT_LOG", t_WQX_IMPORT_LOG);
 }