partial void DeleteHelpDesk_Attachment(HelpDesk_Attachment instance);
 partial void UpdateHelpDesk_Attachment(HelpDesk_Attachment instance);
 partial void InsertHelpDesk_Attachment(HelpDesk_Attachment instance);
		private void detach_HelpDesk_Attachments(HelpDesk_Attachment entity)
		{
			this.SendPropertyChanging();
			entity.HelpDesk_TaskDetail = null;
		}
Пример #5
0
        private void UploadFileCommentEdit(int intDetailID)
        {
            HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext();

            string strUploFilesPath = (from HelpDesk_Settings in objHelpDeskDALDataContext.HelpDesk_Settings
                                           where HelpDesk_Settings.PortalID == PortalId
                                           where HelpDesk_Settings.SettingName == "UploFilesPath"
                                           select HelpDesk_Settings).FirstOrDefault().SettingValue;

            EnsureDirectory(new System.IO.DirectoryInfo(strUploFilesPath));
            string strfilename = Convert.ToString(intDetailID) + "_" + GetRandomPassword() + Path.GetExtension(fuAttachment.FileName).ToLower();
            strUploFilesPath = strUploFilesPath + @"\" + strfilename;
            fuAttachment.SaveAs(strUploFilesPath);

            HelpDesk_Attachment objHelpDesk_Attachment = new HelpDesk_Attachment();
            objHelpDesk_Attachment.DetailID = intDetailID;
            objHelpDesk_Attachment.FileName = strfilename;
            objHelpDesk_Attachment.OriginalFileName = fuAttachment.FileName;
            objHelpDesk_Attachment.AttachmentPath = strUploFilesPath;
            objHelpDesk_Attachment.UserID = UserId;

            objHelpDeskDALDataContext.HelpDesk_Attachments.InsertOnSubmit(objHelpDesk_Attachment);
            objHelpDeskDALDataContext.SubmitChanges();

            // Insert Log
			Log.InsertLog(TaskID, UserId, String.Format(Localization.GetString ("UploadedFile.Text.", LocalResourceFile), GetUserName(), fuAttachment.FileName));
        }
Пример #6
0
        // File upload

        #region UploadFile
        private void UploadFile(int intDetailID)
        {
            HelpDeskDALDataContext objHelpDeskDALDataContext = new HelpDeskDALDataContext();

            string strUploFilesPath = (from HelpDesk_Settings in objHelpDeskDALDataContext.HelpDesk_Settings
                                           where HelpDesk_Settings.PortalID == PortalId
                                           where HelpDesk_Settings.SettingName == "UploFilesPath"
                                           select HelpDesk_Settings).FirstOrDefault().SettingValue;

            EnsureDirectory(new System.IO.DirectoryInfo(strUploFilesPath));
            string strfilename = Convert.ToString(intDetailID) + "_" + GetRandomPassword() + Path.GetExtension(TicketFileUpload.FileName).ToLower();
            strUploFilesPath = strUploFilesPath + @"\" + strfilename;
            TicketFileUpload.SaveAs(strUploFilesPath);

            HelpDesk_Attachment objHelpDesk_Attachment = new HelpDesk_Attachment();
            objHelpDesk_Attachment.DetailID = intDetailID;
            objHelpDesk_Attachment.FileName = strfilename;
            objHelpDesk_Attachment.OriginalFileName = TicketFileUpload.FileName;
            objHelpDesk_Attachment.AttachmentPath = strUploFilesPath;
            objHelpDesk_Attachment.UserID = UserId;

            objHelpDeskDALDataContext.HelpDesk_Attachments.InsertOnSubmit(objHelpDesk_Attachment);
            objHelpDeskDALDataContext.SubmitChanges();
        }