public static ParamMapping FindMapping(string Vendor, string FuncType, string ParamName, string CodeId)
        {
            ParamMapping result = null;
            string       key    = Vendor + FuncType + ParamName + CodeId;

            MappingList.TryGetValue(key, out result);

            return(result);
        }
        public static void Initialize()
        {
            try
            {
                MappingList = new Dictionary <string, ParamMapping>();
                DBUtil dBUtil = new DBUtil();

                DataTable dtCommand = new DataTable();

                string strSql = "SELECT  func_type,param_name, code_id, code_desc, vendor, mapping_code FROM param_mapping";



                dtCommand = dBUtil.GetDataTable(strSql, null);

                if (dtCommand.Rows.Count > 0)
                {
                    foreach (DataRow row in dtCommand.Rows)
                    {
                        ParamMapping each = new ParamMapping();
                        each.CodeDesc    = row["code_desc"].ToString();
                        each.CodeId      = row["code_id"].ToString();
                        each.FuncType    = row["func_type"].ToString();
                        each.ParamName   = row["param_name"].ToString();
                        each.MappingCode = row["mapping_code"].ToString();
                        each.Vendor      = row["vendor"].ToString();
                        string key = each.Vendor + each.FuncType + each.ParamName + each.CodeId;
                        MappingList.Add(key, each);
                    }
                }
                else
                {
                    throw new Exception("TransferControl.Management.CmdParamManagement\r\nException: Parameter List not exists.");
                }
            }
            catch (Exception ex)
            {
                //throw new Exception(ex.StackTrace);
                logger.Error(ex.StackTrace);
            }
        }
Пример #3
0
 public bool CanMapTo(ParamMapping mapping)
 {
     return(this.ParamType == (int)mapping);
 }