Example #1
0
        public void DeleteRecord(PdfFileInfo fileInf)
        {
            try
            {
                OracleParameter[] delParameters = new OracleParameter[2];
                delParameters[0] = new OracleParameter(":RELATION_OBJECT", fileInf.RelationObject);
                delParameters[1] = new OracleParameter(":RELATION_ID", fileInf.RelationId);

                string delExtra = "";
                if (fileInf.Name.IndexOf("UA") != -1)
                {
                    delExtra = " AND SH0RT_FILE_NAME LIKE '%UA%' ";
                }
                if (fileInf.Name.IndexOf("OG") != -1)
                {
                    delExtra = " AND SH0RT_FILE_NAME LIKE '%OG%' ";
                }
                if (fileInf.Name.IndexOf("UGTL") != -1)
                {
                    delExtra = string.Format(" AND SH0RT_FILE_NAME = '{0}' ", fileInf.Name);
                }

                Exec("DELETE FROM GNLD_UPLOAD_FILE WHERE RELATION_OBJECT = :RELATION_OBJECT AND RELATION_ID = :RELATION_ID " + delExtra, delParameters);
            }
            catch (Exception exception)
            {
                Logger.E(string.Concat("Öncei dökümanlar silinemedi! Message:" + exception.Message, ",StackTrace:", exception.StackTrace));
            }
        }
Example #2
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     try
     {
         if (listView.SelectedIndices.Count > 0)
         {
             int oid = Convert.ToInt32(listView.Items[listView.SelectedIndices[0]].Text);
             if (Utility.Sor(oid + " nolu kayıt gönderilmedi olarak güncellenecek, kabul ediyor musunuz?"))
             {
                 PdfFileInfo file = XpoDefault.Session.GetObjectByKey <PdfFileInfo>(oid);
                 if (file != null)
                 {
                     file.FileType  = PdfFileType.Bilinmiyor;
                     file.UploadMsg = "";
                     file.Aktarim   = AktarimDurumu.Bekliyor;
                     file.Save();
                 }
                 Dosyalar();
             }
         }
     }
     catch (Exception exc)
     {
         Utility.Hata(exc);
     }
 }
Example #3
0
        public int InsertRecord(PdfFileInfo fileInf)
        {
            try
            {
                int    uploadFileId = 1;
                object objIds       = ExecuteScalar("SELECT MAX(UPLOAD_FILE_ID) AS UPLOAD_FILE_ID FROM GNLD_UPLOAD_FILE", null);

                if (objIds != null && object.ReferenceEquals(objIds, DBNull.Value) == false)
                {
                    uploadFileId = Convert.ToInt32(objIds) + 1;
                }
                string            commandText   = "INSERT INTO GNLD_UPLOAD_FILE (UPLOAD_FILE_ID, RELATION_OBJECT, RELATION_ID, SH0RT_FILE_NAME, LONG_FILE_NAME, DOCUMENT_TYPE, DESCRIPTION, CREATE_DATE, CREATE_USER_ID) VALUES (:UPLOAD_FILE_ID, :RELATION_OBJECT, :RELATION_ID, :SH0RT_FILE_NAME, :LONG_FILE_NAME, :DOCUMENT_TYPE, :DESCRIPTION, :CREATE_DATE, :CREATE_USER_ID)";
                OracleParameter[] oraParameters = new OracleParameter[9];
                oraParameters[0] = new OracleParameter(":UPLOAD_FILE_ID", uploadFileId);
                oraParameters[1] = new OracleParameter(":RELATION_OBJECT", fileInf.RelationObject);
                oraParameters[2] = new OracleParameter(":RELATION_ID", fileInf.RelationId);
                oraParameters[3] = new OracleParameter(":SH0RT_FILE_NAME", fileInf.Name);
                oraParameters[4] = new OracleParameter(":LONG_FILE_NAME", fileInf.Name);
                oraParameters[5] = new OracleParameter(":DOCUMENT_TYPE", StaticsVariable.DOCUMENT_TYPE);
                oraParameters[6] = new OracleParameter(":DESCRIPTION", StaticsVariable.DESCRIPTION);
                oraParameters[7] = new OracleParameter(":CREATE_DATE", DateTime.Now);
                oraParameters[8] = new OracleParameter(":CREATE_USER_ID", AppSettingHelper.Default.userid);

                if (Exec(commandText, oraParameters))
                {
                    OracleParameter[] selParameters = new OracleParameter[2];
                    selParameters[0] = new OracleParameter(":UPLOAD_FILE_ID", uploadFileId);
                    selParameters[1] = new OracleParameter(":SH0RT_FILE_NAME", fileInf.Name);
                    objIds           = ExecuteScalar("SELECT UPLOAD_FILE_ID FROM GNLD_UPLOAD_FILE WHERE UPLOAD_FILE_ID = :UPLOAD_FILE_ID OR SH0RT_FILE_NAME = :SH0RT_FILE_NAME", selParameters);

                    if (objIds != null && object.ReferenceEquals(objIds, DBNull.Value) == false)
                    {
                        return(Convert.ToInt32(objIds));
                    }

                    return(uploadFileId);
                }
                else
                {
                    return(-1);
                }
            }
            catch (Exception exception)
            {
                Logger.E(string.Concat("Yeni kayıt eklenemedi! Message:" + exception.Message, ",StackTrace:", exception.StackTrace));
                return(-2);
            }
        }
Example #4
0
 private void Kaydet(object paramobj)
 {
     try
     {
         Thread.Sleep(1000);
         Thread.Sleep(1000);
         FileInfo inf = new FileInfo(paramobj.ToString());
         lock (lockObject)
         {
             using (UnitOfWork wrk = new UnitOfWork())
             {
                 PdfFileInfo pdf = new PdfFileInfo(wrk);
                 pdf.Name         = inf.Name;
                 pdf.FullName     = inf.FullName;
                 pdf.Extension    = inf.Extension;
                 pdf.CreationTime = inf.CreationTime;
                 try
                 {
                     pdf.Length = inf.Length;
                 }
                 catch
                 {
                 }
                 //pdf.FileType = PDFExpression.DosyaTuru(Path.GetFileNameWithoutExtension(inf.FullName));
                 pdf.FileType   = PdfFileType.Bilinmiyor;
                 pdf.ChangeType = WatcherChangeTypes.Created;
                 pdf.Save();
                 Utility.WriteTrace(pdf.ToString());
                 wrk.CommitChanges();
             }
         }
         if (!StaticsVariable.APPVISIBLE)
         {
             this.notifyIconApp.ShowBalloonTip(1000, "UyumSoft", "Yeni dosya algılandı." + inf.Name, ToolTipIcon.Info);
         }
         else
         {
             Utility.WriteTrace("Yeni dosya algılandı." + inf.Name);
         }
     }
     catch (Exception exc)
     {
         Utility.WriteTrace(exc.Message);
         Utility.WriteTrace(exc.StackTrace);
     }
 }
Example #5
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     try
     {
         if (listView.SelectedIndices.Count > 0)
         {
             int oid = Convert.ToInt32(listView.Items[listView.SelectedIndices[0]].Text);
             if (Utility.Sor(oid + " nolu kayıt silinecek kabul ediyor musunuz?"))
             {
                 PdfFileInfo file = XpoDefault.Session.GetObjectByKey <PdfFileInfo>(oid);
                 if (file != null)
                 {
                     file.Delete();
                 }
                 Dosyalar();
             }
         }
     }
     catch (Exception exc)
     {
         Utility.Hata(exc);
     }
 }