Пример #1
0
 public DataSet GetVaultTransactionEvents(int Vault_Id, string Type, int No_Of_Records, string SearchKey, DateTime StartDate, DateTime EndDate)
 {
     return(objVaultBiz.GetVaultTransactionEvents(Vault_Id, Type, No_Of_Records, SearchKey, StartDate, EndDate));
 }
        void refreshEvents(int iRecordCount)
        {
            try
            {
                if (StartDate > EndDate)
                {
                    MessageBox.ShowBox("Vault_MessageID26", BMC_Icon.Information);
                    return;
                }

                if (StartDate > System.DateTime.Now)
                {
                    MessageBox.ShowBox("Vault_MessageID27", BMC_Icon.Information);
                    return;
                }

                if (EndDate > System.DateTime.Now)
                {
                    MessageBox.ShowBox("Vault_MessageID28", BMC_Icon.Information);
                    return;
                }
                LogManager.WriteLog("CVaultEvents:refreshEvents", LogManager.enumLogLevel.Debug);

                if (dtpStartDate.SelectedDate != null && dtpEndDate.SelectedDate != null)
                {
                    StartDate = new DateTime(((DateTime)dtpStartDate.SelectedDate).Year,
                                             ((DateTime)dtpStartDate.SelectedDate).Month,
                                             ((DateTime)dtpStartDate.SelectedDate).Day,
                                             dtpStartTime.SelectedHour, dtpStartTime.SelectedMinute,
                                             dtpStartTime.SelectedSecond);

                    EndDate = new DateTime(((DateTime)dtpEndDate.SelectedDate).Year,
                                           ((DateTime)dtpEndDate.SelectedDate).Month,
                                           ((DateTime)dtpEndDate.SelectedDate).Day,
                                           dtpEndtime.SelectedHour, dtpEndtime.SelectedMinute,
                                           dtpEndtime.SelectedSecond);


                    DataSet dtHistory = objVaultBiz.GetVaultTransactionEvents(0, cmb_Type.SelectedValue.ToString(), iRecordCount, txt_description.Text, StartDate, EndDate);
                    if (dtHistory.Tables[0].Rows.Count > 0)
                    {
                        this.DataContext       = dtHistory.Tables[0].DefaultView;
                        lst_Events.ItemsSource = dtHistory.Tables[0].DefaultView;
                    }
                    else
                    {
                        this.DataContext       = null;
                        lst_Events.ItemsSource = null;
                        MessageBox.ShowBox("MessageID37", BMC_Icon.Information);
                        LogManager.WriteLog("CVaultEvents:No records found", LogManager.enumLogLevel.Debug);
                    }


                    LogManager.WriteLog("CVaultEvents:Complete", LogManager.enumLogLevel.Debug);
                }
            }
            catch (Exception Ex)
            {
                ExceptionManager.Publish(Ex);
            }
        }