public override void Execute() { Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting = FwkGenerator.TemplateSettingFactoty(); Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting.Project.ProjectName = Project.Name; Fwk.Bases.ServiceConfiguration cngf = new Bases.ServiceConfiguration(); cngf.Name = serviceName; cngf.Available = true; cngf.CreatedDateTime = Now; cngf.CreatedUserName = Environment.UserName; cngf.Request = string.Concat(string.Concat(Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting.Project.InterfaceServices, ".", serviceName, "Req ,"), Project.Name); cngf.Response = string.Concat(string.Concat(Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting.Project.InterfaceServices, ".", serviceName, "Res ,"), Project.Name); cngf.Handler = string.Concat(string.Concat(Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting.Project.BusinessService, ".", serviceName, "Service ,"), Project.Name); cngf.IsolationLevel = Transaction.IsolationLevel.ReadCommitted; if (Fwk.Guidance.Core.HelperFunctions.RequiresNew(serviceName)) { cngf.TransactionalBehaviour = TransactionalBehaviour.RequiresNew; } else { cngf.TransactionalBehaviour = TransactionalBehaviour.Suppres; } string foldert = System.IO.Path.GetDirectoryName(Project.FullName); string fileFullName = string.Empty; DirectoryInfo dInfo = new DirectoryInfo(foldert); if (!System.IO.Directory.Exists("Metadata")) dInfo = dInfo.CreateSubdirectory("Metadata"); StringBuilder err = new StringBuilder(); try { fileFullName = Path.Combine(dInfo.FullName, string.Concat(serviceName, ".xml")); Fwk.HelperFunctions.FileFunctions.SaveTextFile(fileFullName, cngf.GetXml()); Project.ProjectItems.AddFromFile(fileFullName); } catch (Exception ex) { MessageBox.Show(string.Concat("The SVC's classes was successfully generated with errors /r", Fwk.Exceptions.ExceptionHelper.GetAllMessageException( ex)), Fwk.GuidPk.Properties.Resources.ProductTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public override void Execute() { Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting = FwkGenerator.TemplateSettingFactoty(); Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting.Project.ProjectName = Project.Name; Fwk.Bases.ServiceConfiguration cngf = new Bases.ServiceConfiguration(); cngf.Name = serviceName; cngf.Available = true; cngf.CreatedDateTime = Now; cngf.CreatedUserName = Environment.UserName; cngf.Request = string.Concat(string.Concat(Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting.Project.InterfaceServices, ".", serviceName, "Req ,"), Project.Name); cngf.Response = string.Concat(string.Concat(Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting.Project.InterfaceServices, ".", serviceName, "Res ,"), Project.Name); cngf.Handler = string.Concat(string.Concat(Fwk.CodeGenerator.FwkGeneratorHelper.TemplateSetting.Project.BusinessService, ".", serviceName, "Service ,"), Project.Name); cngf.IsolationLevel = Transaction.IsolationLevel.ReadCommitted; if (Fwk.Guidance.Core.HelperFunctions.RequiresNew(serviceName)) { cngf.TransactionalBehaviour = TransactionalBehaviour.RequiresNew; } else { cngf.TransactionalBehaviour = TransactionalBehaviour.Suppres; } string foldert = System.IO.Path.GetDirectoryName(Project.FullName); string fileFullName = string.Empty; DirectoryInfo dInfo = new DirectoryInfo(foldert); if (!System.IO.Directory.Exists("Metadata")) { dInfo = dInfo.CreateSubdirectory("Metadata"); } StringBuilder err = new StringBuilder(); try { fileFullName = Path.Combine(dInfo.FullName, string.Concat(serviceName, ".xml")); Fwk.HelperFunctions.FileFunctions.SaveTextFile(fileFullName, cngf.GetXml()); Project.ProjectItems.AddFromFile(fileFullName); } catch (Exception ex) { MessageBox.Show(string.Concat("The SVC's classes was successfully generated with errors /r", Fwk.Exceptions.ExceptionHelper.GetAllMessageException(ex)), Fwk.GuidPk.Properties.Resources.ProductTitle, MessageBoxButtons.OK, MessageBoxIcon.Error); } }