// ''' <summary>
            // ''' Returns data to build a data grid
            // ''' </summary>
            // ''' <param name="params"></param>
            // ''' <returns></returns>
            // ''' <remarks></remarks>
            //Public Function GetData(ByVal params As Dictionary(Of String, String)) As JQueryDataTable
            //    Dim gridData As New JQueryDataTable
            //    Dim offset As Integer = params("start")
            //    Dim pageSize As Integer = params("length")
            //    Dim columnNames As String() = params("columnnames").Split(",")
            //    Dim columnIndex = CType(params("order[0].column"), Integer)
            //    Dim sortColumn As String = columnNames(columnIndex)
            //    Dim sortOrder As String = params("order[0].dir")
            //    Dim searchText As String = params("searchtext")
            //    Dim searchType As String = params("searchtype")
            //    Dim searchData As New DataSet
            //    Dim totalRecords As Integer
            //    Dim sortingOrder As Boolean
            //    sortingOrder = IIf(sortOrder.ToLower = "asc", False, True)
            //    Select Case searchType
            //        Case Is = "TEXTSEARCH"
            //            Dim dbTextSearch As New DBTextSearch(settings)
            //            searchData = dbTextSearch.TextSearch(searchText, offset, pageSize, sortColumn, IIf(sortOrder.ToLower = "asc", False, True))
            //        Case Is = "PAYMENTTYPESEARCH"
            //            Dim dbPaymentTypeSearch As New DBPaymentTypeSearch(settings)
            //            searchData = dbPaymentTypeSearch.PaymentTypeSearch(searchText, offset, pageSize, sortColumn, IIf(sortOrder.ToLower = "asc", False, True))
            //    End Select
            //    totalRecords = CType(searchData.Tables(0).Rows(0)(0), Integer)
            //    gridData.draw = params("draw")
            //    gridData.recordsTotal = totalRecords
            //    gridData.recordsFiltered = totalRecords
            //    gridData.data = ConvertDataTableToList(searchData.Tables(1))
            //    Return gridData
            //End Function
            /// <summary>
            /// Returns data to build a data grid
            /// </summary>
            /// <param name="params"></param>
            /// <param name="searchType"></param>
            /// <param name="offset"></param>
            /// <param name="pageSize"></param>
            /// <param name="sortColumn"></param>
            /// <param name="sortOrder"></param>
            /// <param name="searchText"></param>
            /// <returns></returns>
            /// <remarks></remarks>
            public JQueryDataTable GetData(Dictionary <string, string> @params, int draw, string searchType, int offset, int pageSize, string sortColumn, string sortOrder, string searchText)
            {
                JQueryDataTable gridData     = new JQueryDataTable();
                DataSet         searchData   = new DataSet();
                int             totalRecords = 0;
                bool            sortingOrder;

                sortingOrder = sortOrder.ToLower() == "asc" ? false : true;
                switch (searchType)
                {
                case "TEXTSEARCH":
                    TalentSystemDefaults.DESettings temp_settings = settings;
                    Database_Text_Search            dbTextSearch  = new Database_Text_Search(ref temp_settings);
                    settings   = temp_settings;
                    searchData = dbTextSearch.TextSearch(searchText, offset, pageSize, sortColumn, sortOrder.ToLower() == "asc" ? false : true);
                    break;

                case "PAYMENTTYPESEARCH":
                    TalentSystemDefaults.DESettings temp_settings2      = settings;
                    Database_PaymentType_Search     dbPaymentTypeSearch = new Database_PaymentType_Search(ref temp_settings2);
                    settings   = temp_settings2;
                    searchData = dbPaymentTypeSearch.PaymentTypeSearch(searchText, offset, pageSize, sortColumn, sortOrder.ToLower() == "asc" ? false : true);
                    break;
                }
                totalRecords             = System.Convert.ToInt32(searchData.Tables[0].Rows[0][0]);
                gridData.draw            = draw;
                gridData.recordsTotal    = totalRecords;
                gridData.recordsFiltered = totalRecords;
                gridData.data            = ConvertDataTableToList(searchData.Tables[1]);
                return(gridData);
            }
示例#2
0
        /// <summary>
        /// Get next available transaction group id
        /// </summary>
        /// <param name="settings"></param>
        /// <returns></returns>
        /// <remarks></remarks>
        public static int GetGroupID(DESettings settings)
        {
            TalentSystemDefaults.DataAccess.DataObjects.tbl_ecommerce_module_defaults_bu tblEcommerceDefaults = new TalentSystemDefaults.DataAccess.DataObjects.tbl_ecommerce_module_defaults_bu(ref settings);
            int retVal = 0;

            retVal = tblEcommerceDefaults.GetGroupID();
            return(retVal);
        }
示例#3
0
        public static bool InsertErrorLog(DESettings settings, string sourceClass, string sourceMethod, string logCode, string logFilter1, string logFilter2, string logFilter3, string logFilter4, string logFilter5, string logContent)
        {
            bool     retVal  = false;
            tbl_logs tblLogs = new tbl_logs(settings);

            retVal = tblLogs.InsertLog(sourceClass, sourceMethod, logCode, logFilter1, logFilter2, logFilter3, logFilter4, logFilter5, logContent);
            return(retVal);
        }
