Beispiel #1
0
        public static List <Model.mdlMobileConfig> LoadMobileConfig(Model.mdlParam json)
        {
            var lmdlMobileConfigList = new List <Model.mdlMobileConfig>();

            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter()
                {
                    ParameterName = "@BranchID", SqlDbType = SqlDbType.NVarChar, Value = json.BranchID
                }
            };

            DataTable dtMobileConfig = Manager.DataFacade.DTSQLCommand(@"SELECT [BranchId]
                                                                                    ,[ID]
                                                                                    ,[Desc]
                                                                                    ,[Value] FROM MobileConfig WHERE BranchID = @BranchID", sp); //003

            foreach (DataRow drMobileConfig in dtMobileConfig.Rows)
            {
                var lmdlMobileConfig = new Model.mdlMobileConfig();
                lmdlMobileConfig.BranchId = drMobileConfig["BranchId"].ToString();
                lmdlMobileConfig.ID       = drMobileConfig["ID"].ToString();
                lmdlMobileConfig.Desc     = drMobileConfig["Desc"].ToString();
                lmdlMobileConfig.Value    = drMobileConfig["Value"].ToString();
                lmdlMobileConfigList.Add(lmdlMobileConfig);
            }
            return(lmdlMobileConfigList);
        }
Beispiel #2
0
        public static Model.mdlMobileConfig GetMobileConfigIdleCounter(string branchID)
        {
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter()
                {
                    ParameterName = "@BranchID", SqlDbType = SqlDbType.NVarChar, Value = branchID
                }
            };

            DataTable dtMobileConfig   = Manager.DataFacade.DTSQLCommand(@"SELECT [BranchId]
                                                                                    ,[ID]
                                                                                    ,[Desc]
                                                                                    ,[Value] FROM MobileConfig WHERE BranchID = @BranchID AND ID = 'TIMERTRACKING'", sp); //003
            var       lmdlMobileConfig = new Model.mdlMobileConfig();

            foreach (DataRow drMobileConfig in dtMobileConfig.Rows)
            {
                lmdlMobileConfig.BranchId = drMobileConfig["BranchId"].ToString();
                lmdlMobileConfig.ID       = drMobileConfig["ID"].ToString();
                lmdlMobileConfig.Desc     = drMobileConfig["Desc"].ToString();
                lmdlMobileConfig.Value    = drMobileConfig["Value"].ToString();
            }
            return(lmdlMobileConfig);
        }
Beispiel #3
0
        public static string  InsertMobileConfigbyID(Model.mdlMobileConfig lParam)
        {
            string lResult = string.Empty;
            var    lmdlMobileconfigBranch = GetMobileConfigbyBranchID();

            foreach (var lParamBranch in lmdlMobileconfigBranch)
            {
                bool lCheck = CheckMobileConfigExist(lParam.ID, lParamBranch.BranchId);

                if (lCheck == true)
                {
                    string lResult2 = string.Format("ID : {0} Already Exist", lParam.ID);
                    return(lResult2);
                }

                List <SqlParameter> sp = new List <SqlParameter>()
                {
                    new SqlParameter()
                    {
                        ParameterName = "@BranchId", SqlDbType = SqlDbType.NVarChar, Value = lParamBranch.BranchId
                    },
                    new SqlParameter()
                    {
                        ParameterName = "@ID", SqlDbType = SqlDbType.NVarChar, Value = lParam.ID
                    },
                    new SqlParameter()
                    {
                        ParameterName = "@Desc", SqlDbType = SqlDbType.NVarChar, Value = lParam.Desc
                    },
                    new SqlParameter()
                    {
                        ParameterName = "@Value", SqlDbType = SqlDbType.NVarChar, Value = lParam.Value
                    },
                    new SqlParameter()
                    {
                        ParameterName = "@TypeValue", SqlDbType = SqlDbType.NVarChar, Value = lParam.TypeValue
                    }
                };

                string query = @"INSERT INTO MobileConfig (BranchId, ID, [Desc], Value, TypeValue) VALUES (@BranchId, @ID, @Desc, @Value, @TypeValue)";
                lResult = Manager.DataFacade.DTSQLVoidCommand(query, sp);
            }
            return(lResult);
        }
Beispiel #4
0
        public static List <Model.mdlMobileConfig> GetTypeValue()
        {
            var mdlMobileConfigList = new List <Model.mdlMobileConfig>();

            List <SqlParameter> sp = new List <SqlParameter>()
            {
            };

            DataTable dtMobileConfig = Manager.DataFacade.DTSQLCommand(@"SELECT DISTINCT TypeValue FROM MobileConfig", sp); //006

            foreach (DataRow row in dtMobileConfig.Rows)
            {
                var mdlMobileConfig = new Model.mdlMobileConfig();
                mdlMobileConfig.TypeValue = row["TypeValue"].ToString();
                mdlMobileConfigList.Add(mdlMobileConfig);
            }

            return(mdlMobileConfigList);
        }
Beispiel #5
0
        public static List <Model.mdlMobileConfig> GetMobileConfigbyBranchID()
        {
            var mdlMobileConfigList = new List <Model.mdlMobileConfig>();

            List <SqlParameter> sp = new List <SqlParameter>()
            {
            };

            DataTable dtMobileConfig = Manager.DataFacade.DTSQLCommand(@"SELECT Distinct BranchId FROM MobileConfig", sp); //006

            foreach (DataRow row in dtMobileConfig.Rows)
            {
                var mdlMobileConfig = new Model.mdlMobileConfig();
                mdlMobileConfig.BranchId = row["BranchId"].ToString();
                mdlMobileConfigList.Add(mdlMobileConfig);
            }

            return(mdlMobileConfigList);
        }
Beispiel #6
0
        public static List <Model.mdlMobileConfig> GetSearch(string keyword)
        {
            var lMobileConfig = DataContext.MobileConfigs.Where(fld => fld.BranchId.Equals(keyword)).OrderBy(fld => fld.BranchId).ToList();

            var mdlMobileConfigList = new List <Model.mdlMobileConfig>();

            foreach (var mobileconfig in lMobileConfig)
            {
                var mdlMobileConfig = new Model.mdlMobileConfig();
                mdlMobileConfig.BranchId  = mobileconfig.BranchId;
                mdlMobileConfig.ID        = mobileconfig.ID;
                mdlMobileConfig.Desc      = mobileconfig.Desc;
                mdlMobileConfig.Value     = mobileconfig.Value;
                mdlMobileConfig.TypeValue = mobileconfig.TypeValue;

                mdlMobileConfigList.Add(mdlMobileConfig);
            }

            return(mdlMobileConfigList);
        }
Beispiel #7
0
        public static Model.mdlMobileConfig GetMobileConfig(string branchID)
        {
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter()
                {
                    ParameterName = "@branchID", SqlDbType = SqlDbType.NVarChar, Value = '%' + branchID + '%'
                },
            };

            DataTable dtMobileConfig = Manager.DataFacade.DTSQLCommand("SELECT ID,Value FROM Warehouse where BranchId LIKE @branchID AND ID = 'RADIUS'", sp);

            var mdlMobileConfig = new Model.mdlMobileConfig();

            foreach (DataRow row in dtMobileConfig.Rows)
            {
                mdlMobileConfig.ID    = row["ID"].ToString();
                mdlMobileConfig.Value = row["Value"].ToString();
            }

            return(mdlMobileConfig);
        }