public override void SetCurrentDal() { CurrentDal = DalFactory.GetSystem_VoteDetailsDal(); }
public void Update() { IDalKlant DAL = DalFactory.CreateKlantDal(); DAL.Update(this.ToDTO()); }
public static void MyClassInitialize(TestContext testContext) { employeeIdList = null; log4net.Config.XmlConfigurator.Configure(); log4net.ILog logger = log4net.LogManager.GetLogger("DBTool MYSQL Test"); logger.Debug("Start Test"); string connectionString = @"Database=DBToolSampleDB;Data Source=localhost;User Id=devuser;Password=1qazxsw2"; IDalFactory dalFactory = new DalFactory(connectionString); NFramework.DBTool.Test.IDal.DalManager.Load(dalFactory); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetcommentDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getcust_linkmanDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getstatistic_detailDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetworkplanDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetCourseRoomDal(); }
public void Update() { IDalProduct DAL = DalFactory.CreateProductDal(); DAL.Update(this.ToDTO()); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetAssetManagementDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetEva_QuestionAnswerDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetTMP_RewardRankDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetEva_RegularDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetTPM_AcheiveRewardInfoDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetEva_CourseType_TableDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getfollow_upDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getcust_customerDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getparam_ruleDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetSys_UserInfoDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetpraiseDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetaudioDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getpub_paramDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getcrm_Test_logDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getremind_settingDal(); }
public UserBll(DalFactory dalFactory, IMapper mapper) { _dalFactory = dalFactory; _mapper = mapper; }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getreport_senderDal(); }
//生成 private void btnCreate_Click(object sender, EventArgs e) { new Thread(new ThreadStart(delegate() { try { IDal dal = DalFactory.CreateDal(ConfigurationManager.AppSettings["DBType"]); List <Dictionary <string, string> > tableList = dal.GetAllTables(); string strNamespace = ConfigurationManager.AppSettings["Namespace"]; string strClassTemplate = string.Empty; string strClassExtTemplate = string.Empty; string strFieldTemplate = string.Empty; Regex regField = new Regex(@"[ \t]*#field start([\s\S]*)#field end", RegexOptions.IgnoreCase); #region 操作控件 InvokeDelegate invokeDelegate = delegate() { btnCreate.Enabled = false; progressBar1.Visible = true; progressBar1.Minimum = 0; progressBar1.Maximum = tableList.Count; progressBar1.Value = 0; }; InvokeUtil.Invoke(this, invokeDelegate); #endregion #region 读取模板 strClassTemplate = FileHelper.ReadFile(Application.StartupPath + "\\Template\\class.txt"); strClassExtTemplate = FileHelper.ReadFile(Application.StartupPath + "\\Template\\class_ext.txt"); Match matchField = regField.Match(strClassTemplate); if (matchField.Success) { strFieldTemplate = matchField.Groups[1].Value.TrimEnd(' '); } #endregion int i = 0; foreach (Dictionary <string, string> table in tableList) //遍历表 { string tableName = table["table_name"].ToUpper().Trim(); StringBuilder sbFields = new StringBuilder(); List <Dictionary <string, string> > columnList = dal.GetAllColumns(tableName); #region 原始Model string tableComments = table["comments"] ?? string.Empty; string strClass = strClassTemplate.Replace("#table_comments", tableComments.Replace("\r\n", "\r\n /// ").Replace("\n", "\r\n /// ")); strClass = strClass.Replace("#table_name", tableName); foreach (Dictionary <string, string> column in columnList) //遍历字段 { string data_type = dal.ConvertDataType(column); string columnComments = column["comments"] ?? string.Empty; string strField = strFieldTemplate.Replace("#field_comments", columnComments.Replace("\r\n", "\r\n /// ").Replace("\n", "\r\n /// ")); if (column["constraint_type"] != "P") { strField = strField.Replace(" [IsId]\r\n", string.Empty); } strField = strField.Replace("#data_type", data_type); strField = strField.Replace("#field_name", column["columns_name"].ToUpper()); sbFields.Append(strField); } strClass = regField.Replace(strClass, sbFields.ToString()); FileHelper.WriteFile(Application.StartupPath + "\\Models", strClass, tableName); #endregion #region 扩展Model string strClassExt = strClassExtTemplate.Replace("#table_comments", tableComments.Replace("\r\n", "\r\n ///")); strClassExt = strClassExt.Replace("#table_name", tableName); FileHelper.WriteFile(Application.StartupPath + "\\ExtModels", strClassExt.ToString(), tableName); #endregion #region 操作控件 invokeDelegate = delegate() { progressBar1.Value = ++i; }; InvokeUtil.Invoke(this, invokeDelegate); #endregion } #region 操作控件 invokeDelegate = delegate() { btnCreate.Enabled = true; progressBar1.Visible = false; progressBar1.Value = 0; }; InvokeUtil.Invoke(this, invokeDelegate); #endregion MessageBox.Show("完成"); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } })).Start(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetshareDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetSystem_NoticeDal(); }
public override void SetCurrentDal() { CurrentDal = DalFactory.Getsign_inDal(); }
public static void MyClassInitialize(TestContext testContext) { employeeIdList = null; log4net.Config.XmlConfigurator.Configure(); log4net.ILog logger = log4net.LogManager.GetLogger("DBTool MSSQL Test"); logger.Debug("Start Test"); string connectionString = @"Server=IT11001312P1\SQLEX2008R2;database=DBToolSampleDB;User Id=sa;Pwd=1qazxsw2;"; IDalFactory dalFactory = new DalFactory(connectionString); NFramework.DBTool.Test.IDal.DalManager.Load(dalFactory); }
public override void SetCurrentDal() { CurrentDal = DalFactory.GetSys_LetterDal(); }