示例#4
0
 public DLBase(DESettings settings, Dictionary <string, string> filters = null)
 {
     this.settings = settings;
     DEList        = new DEList();
     Initialise();
     DEList.AddURL    = GetAddURL();
     DEList.UpdateURL = GetUpdateURL();
     DEList.DeleteURL = GetDeleteURL();
 }
示例#5
0
        public static DLBase GetDLObject(string talentListName, DESettings settings, Dictionary <string, string> filters = null)
        {
            string className = Utilities.GetClassName(GlobalConstants.NS_TALENTLISTS, talentListName);

            object[] parameters = new object[] { settings, filters };
            DLBase   obj        = ReflectionUtils.CreateInstance(className, parameters);

            return(obj);
        }
示例#6
0
        public static DBObjectBase GetModuleObject(string moduleObjectName, DESettings settings)
        {
            string className = Utilities.GetClassName(GlobalConstants.NS_DATAACCESS_MODULEOBJECTS, moduleObjectName);

            object[]     parameters = new object[] { settings };
            DBObjectBase obj        = ReflectionUtils.CreateInstance(className, parameters);

            return(obj);
        }
示例#7
0
        public static string[] GetDisplayTabs(DESettings settings)
        {
            tbl_page_text_lang textLang = new tbl_page_text_lang(ref settings);
            var   pageTexts             = textLang.GetTextsForPage(settings.DefaultBusinessUnit, "SystemDefaults.aspx");
            var   displayTabs           = new DisplayTabs(pageTexts);
            Array results = (Array)(displayTabs.Classes.Select(item => item.Key).ToArray());

            return((string[])results);
        }
示例#8
0
        public static DMBase GetDMObject(DESettings settings, bool initialiseData = true)
        {
            string talentModuleName = settings.Module_Name;
            string className        = Utilities.GetClassName(GlobalConstants.NS_TALENTMODULES, talentModuleName);

            object[] parameters = new object[] { settings, initialiseData };
            DMBase   obj        = ReflectionUtils.CreateInstance(className, parameters);

            return(obj);
        }
示例#9
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings"></param>
 /// <remarks></remarks>
 public DBObjectBase(DESettings settings)
 {
     this.settings = settings;
     if (settings.VariableKey1 != string.Empty)
     {
         variableKey1Value = settings.VariableKey1;
     }
     if (settings.Company != string.Empty)
     {
         companyCode = settings.Company;
     }
 }
示例#10
0
        public static string[] GetBusinessUnits(DESettings settings)
        {
            System.Collections.Generic.List <string> buList = new System.Collections.Generic.List <string>();
            string application = "EBusiness";

            DataAccess.DataObjects.SystemObjects.tbl_url_bu objUrlBU = new DataAccess.DataObjects.SystemObjects.tbl_url_bu(ref settings);
            DataTable dataTable = objUrlBU.RetrieveBusinessUnit(application);

            foreach (DataRow row in dataTable.Rows)
            {
                buList.Add(row["BUSINESS_UNIT"].ToString());
            }
            return(buList.ToArray());
        }
示例#11
0
        public static ConfigurationEntity[] GetDMConfigurations(DESettings settings, string talentModuleName)
        {
            string   className = Utilities.GetClassName(GlobalConstants.NS_TALENTMODULES, talentModuleName);
            TypeInfo type      = (TypeInfo)(ReflectionUtils.GetTypeInfo(className));

            System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>();
            foreach (FieldInfo field in type.GetFields((System.Reflection.BindingFlags)(BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy)))
            {
                list.Add(System.Convert.ToString(field.GetValue(null)));
            }
            tbl_config_detail configDetail = new tbl_config_detail(settings);

            return(configDetail.RetrieveConfigurationEntities(list));
        }
