Ejemplo n.º 1
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetSystem_VoteDetailsDal();
 }
Ejemplo n.º 2
0
        public void Update()
        {
            IDalKlant DAL = DalFactory.CreateKlantDal();

            DAL.Update(this.ToDTO());
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetcommentDal();
 }
Ejemplo n.º 5
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getcust_linkmanDal();
 }
Ejemplo n.º 6
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getstatistic_detailDal();
 }
Ejemplo n.º 7
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetworkplanDal();
 }
Ejemplo n.º 8
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetCourseRoomDal();
 }
Ejemplo n.º 9
0
        public void Update()
        {
            IDalProduct DAL = DalFactory.CreateProductDal();

            DAL.Update(this.ToDTO());
        }
Ejemplo n.º 10
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetAssetManagementDal();
 }
Ejemplo n.º 11
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetEva_QuestionAnswerDal();
 }
Ejemplo n.º 12
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetTMP_RewardRankDal();
 }
Ejemplo n.º 13
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetEva_RegularDal();
 }
Ejemplo n.º 14
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetTPM_AcheiveRewardInfoDal();
 }
Ejemplo n.º 15
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetEva_CourseType_TableDal();
 }
Ejemplo n.º 16
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getfollow_upDal();
 }
Ejemplo n.º 17
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getcust_customerDal();
 }
Ejemplo n.º 18
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getparam_ruleDal();
 }
Ejemplo n.º 19
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetSys_UserInfoDal();
 }
Ejemplo n.º 20
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetpraiseDal();
 }
Ejemplo n.º 21
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetaudioDal();
 }
Ejemplo n.º 22
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getpub_paramDal();
 }
Ejemplo n.º 23
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getcrm_Test_logDal();
 }
Ejemplo n.º 24
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getremind_settingDal();
 }
Ejemplo n.º 25
0
 public UserBll(DalFactory dalFactory, IMapper mapper)
 {
     _dalFactory = dalFactory;
     _mapper     = mapper;
 }
Ejemplo n.º 26
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getreport_senderDal();
 }
Ejemplo n.º 27
0
        //生成
        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();
        }
Ejemplo n.º 28
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetshareDal();
 }
Ejemplo n.º 29
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetSystem_NoticeDal();
 }
Ejemplo n.º 30
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.Getsign_inDal();
 }
Ejemplo n.º 31
0
        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);
        }
Ejemplo n.º 32
0
 public override void SetCurrentDal()
 {
     CurrentDal = DalFactory.GetSys_LetterDal();
 }