Beispiel #1
0
 public static void UpdateProjectConfigValue(string ProjectCode, string ConfigName, object ConfigData)
 {
     try
     {
         DataRow currentRow;
         ProjectConfigStrategyBuilder builder = new ProjectConfigStrategyBuilder();
         builder.AddStrategy(new Strategy(ProjectConfigStrategyName.ProjectCode, ProjectCode));
         builder.AddStrategy(new Strategy(ProjectConfigStrategyName.ConfigName, ConfigName));
         string     queryString = builder.BuildMainQueryString();
         QueryAgent agent       = new QueryAgent();
         EntityData entity      = agent.FillEntityData("ProjectConfig", queryString);
         agent.Dispose();
         if (entity.HasRecord())
         {
             currentRow = entity.CurrentRow;
         }
         else
         {
             currentRow = entity.CurrentTable.NewRow();
             currentRow["ProjectConfigCode"] = SystemManageDAO.GetNewSysCode("ProjectConfigCode");
             currentRow["ProjectCode"]       = ProjectCode;
             currentRow["ConfigName"]        = ConfigName;
             entity.CurrentTable.Rows.Add(currentRow);
         }
         currentRow["ConfigData"] = ConfigData;
         SystemManageDAO.SubmitAllProjectConfig(entity);
         entity.Dispose();
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }