当前位置: 首页>>代码示例>>C#>>正文


C# DBTypes.DBDateTime类代码示例

本文整理汇总了C#中Framework.Runtime.DBTypes.DBDateTime的典型用法代码示例。如果您正苦于以下问题:C# DBDateTime类的具体用法?C# DBDateTime怎么用?C# DBDateTime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DBDateTime类属于Framework.Runtime.DBTypes命名空间,在下文中一共展示了DBDateTime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddEvent

 public void AddEvent(DBDateTime dTimeStamp, DBString cSeverity, DBString cSource, DBString cMethod,
                  DBString cThreadInfo, DBString cWindowsIdentity, DBString cPrincipalName, DBString cMessage,
                  out int retVal)
 {
     SqlCommand command1 = base.PrepareSPCall("aeAddEvent");
       SqlParameter parameter1 = command1.Parameters.Add("@RETURNVALUE", SqlDbType.Int);
       parameter1.Direction = ParameterDirection.ReturnValue;
       SqlParameter parameter2 = command1.Parameters.Add("@dTimeStamp", SqlDbType.DateTime);
       parameter2.Value = dTimeStamp.Value;
       SqlParameter parameter3 = command1.Parameters.Add("@cSeverity", SqlDbType.VarChar, 0x20);
       parameter3.Value = cSeverity.Value;
       SqlParameter parameter4 = command1.Parameters.Add("@cSource", SqlDbType.VarChar, 0x80);
       parameter4.Value = cSource.Value;
       SqlParameter parameter5 = command1.Parameters.Add("@cMethod", SqlDbType.VarChar, 0x80);
       parameter5.Value = cMethod.Value;
       SqlParameter parameter6 = command1.Parameters.Add("@cThreadInfo", SqlDbType.VarChar, 0x80);
       parameter6.Value = cThreadInfo.Value;
       SqlParameter parameter7 = command1.Parameters.Add("@cWindowsIdentity", SqlDbType.VarChar, 0x40);
       parameter7.Value = cWindowsIdentity.Value;
       SqlParameter parameter8 = command1.Parameters.Add("@cPrincipalName", SqlDbType.VarChar, 0x40);
       parameter8.Value = cPrincipalName.Value;
       SqlParameter parameter9 = command1.Parameters.Add("@cMessage", SqlDbType.VarChar, 0x200);
       parameter9.Value = cMessage.Value;
       try
       {
     command1.ExecuteNonQuery();
       }
       finally
       {
     base.FinishSPCall();
       }
       retVal = (int) parameter1.Value;
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:33,代码来源:AuditEventDataContext.cs

示例2: ndihdOrganisationAttachmentUpdate

   public void ndihdOrganisationAttachmentUpdate(DBGuid uID,
 DBGuid uOrganisationRef,
 DBString cPath,
 DBString cName,
 DBString cDescription,
 DBString cAuthor,
 DBString cPublisher,
 DBString cPublishedYear,
 DBString cKeywords,
 DBDateTime dCreatedDate,
 DBInt nFileSize,
 bool bIsActive,
 DBString cKefFileTypeRef,
 DBInt nRank)
   {
       TraceCallEnterEvent.Raise();
         SqlCommand sqlComm = PrepareSPCall("[dbo].[ndihdOrganisationAttachmentUpdate]");
         SqlParameter p1 = sqlComm.Parameters.Add("@uID", SqlDbType.UniqueIdentifier);
         p1.Value = uID.Value;
         SqlParameter p2 = sqlComm.Parameters.Add("@uOrganisationRef", SqlDbType.UniqueIdentifier);
         p2.Value = uOrganisationRef.Value;
         SqlParameter p3 = sqlComm.Parameters.Add("@cPath", SqlDbType.VarChar, 500);
         p3.Value = cPath.Value;
         SqlParameter p4 = sqlComm.Parameters.Add("@cName", SqlDbType.VarChar, 250);
         p4.Value = cName.Value;
         SqlParameter p5 = sqlComm.Parameters.Add("@cDescription", SqlDbType.VarChar, 1000);
         p5.Value = cDescription.Value;
         SqlParameter p6 = sqlComm.Parameters.Add("@cAuthor", SqlDbType.VarChar, 1000);
         p6.Value = cAuthor.Value;
         SqlParameter p7 = sqlComm.Parameters.Add("@cPublisher", SqlDbType.VarChar, 500);
         p7.Value = cPublisher.Value;
         SqlParameter p8 = sqlComm.Parameters.Add("@cPublishedYear", SqlDbType.Char, 4);
         p8.Value = cPublishedYear.Value;
         SqlParameter p9 = sqlComm.Parameters.Add("@cKeywords", SqlDbType.VarChar, 100);
         p9.Value = cKeywords.Value;
         SqlParameter p10 = sqlComm.Parameters.Add("@dCreatedDate", SqlDbType.DateTime);
         p10.Value = dCreatedDate.Value;
         SqlParameter p11 = sqlComm.Parameters.Add("@nFileSize", SqlDbType.Int);
         p11.Value = nFileSize.Value;
         SqlParameter p12 = sqlComm.Parameters.Add("@bIsActive", SqlDbType.Bit);
         p12.Value = bIsActive;
         SqlParameter p13 = sqlComm.Parameters.Add("@cKefFileTypeRef", SqlDbType.Char, 10);
         p13.Value = cKefFileTypeRef.Value;
         SqlParameter p14 = sqlComm.Parameters.Add("@nRank", SqlDbType.Int);
         p14.Value = nRank.Value;
         TraceDbCommandEvent.Raise(sqlComm);
         try
         {
       sqlComm.ExecuteNonQuery();
       TraceCallReturnEvent.Raise();
         }
         catch (SqlException e)
         {
       TraceCallReturnEvent.Raise(false);
       SqlErrorHandler.Handle(e, uID.ToString());
         }
         finally
         {
       FinishSPCall();
         }
   }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:61,代码来源:BaseDataContext2.cs

示例3: ForumThreadBase

 // -------------------------------------------------------------------------------------
 /// <summary>
 /// XmlNode setup constructor
 /// </summary>
 /// <param name="node">XmlNode containing document data.</param>
 // -------------------------------------------------------------------------------------
 public ForumThreadBase(XmlNode node)
 {
     m_ID = new DBGuid(node.Attributes["ID"]);
       m_Name = new DBString(node.SelectSingleNode("Name"));
       m_Description = new DBString(node.SelectSingleNode("Description"));
       m_CreatedBy = new DBString(node.SelectSingleNode("CreatedBy"));
       m_CreatedDate = new DBDateTime(node.SelectSingleNode("CreatedDate"));
       m_IsActive = Convert.ToBoolean(node.SelectSingleNode("IsActive").InnerText);
       m_ForumGroupRef = new DBGuid(node.SelectSingleNode("ForumGroupRef"));
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:16,代码来源:ForumThreadBase.cs

示例4: QuestionFormBase

 // -------------------------------------------------------------------------------------
 /// <summary>
 /// XmlNode setup constructor
 /// </summary>
 /// <param name="node">XmlNode containing document data.</param>
 // -------------------------------------------------------------------------------------
 public QuestionFormBase(XmlNode node)
 {
     m_ID = new DBGuid(node.Attributes["ID"]);
       m_TemplateRef = new DBGuid(node.SelectSingleNode("TemplateRef"));
       m_LastModifiedDate = new DBDateTime(node.SelectSingleNode("LastModifiedDate"));
       m_DecidedDate = new DBDateTime(node.SelectSingleNode("DecidedDate"));
       m_IsActual = Convert.ToBoolean(node.SelectSingleNode("IsActual").InnerText);
       m_LastModifiedByUser = new DBDateTime(node.SelectSingleNode("LastModifiedByUser"));
       m_LastValidationDate = new DBDateTime(node.SelectSingleNode("LastValidationDate"));
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:16,代码来源:QuestionFormBase.cs

示例5: PendingQuestionFormBase

 // -------------------------------------------------------------------------------------
 /// <summary>
 /// XmlNode setup constructor
 /// </summary>
 /// <param name="node">XmlNode containing document data.</param>
 // -------------------------------------------------------------------------------------
 public PendingQuestionFormBase(XmlNode node)
 {
     m_ID = new DBGuid(node.Attributes["ID"]);
       m_QuestionFormRef = new DBGuid(node.SelectSingleNode("QuestionFormRef"));
       m_TemplateRef = new DBGuid(node.SelectSingleNode("TemplateRef"));
       m_Status = new DBString(node.SelectSingleNode("Status"));
       m_SentBy = new DBString(node.SelectSingleNode("SentBy"));
       m_SentDate = new DBDateTime(node.SelectSingleNode("SentDate"));
       m_DecidedBy = new DBString(node.SelectSingleNode("DecidedBy"));
       m_DecidedDate = new DBDateTime(node.SelectSingleNode("DecidedDate"));
       m_RejectComment = new DBString(node.SelectSingleNode("RejectComment"));
       m_IsActual = Convert.ToBoolean(node.SelectSingleNode("IsActual").InnerText);
       m_LastModifiedByUser = new DBDateTime(node.SelectSingleNode("LastModifiedByUser"));
       m_LastValidationDate = new DBDateTime(node.SelectSingleNode("LastValidationDate"));
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:21,代码来源:PendingQuestionFormBase.cs

示例6: ProgramAttachmentBase

 // -------------------------------------------------------------------------------------
 /// <summary>
 /// XmlNode setup constructor
 /// </summary>
 /// <param name="node">XmlNode containing document data.</param>
 // -------------------------------------------------------------------------------------
 public ProgramAttachmentBase(XmlNode node)
 {
     m_ID = new DBGuid(node.Attributes["ID"]);
       m_ProgramRef = new DBGuid(node.SelectSingleNode("ProgramRef"));
       m_Path = new DBString(node.SelectSingleNode("Path"));
       m_Name = new DBString(node.SelectSingleNode("Name"));
       m_Description = new DBString(node.SelectSingleNode("Description"));
       m_Author = new DBString(node.SelectSingleNode("Author"));
       m_Publisher = new DBString(node.SelectSingleNode("Publisher"));
       m_PublishedYear = new DBString(node.SelectSingleNode("PublishedYear"));
       m_Keywords = new DBString(node.SelectSingleNode("Keywords"));
       m_CreatedDate = new DBDateTime(node.SelectSingleNode("CreatedDate"));
       m_FileSize = new DBInt(node.SelectSingleNode("FileSize"));
       m_IsActive = Convert.ToBoolean(node.SelectSingleNode("IsActive").InnerText);
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:21,代码来源:ProgramAttachmentBase.cs

示例7: DesignerDrogAttachmentBase

 // -------------------------------------------------------------------------------------
 /// <summary>
 /// XmlNode setup constructor
 /// </summary>
 /// <param name="node">XmlNode containing document data.</param>
 // -------------------------------------------------------------------------------------
 public DesignerDrogAttachmentBase(XmlNode node)
 {
     m_ID = new DBGuid(node.Attributes["ID"]);
       m_ItemRef = new DBGuid(node.SelectSingleNode("ItemRef"));
       m_Path = new DBString(node.SelectSingleNode("Path"));
       m_Name = new DBString(node.SelectSingleNode("Name"));
       m_Description = new DBString(node.SelectSingleNode("Description"));
       m_CreatedDate = new DBDateTime(node.SelectSingleNode("CreatedDate"));
       m_FileSize = new DBInt(node.SelectSingleNode("FileSize"));
       m_IsActive = Convert.ToBoolean(node.SelectSingleNode("IsActive").InnerText);
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:17,代码来源:DesignerDrogAttachmentBase.cs

示例8: Subtract

 // --------------------------------------------------------------------------------
 /// <summary>
 /// Subtracts the specified date and time from this instance.
 /// </summary>
 /// <param name="value">An instance of DBDateTime.</param>
 /// <returns>
 /// A <see cref="TimeSpan"/> interval equal to the date and time represented by 
 /// this instance minus the date and time represented by <c>value</c>.
 /// </returns>
 /// <exception cref="ArgumentOutOfRangeException">
 /// The resulting DBDateTime is less than <see cref="MinValue"/> or greater than
 /// <see cref="MaxValue"/>.
 /// </exception>
 /// <exception cref="InvalidOperationException">
 /// This instance has a Null value.
 /// </exception>
 /// <remarks>
 /// This method does not change the value of this DBDateTime. Instead, a new 
 /// <see cref="TimeSpan"/> is returned whose value is the result of this operation.
 /// </remarks>
 // --------------------------------------------------------------------------------
 public TimeSpan Subtract(DBDateTime value)
 {
     if (IsNull)
       {
     throw new InvalidOperationException ();
       }
       if (value.IsNull)
       {
     throw new InvalidOperationException ();
       }
       return m_Value.Subtract (value);
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:33,代码来源:DBDateTime.cs

示例9: ndihdPendingQuestionFormInsert

   public void ndihdPendingQuestionFormInsert(DBGuid uID,
 DBGuid uQuestionFormRef,
 DBGuid uTemplateRef,
 DBString cStatus,
 DBString cSentBy,
 DBDateTime dSentDate,
 DBString cDecidedBy,
 DBDateTime dDecidedDate,
 DBString cRejectComment,
 bool bIsActual,
 DBDateTime dLastModifiedByUser,
 DBDateTime dLastValidationDate)
   {
       TraceCallEnterEvent.Raise();
         SqlCommand sqlComm = PrepareSPCall("[dbo].[ndihdPendingQuestionFormInsert]");
         SqlParameter p1 = sqlComm.Parameters.Add("@uID", SqlDbType.UniqueIdentifier);
         p1.Value = uID.Value;
         SqlParameter p2 = sqlComm.Parameters.Add("@uQuestionFormRef", SqlDbType.UniqueIdentifier);
         p2.Value = uQuestionFormRef.Value;
         SqlParameter p3 = sqlComm.Parameters.Add("@uTemplateRef", SqlDbType.UniqueIdentifier);
         p3.Value = uTemplateRef.Value;
         SqlParameter p4 = sqlComm.Parameters.Add("@cStatus", SqlDbType.Char, 3);
         p4.Value = cStatus.Value;
         SqlParameter p5 = sqlComm.Parameters.Add("@cSentBy", SqlDbType.VarChar, 50);
         p5.Value = cSentBy.Value;
         SqlParameter p6 = sqlComm.Parameters.Add("@dSentDate", SqlDbType.DateTime);
         p6.Value = dSentDate.Value;
         SqlParameter p7 = sqlComm.Parameters.Add("@cDecidedBy", SqlDbType.VarChar, 50);
         p7.Value = cDecidedBy.Value;
         SqlParameter p8 = sqlComm.Parameters.Add("@dDecidedDate", SqlDbType.DateTime);
         p8.Value = dDecidedDate.Value;
         SqlParameter p9 = sqlComm.Parameters.Add("@cRejectComment", SqlDbType.VarChar, 1000);
         p9.Value = cRejectComment.Value;
         SqlParameter p10 = sqlComm.Parameters.Add("@bIsActual", SqlDbType.Bit);
         p10.Value = bIsActual;
         SqlParameter p11 = sqlComm.Parameters.Add("@dLastModifiedByUser", SqlDbType.DateTime);
         p11.Value = dLastModifiedByUser.Value;
         SqlParameter p12 = sqlComm.Parameters.Add("@dLastValidationDate", SqlDbType.DateTime);
         p12.Value = dLastValidationDate.Value;
         TraceDbCommandEvent.Raise(sqlComm);
         try
         {
       sqlComm.ExecuteNonQuery();
       TraceCallReturnEvent.Raise();
         }
         catch (SqlException e)
         {
       TraceCallReturnEvent.Raise(false);
       SqlErrorHandler.Handle(e, uID.ToString());
         }
         finally
         {
       FinishSPCall();
         }
   }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:55,代码来源:BaseDataContext2.cs

示例10: ndihdOrganisationUpdate

   public void ndihdOrganisationUpdate(DBGuid uID,
 DBString cName,
 DBString cDepartment,
 DBString cPostCode,
 DBString cCity,
 DBString cAddress,
 DBString cRegionRef,
 DBString cCountry,
 DBString cMailingPostCode,
 DBString cMailingCity,
 DBString cMailingAddress,
 DBString cPhone1,
 DBString cPhone2,
 DBString cPhone3,
 DBString cPhoneDiscounted,
 DBString cFax,
 DBString cEmail1,
 DBString cEmail2,
 DBString cEmail3,
 DBString cHomePage,
 DBString cContactName,
 DBString cContactPhone,
 DBString cContactEmail,
 DBString cDescription,
 DBString cCallingHours,
 DBString cOrganisationFormRef,
 DBDouble nSourceGovernment,
 DBDouble nSourceCompetition,
 DBDouble nSourceSponsor,
 DBDouble nSourceDonation,
 DBDouble nSourceTax,
 DBDouble nSourceOther,
 DBString cSourceOtherName,
 DBString cEstablishmentYear,
 bool bActivityPrevention,
 bool bActivityResearch,
 bool bActivityRehabilitation,
 bool bActivityOther,
 DBString cWorkingAreaRef,
 DBString cWorkingAreaOther,
 DBInt nWorkersFix,
 DBInt nWorkersExternal,
 DBInt nWorkersVolunteer,
 bool bIsActive,
 DBInt nJobPsychologist,
 DBInt nJobPsychiater,
 DBInt nJobDoctor,
 DBInt nJobMedicalExpert,
 DBInt nJobHealthExpert,
 DBInt nJobSociologist,
 DBInt nJobSocialPolitician,
 DBInt nJobSocialWorker,
 DBInt nJobSocialPedagogist,
 DBInt nJobPedagogist,
 DBInt nJobManualist,
 DBInt nJobLawyer,
 DBInt nJobPoliceman,
 DBInt nJobMentalhygiene,
 DBInt nJobCultureOrganizer,
 DBInt nJobOther1,
 DBInt nJobOther2,
 DBInt nJobOther3,
 DBString cJobOtherName1,
 DBString cJobOtherName2,
 DBString cJobOtherName3,
 bool bIsKef,
 DBString cRegionSearchCodeRef,
 DBInt nDistrictSearchCodeRef,
 DBString cIntroduceText,
 DBString cDrogStrategyDescription,
 DBString cAreaDescription,
 DBString cEstablishmentMonth,
 DBString cAreaHomePage,
 DBDateTime dLastModified,
 DBDateTime dIntroduceTextLastModified,
 DBDateTime dAreaDescriptionLastModified,
 DBDateTime dDrogStrategyLastModified,
 DBDateTime dKefMembersLastModified,
 DBDateTime dKefDownloadsLastModified,
 DBDateTime dKefEventsLastModified,
 DBString cValidationState,
 DBDateTime dLastValidationDate,
 bool bIsActual)
   {
       TraceCallEnterEvent.Raise();
         SqlCommand sqlComm = PrepareSPCall("[dbo].[ndihdOrganisationUpdate]");
         SqlParameter p1 = sqlComm.Parameters.Add("@uID", SqlDbType.UniqueIdentifier);
         p1.Value = uID.Value;
         SqlParameter p2 = sqlComm.Parameters.Add("@cName", SqlDbType.VarChar, 250);
         p2.Value = cName.Value;
         SqlParameter p3 = sqlComm.Parameters.Add("@cDepartment", SqlDbType.VarChar, 250);
         p3.Value = cDepartment.Value;
         SqlParameter p4 = sqlComm.Parameters.Add("@cPostCode", SqlDbType.VarChar, 10);
         p4.Value = cPostCode.Value;
         SqlParameter p5 = sqlComm.Parameters.Add("@cCity", SqlDbType.VarChar, 100);
         p5.Value = cCity.Value;
         SqlParameter p6 = sqlComm.Parameters.Add("@cAddress", SqlDbType.VarChar, 100);
         p6.Value = cAddress.Value;
         SqlParameter p7 = sqlComm.Parameters.Add("@cRegionRef", SqlDbType.Char, 10);
         p7.Value = cRegionRef.Value;
//.........这里部分代码省略.........
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:101,代码来源:BaseDataContext2.cs

示例11: FillDatagrid

        /// <summary>
        /// Fill datagrid with data
        /// </summary>
        private void FillDatagrid(DBGuid ID)
        {
            try
              {
            string sSortColumn = "ForumThreadName";
            int nSelectedRow = -1;

            // Storing the previous sort order
            if (dtgMain.DataSource != null)
            {
              sSortColumn = ((DataTable) dtgMain.DataSource).DefaultView.Sort;
            }

            // Set filter
            ForumItem filter = new ForumItem(Guid.Empty);
            filter.FilterOnIsModerated = DBInt.Null;
            if (cmbStatus.SelectedIndex > 0)
            {
              bool bIsModerated = (cmbStatus.SelectedValue.ToString() == "1" ? true : false);
              filter.FilterOnIsModerated = (DBInt) Convert.ToInt32(bIsModerated);
              filter.IsModerated = bIsModerated;
            }
            if (cmbForumGroup.SelectedIndex > 0)
            {
              filter.ForumGroupRef = new DBGuid(new Guid(cmbForumGroup.SelectedValue.ToString()));
            }
            if (dtpSentFrom.Checked)
            {
              filter.FilterOnSentFrom = new DBDateTime(dtpSentFrom.Value);
            }
            if (dtpSentTo.Checked)
            {
              DBDateTime dateTo = new DBDateTime(dtpSentTo.Value);
              filter.FilterOnSentTo = dateTo.AddDays(1).AddMilliseconds(-1);
            }
            // Retrieving data from BusinessServices
            IForumItemService srv = ServiceFactory.GetForumItemService();
            ForumItemContainer allData = srv.ForumItemSelectFiltered(filter);
            DataTable dt = allData.AllAsDatatable;
            dt.DefaultView.Sort = sSortColumn;
            dtgMain.DataSource = dt;

            // Locates the row specified by ID param
            if (!ID.IsNull)
            {
              BindingManagerBase bm = dtgMain.BindingContext[dtgMain.DataSource, dtgMain.DataMember];
              DataRow dr;
              for (int i = 0; i < bm.Count; i++)
              {
            dr = ((DataRowView) bm.Current).Row;
            if (ID.Value.Equals(dr["ID"]))
            {
              nSelectedRow = i;
              break;
            }
            bm.Position += 1;
              }
            }

            // Makes the row selected
            if (nSelectedRow <= ((DataTable) dtgMain.DataSource).DefaultView.Count && nSelectedRow > -1)
            {
              dtgMain.Select(nSelectedRow);
              dtgMain.CurrentRowIndex = nSelectedRow;
            }
            else if (((DataTable) dtgMain.DataSource).DefaultView.Count != 0)
            {
              dtgMain.Select(0);
            }

            // Enabling or disabling the buttons according to record count.
            // And is because of previous disable state.
            bool bIsEmptyGrid = (((DataTable) dtgMain.DataSource).DefaultView.Count == 0);
            tbbInactivate.Enabled = ! bIsEmptyGrid;
            tbbModify.Enabled = ! bIsEmptyGrid;
              }
              catch (Exception ex)
              {
            //	---	Log exception
            ExceptionManager.Publish(ex);
            //	---	Display Exception
            ErrorHandler.DisplayError("Nem várt hiba lépett fel a lista frissítése során.", ex);
              }
        }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:87,代码来源:frmForumItemSelect.cs

示例12: Compare

 // --------------------------------------------------------------------------------
 /// <summary>
 /// Compares two instances of DateTime and returns an indication of their 
 /// relative values. 
 /// </summary>
 /// <param name="d1">First DBDateTime value.</param>
 /// <param name="d2">Second DBDateTime value.</param>
 /// <returns>
 /// A signed number indicating the relative values of <c>d1</c> and <c>d2</c>.
 /// <list type="table">
 ///   <listheader>
 ///     <term>Value</term>
 ///     <description>Meaning</description>
 ///   </listheader>
 ///   <item>
 ///     <term>Less than zero</term>
 ///     <description><c>d1</c> is less than <c>d2</c>.</description>
 ///   </item>
 ///   <item>
 ///     <term>Zero</term>
 ///     <description><c>d1</c> is equal to <c>d2</c>.</description>
 ///   </item>
 ///   <item>
 ///     <term>Greater than zero</term>
 ///     <description><c>d1</c> is greater than <c>d2</c>.</description>
 ///   </item>
 /// </list>
 /// </returns>
 /// <exception cref="InvalidOperationException">
 /// Either <c>d1</c> or <c>d2</c> is Null.
 /// </exception>
 // --------------------------------------------------------------------------------
 public static int Compare(DBDateTime d1, DBDateTime d2)
 {
     if (! (d1.m_Defined && d2.m_Defined))
       {
     throw new InvalidOperationException();
       }
       return DateTime.Compare (d1, d2);
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:40,代码来源:DBDateTime.cs

示例13: FillDatagrid

        /// <summary>
        /// Fill datagrid with data
        /// </summary>
        private void FillDatagrid(DBInt ID)
        {
            try
              {
            string sSortColumn = "TimeStamp DESC";
            int nSelectedRow = -1;

            // Storing the previous sort order
            if (dtgMain.DataSource != null)
            {
              sSortColumn = ((DataTable) dtgMain.DataSource).DefaultView.Sort;
            }

            // Set filter
            Event filter = new Event();
            if (cmbFunctions.SelectedIndex > 0)
            {
              filter.Method = cmbFunctions.SelectedValue.ToString();
            }
            if (txtLoginName.Text.Length > 0)
            {
              filter.PrincipalName = txtLoginName.Text;
            }
            if (dtpFrom.Checked)
            {
              filter.FilterOnTimeStampFrom = new DBDateTime(dtpFrom.Value.Date);
            }
            if (dtpTo.Checked)
            {
              DBDateTime dateTo = new DBDateTime(dtpTo.Value);
              filter.FilterOnTimeStampTo = dateTo.AddDays(1).AddMilliseconds(-1);
            }

            // Retrieving data from BusinessServices
            IEventService srv = ServiceFactory.GetEventService();
            EventContainer allData = srv.EventSelectFiltered(filter);
            DataTable dt = allData.AllAsDatatable;
            dt.DefaultView.Sort = sSortColumn;
            dtgMain.DataSource = dt;

            // Locates the row specified by ID param
            if (!ID.IsNull)
            {
              BindingManagerBase bm = dtgMain.BindingContext[dtgMain.DataSource, dtgMain.DataMember];
              DataRow dr;
              for (int i = 0; i < bm.Count; i++)
              {
            dr = ((DataRowView) bm.Current).Row;
            if (ID.Value.Equals(dr["ID"]))
            {
              nSelectedRow = i;
              break;
            }
            bm.Position += 1;
              }
            }

            // Makes the row selected
            if (nSelectedRow <= ((DataTable) dtgMain.DataSource).DefaultView.Count && nSelectedRow > -1)
            {
              dtgMain.Select(nSelectedRow);
              dtgMain.CurrentRowIndex = nSelectedRow;
            }
            else if (((DataTable) dtgMain.DataSource).DefaultView.Count != 0)
            {
              dtgMain.Select(0);
            }

            // Enabling or disabling the buttons according to record count.
            // And is because of previous disable state.
            bool bIsEmptyGrid = (((DataTable) dtgMain.DataSource).DefaultView.Count == 0);
            tbbModify.Enabled = ! bIsEmptyGrid;
              }
              catch (Exception ex)
              {
            //	---	Log exception
            ExceptionManager.Publish(ex);
            //	---	Display Exception
            ErrorHandler.DisplayError("Nem várt hiba lépett fel a lista frissítése során.", ex);
              }
        }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:84,代码来源:frmSystemLogSelect.cs

示例14: DesignerDrogBase

 // -------------------------------------------------------------------------------------
 /// <summary>
 /// XmlNode setup constructor
 /// </summary>
 /// <param name="node">XmlNode containing document data.</param>
 // -------------------------------------------------------------------------------------
 public DesignerDrogBase(XmlNode node)
 {
     m_ID = new DBGuid(node.Attributes["ID"]);
       m_Title = new DBString(node.SelectSingleNode("Title"));
       m_Author = new DBString(node.SelectSingleNode("Author"));
       m_Source = new DBString(node.SelectSingleNode("Source"));
       m_Abstract = new DBString(node.SelectSingleNode("Abstract"));
       m_PictureUrl = new DBString(node.SelectSingleNode("PictureUrl"));
       m_Body = new DBString(node.SelectSingleNode("Body"));
       m_CategoryRef = new DBGuid(node.SelectSingleNode("CategoryRef"));
       m_CreatedDate = new DBDateTime(node.SelectSingleNode("CreatedDate"));
       m_IsActive = Convert.ToBoolean(node.SelectSingleNode("IsActive").InnerText);
       m_IsActual = Convert.ToBoolean(node.SelectSingleNode("IsActual").InnerText);
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:20,代码来源:DesignerDrogBase.cs

示例15: JobFindBase

 // -------------------------------------------------------------------------------------
 /// <summary>
 /// XmlNode setup constructor
 /// </summary>
 /// <param name="node">XmlNode containing document data.</param>
 // -------------------------------------------------------------------------------------
 public JobFindBase(XmlNode node)
 {
     m_ID = new DBGuid(node.Attributes["ID"]);
       m_RefId = new DBInt(node.SelectSingleNode("RefId"));
       m_Description = new DBString(node.SelectSingleNode("Description"));
       m_City = new DBString(node.SelectSingleNode("City"));
       m_RegionRef = new DBString(node.SelectSingleNode("RegionRef"));
       m_Status = new DBString(node.SelectSingleNode("Status"));
       m_ActivityPrevention = Convert.ToBoolean(node.SelectSingleNode("ActivityPrevention").InnerText);
       m_ActivityResearch = Convert.ToBoolean(node.SelectSingleNode("ActivityResearch").InnerText);
       m_ActivityRehabilitation = Convert.ToBoolean(node.SelectSingleNode("ActivityRehabilitation").InnerText);
       m_ActivityOther = Convert.ToBoolean(node.SelectSingleNode("ActivityOther").InnerText);
       m_Sender = new DBString(node.SelectSingleNode("Sender"));
       m_NotificationSend = Convert.ToBoolean(node.SelectSingleNode("NotificationSend").InnerText);
       m_NotificationDate = new DBDateTime(node.SelectSingleNode("NotificationDate"));
       m_Expiredate = new DBDateTime(node.SelectSingleNode("Expiredate"));
       m_LastModified = new DBDateTime(node.SelectSingleNode("LastModified"));
       m_Created = new DBDateTime(node.SelectSingleNode("Created"));
 }
开发者ID:bmadarasz,项目名称:ndihelpdesk,代码行数:25,代码来源:JobFindBase.cs


注:本文中的Framework.Runtime.DBTypes.DBDateTime类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。