Example #1
0
        /// <summary>
        /// 得到字段类型字符串
        /// </summary>
        /// <param name="typeNum"></param>
        /// <returns></returns>
        private string GetColumnType(string typeNum)
        {
            string type = typeNum;

            if (File.Exists(datatypefile))
            {
                dtfile = new LTP.Utility.INIFile(datatypefile);
                type   = dtfile.IniReadValue("AccessDbTypeMap", typeNum);
            }
            //switch (typeNum)
            //{
            //    case "3":
            //        type = "int";
            //        break;
            //    case "5":
            //        type = "float";
            //        break;
            //    case "6":
            //        type = "money";
            //        break;
            //    case "7":
            //        type = "datetime";
            //        break;
            //    case "11":
            //        type = "bool";
            //        break;
            //    case "130":
            //        type = "varchar";
            //        break;
            //}
            return(type);
        }
Example #2
0
        public UcSysManage()
        {
            InitializeComponent();

            if (File.Exists(cmcfgfile))
            {
                cfgfile = new LTP.Utility.INIFile(cmcfgfile);
                string val = cfgfile.IniReadValue("dbo", "dbosp");
                if (val.Trim() == "1")
                {
                    radbtnDBO_SP.Checked = true;
                }
                else
                {
                    radbtnDBO_SQL.Checked = true;
                }
                string val2 = cfgfile.IniReadValue("loginfo", "save");
                if (val2.Trim() == "1")
                {
                    chkLoginfo.Checked = true;
                }
                else
                {
                    chkLoginfo.Checked = false;
                }
            }
        }
Example #3
0
 private void NewProject_Load(object sender, EventArgs e)
 {
     if (File.Exists(cmcfgfile))
     {
         cfgfile = new LTP.Utility.INIFile(cmcfgfile);
         string lastpath = cfgfile.IniReadValue("Project", "lastpath");
         if (lastpath.Trim() != "")
         {
             txtProPath.Text = lastpath;
         }
     }
 }
Example #4
0
 /// <summary>
 /// 是否采用sp的方式获取数据结构信息
 /// </summary>
 /// <returns></returns>
 private bool IsDboSp()
 {
     if (File.Exists(cmcfgfile))
     {
         cfgfile = new LTP.Utility.INIFile(cmcfgfile);
         string val = cfgfile.IniReadValue("dbo", "dbosp");
         if (val.Trim() == "1")
         {
             isdbosp = true;
         }
     }
     return(isdbosp);
 }
Example #5
0
 /// <summary>
 /// 写日志
 /// </summary>
 /// <param name="loginfo"></param>
 public static void WriteLog(string loginfo)
 {
     if (File.Exists(cmcfgfile))
     {
         LTP.Utility.INIFile cfgfile = new LTP.Utility.INIFile(cmcfgfile);
         string val = cfgfile.IniReadValue("loginfo", "save");
         if (val.Trim() == "1")
         {
             StreamWriter sw = new StreamWriter(logfilename, true);
             sw.WriteLine(DateTime.Now.ToString() + ":" + loginfo);
             sw.Close();
         }
     }
 }
Example #6
0
 /// <summary>
 /// 写日志
 /// </summary>
 /// <param name="loginfo"></param>
 public static void WriteLog(System.Exception ex)
 {
     if (File.Exists(cmcfgfile))
     {
         LTP.Utility.INIFile cfgfile = new LTP.Utility.INIFile(cmcfgfile);
         string val = cfgfile.IniReadValue("loginfo", "save");
         if (val.Trim() == "1")
         {
             StreamWriter sw = new StreamWriter(logfilename, true);
             sw.WriteLine(DateTime.Now.ToString() + ":");
             sw.WriteLine("错误信息:" + ex.Message);
             sw.WriteLine("Stack Trace:" + ex.StackTrace);
             sw.WriteLine("");
             sw.Close();
         }
     }
 }
Example #7
0
 /// <summary>
 /// 是否已经下载过RSS数据
 /// </summary>
 /// <returns></returns>
 private bool IsHasLoaded()
 {
     if (File.Exists(cmcfgfile))
     {
         cfgfile = new LTP.Utility.INIFile(cmcfgfile);
         string Contents = cfgfile.IniReadValue("updaterss", "today");
         if (Contents == DateTime.Today.ToString("yyyyMMdd"))
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
Example #8
0
 public void SaveDBO()
 {
     cfgfile = new LTP.Utility.INIFile(cmcfgfile);
     if (radbtnDBO_SP.Checked)
     {
         cfgfile.IniWriteValue("dbo", "dbosp", "1");
     }
     else
     {
         cfgfile.IniWriteValue("dbo", "dbosp", "0");
     }
     if (chkLoginfo.Checked)
     {
         cfgfile.IniWriteValue("loginfo", "save", "1");
     }
     else
     {
         cfgfile.IniWriteValue("loginfo", "save", "0");
     }
 }
Example #9
0
        public UcDatatypeMap()
        {
            InitializeComponent();

            datatype = new LTP.Utility.INIFile(datatypefile);
        }