示例#12
0
            /// <summary>
            /// Updates data modified inside a data grid
            /// </summary>
            /// <param name="params"></param>
            /// <param name="searchType"></param>
            /// <param name="jsonData"></param>
            /// <returns></returns>
            /// <remarks></remarks>
            public bool Save(Dictionary <string, string> @params, string searchType, string jsonData)
            {
                bool retVal = true;
                JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
                object objEntity = new object();
                Database_Text_Search    dbTextSearch        = default(Database_Text_Search);
                List <TextSearchEntity> lstTextSearchEntity = new List <TextSearchEntity>();
                TextSearchEntity        objTextSearchEntity = default(TextSearchEntity);
                var typeTextSearchUpdatedData         = (new List <TextSearchUpdateData>()).GetType();
                List <SearchDataConfigs>    lstTables = null;
                Dictionary <string, string> tableList = new Dictionary <string, string>();

                switch (searchType)
                {
                case "TEXTSEARCH":
                    objEntity = jsSerializer.Deserialize(jsonData, typeTextSearchUpdatedData);
                    try
                    {
                        TalentSystemDefaults.DESettings temp_settings = settings;
                        dbTextSearch = new Database_Text_Search(ref temp_settings);
                        settings     = temp_settings;
                        lstTables    = DataConfigs.FindAll(x => x.ConfigType == System.Convert.ToInt32(ConfigurationTypes.Table) & x.SearchType == TEXTSEARCH);
                        foreach (var tableConfig in lstTables)
                        {
                            tableList.Add(tableConfig.TableName, tableConfig.ConfigIndex.ToString());
                        }
                        // convert into an entity object
                        foreach (TextSearchUpdateData UpdatedRow in ((List <TextSearchUpdateData>)objEntity))
                        {
                            objTextSearchEntity              = new TextSearchEntity();
                            objTextSearchEntity.ID           = int.Parse(UpdatedRow.id);
                            objTextSearchEntity.TableName    = UpdatedRow.dbTable;
                            objTextSearchEntity.Text_Code    = UpdatedRow.text_code;
                            objTextSearchEntity.Text_Content = UpdatedRow.text_content;
                            lstTextSearchEntity.Add(objTextSearchEntity);
                        }
                        retVal = dbTextSearch.SaveTextSearchData(lstTextSearchEntity, tableList);
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                    break;

                case "PAYMENTTYPESEARCH":
                    break;
                }
                return(retVal);
            }
示例#13
0
 public Database_PaymentType_Search(ref DESettings settings)
     : base(settings)
 {
 }
示例#14
0
 public Database_Text_Search(ref DESettings settings)
     : base(settings)
 {
 }
示例#15
0
        public int Execute(DESettings settings)
        {
            int affectedRows = 0;

            System.Collections.Generic.List <TalentDB2Access> removeList = new System.Collections.Generic.List <TalentDB2Access>();
            foreach (TalentDB2Access db2Access in this)
            {
                bool hasQuote = false;
                foreach (DEDB2Parameter param in db2Access.CommandElements.CommandParameter)
                {
                    if (param.ParamValue != null && System.Convert.ToString(param.ParamValue).Contains("'"))
                    {
                        hasQuote = true;
                        break;
                    }
                }
                if (hasQuote)
                {
                    ErrorObj err = default(ErrorObj);
                    affectedRows += System.Convert.ToInt32(Execute(db2Access, ref err));
                    if (err.HasError)
                    {
                        throw new Exception(err.ErrorMessage);
                    }
                    removeList.Add(db2Access);
                }
            }
            foreach (TalentDB2Access item in removeList)
            {
                this.Remove(item);
            }
            if (Count > 0)
            {
                if (Count == 1)
                {
                    ErrorObj err = default(ErrorObj);
                    affectedRows += Execute(this[0], ref err);
                    if (err.HasError)
                    {
                        throw new Exception(err.ErrorMessage);
                    }
                }
                else
                {
                    ErrorObj err = default(ErrorObj);
                    settings.FunctionName = "UpdateDB2Data";
                    string        xmlString     = GetXML();
                    DEDB2Defaults deDB2Defaults = new DEDB2Defaults();
                    deDB2Defaults.XMLString = xmlString;
                    TalentDB2Access talentDB2AccessDetail = new TalentDB2Access();
                    DataTable       outputDataTable       = default(DataTable);
                    try
                    {
                        talentDB2AccessDetail.Settings = settings;
                        //Execute
                        err = talentDB2AccessDetail.DB2DefaultsAccess(DestinationDatabase.TALENTTKT, deDB2Defaults);
                        if ((!(err.HasError)) && (!(talentDB2AccessDetail.ResultDataSet == null)))
                        {
                            outputDataTable = talentDB2AccessDetail.ResultDataSet.Tables[1];
                            affectedRows    = System.Convert.ToInt32(outputDataTable.Rows[0]["AffectedRows"]);
                        }
                    }
                    catch (Exception)
                    {
                        throw;
                    }
                    finally
                    {
                        talentDB2AccessDetail = null;
                    }
                }
            }
            Clear();
            return(affectedRows);
        }
示例#16
0
        /// <summary>
        /// XML Comment
        /// </summary>
        /// <param name="objtalentSqlAccessDetail"></param>
        /// <param name="settings"></param>
        /// <remarks></remarks>
        public static void SerializeTransaction(TalentDataAccess objtalentSqlAccessDetail, DESettings settings)
        {
            DataAccess.ConfigObjects.tbl_config_detail_audit objAudit = new DataAccess.ConfigObjects.tbl_config_detail_audit(ref settings);
            MemoryStream    ms = new MemoryStream();
            BinaryFormatter bf = new BinaryFormatter();

            // serialize the object
            bf.Serialize(ms, objtalentSqlAccessDetail);
            if (settings.GroupID == "")
            {
                settings.GroupID = GetGroupID(settings).ToString();
            }
            // add it to DB
            objAudit.Insert(ms, settings.GroupID, settings.Module_Name, settings.AgentName, objtalentSqlAccessDetail.TableName, objtalentSqlAccessDetail.Action, objtalentSqlAccessDetail.DataSource, objtalentSqlAccessDetail.Catalog, settings.BusinessUnit);
        }