コード例 #1
0
 void WriteLog()
 {
     FileLogHelper fl = new FileLogHelper();
     //记录文件日志
     DBLogHelper dbfl = new DBLogHelper();
     //记录日志到数据库
 }
コード例 #2
0
ファイル: OryxBuilder.cs プロジェクト: ppvasude/KuduLite
        public override Task Build(DeploymentContext context)
        {
            FileLogHelper.Log("In oryx build...");

            // Step 1: Run kudusync

            string kuduSyncCommand = string.Format("kudusync -v 50 -f {0} -t {1} -n {2} -p {3} -i \".git;.hg;.deployment;.deploy.sh\"",
                                                   RepositoryPath,
                                                   context.OutputPath,
                                                   context.NextManifestFilePath,
                                                   context.PreviousManifestFilePath
                                                   );

            FileLogHelper.Log("Running KuduSync with  " + kuduSyncCommand);

            RunCommand(context, kuduSyncCommand, false, "Oryx-Build: Running kudu sync...");

            OryxArguments args = new OryxArguments();

            if (args.RunOryxBuild)
            {
                string buildCommand = args.GenerateOryxBuildCommand(context);
                RunCommand(context, buildCommand, false, "Running oryx build...");

                //
                // Run express build setups if needed
                if (args.Flags == BuildOptimizationsFlags.UseExpressBuild)
                {
                    Oryx.ExpressBuilder.SetupExpressBuilderArtifacts(context.OutputPath);
                }
            }

            return(Task.CompletedTask);
        }
コード例 #3
0
        /// <summary>
        /// 删除数据库备份
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public override Result Delete(int ID)
        {
            var backup = dal.Get(ID);

            if (backup == null)
            {
                return(new Result(300, "数据不存在!"));
            }
            var path = HttpContext.Current.Server.MapPath("/App_Data/Backup");

            path = path + "\\" + backup.FileName;

            // 删除文件
            if (File.Exists(path))
            {
                try
                {
                    File.Delete(path);
                }
                catch (Exception e)
                {
                    var logger = FileLogHelper.GetLogger(this.GetType());
                    logger.Error(e.Message, e);
                    return(new Result(300, "文件删除失败!"));
                }
            }

            return(base.Delete(ID));
        }
コード例 #4
0
ファイル: uploadHelper.ashx.cs プロジェクト: volkanytu/Portal
        public void ProcessRequest(HttpContext context)
        {
            FileLogHelper.LogEvent("Kale-uploadHelper", @"C:\DO\");

            context.Response.ContentType = "application/json";

            object returnValue = null;

            JavaScriptSerializer serializer = new JavaScriptSerializer();

            try
            {
                _sda = new SqlDataAccess();
                _sda.openConnection(Globals.ConnectionString);

                string operation  = context.Request.QueryString["operation"];
                string userId     = context.Request.QueryString["userid"];
                string graffitiId = context.Request.QueryString["graffitiId"];

                if (operation == "1" && !string.IsNullOrEmpty(userId)) //Profile resmi güncelleme
                {
                    returnValue = new MsCrmResult();

                    _service = MSCRM.GetOrgService(true);
                    HttpPostedFile file = context.Request.Files[0];

                    returnValue = SaveProfileImage(userId, file, context);
                }
                else if (operation == "2" && !string.IsNullOrEmpty(graffitiId)) //Duvar yazısı resim ekleme
                {
                    returnValue = new MsCrmResult();

                    _service = MSCRM.GetOrgService(true);
                    HttpPostedFile file = context.Request.Files[0];

                    returnValue = SaveGraffitiImage(new Guid(graffitiId), file, context);
                }
                else
                {
                    ((MsCrmResultObject)returnValue).Result = "Eksik veya yanlış parametre.";
                }
            }
            catch (Exception ex)
            {
                returnValue = new MsCrmResult();
                ((MsCrmResult)returnValue).HasException = true;
                ((MsCrmResult)returnValue).Result       = ex.Message;
            }
            finally
            {
                if (_sda != null)
                {
                    _sda.closeConnection();
                }
            }

            var dataRes = serializer.Serialize(returnValue);

            context.Response.Write(dataRes);
        }
コード例 #5
0
        public SendSms()
        {
            InitializeComponent();

            try
            {
                LOG_PATH       = Globals.FileLogPath;
                ERROR_LOG_PATH = Globals.FileLogPath;

                _tokenSource = new CancellationTokenSource();
                _token       = _tokenSource.Token;

                _timer           = new System.Timers.Timer();
                _timer.Interval  = Convert.ToDouble(ConfigurationManager.AppSettings["serviceInterval"]);
                _timer.AutoReset = true;
                _timer.Enabled   = true;

                _timer.Elapsed += timer_Elapsed;

                _sda = new SqlDataAccess();
                _sda.openConnection(Globals.ConnectionString);

                _service = MSCRM.GetOrgService(true);

                _serviceProcess = new ServiceProcess(_sda, _service);
            }
            catch (Exception ex)
            {
                FileLogHelper.LogFunction(this.GetType().Name, "SendSms_SendSms_EXCEPTION:" + ex.Message, ERROR_LOG_PATH);
            }
        }
コード例 #6
0
        public override Task Build(DeploymentContext context)
        {
            FileLogHelper.Log("In oryx build...");

            // initialize the repository Path for the build
            context.RepositoryPath = RepositoryPath;

            // Initialize Oryx Args.
            IOryxArguments args = OryxArgumentsFactory.CreateOryxArguments();

            if (!args.SkipKuduSync)
            {
                // Step 1: Run kudusync
                string kuduSyncCommand = string.Format("kudusync -v 50 -f {0} -t {1} -n {2} -p {3} -i \".git;.hg;.deployment;.deploy.sh\"",
                                                       RepositoryPath,
                                                       context.OutputPath,
                                                       context.NextManifestFilePath,
                                                       context.PreviousManifestFilePath
                                                       );

                FileLogHelper.Log("Running KuduSync with  " + kuduSyncCommand);

                RunCommand(context, kuduSyncCommand, false, "Oryx-Build: Running kudu sync...");
            }

            if (args.RunOryxBuild)
            {
                PreOryxBuild(context);

                string buildCommand = args.GenerateOryxBuildCommand(context);
                RunCommand(context, buildCommand, false, "Running oryx build...");

                //
                // Run express build setups if needed
                if (args.Flags == BuildOptimizationsFlags.UseExpressBuild)
                {
                    if (FunctionAppHelper.LooksLikeFunctionApp())
                    {
                        SetupFunctionAppExpressArtifacts(context);
                    }
                    else
                    {
                        Oryx.ExpressBuilder.SetupExpressBuilderArtifacts(context.OutputPath);
                    }
                }
            }

            // Detect if package upload is necessary for server side build
            if (FunctionAppHelper.HasScmRunFromPackage() && FunctionAppHelper.LooksLikeFunctionApp())
            {
                SetupLinuxConsumptionFunctionAppDeployment(context).Wait();
            }

            return(Task.CompletedTask);
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: volkanytu/NEF
        static void Main(string[] args)
        {
            string logFolder  = @Environment.CurrentDirectory + @"\log\";
            string dataFolder = @Environment.CurrentDirectory + @"\files\";

            //string logFolder = @"C:\isgyodata\log\";
            //string dataFolder = @"C:\isgyodata\files\";

            SqlDataAccess sda = new SqlDataAccess();

            sda.openConnection(Globals.ConnectionString);

            ICollaborateData process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.HouseData);
            MsCrmResult      resultProcess = process.Process(sda);

            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);

            process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.OpportunityData);
            resultProcess = process.Process(sda);
            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);

            process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.ContactData);
            resultProcess = process.Process(sda);
            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);

            process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.AppointmentData);
            resultProcess = process.Process(sda);
            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);

            process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.PhoneCallData);
            resultProcess = process.Process(sda);
            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);

            process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.PaymentData);
            resultProcess = process.Process(sda);
            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);

            process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.SalesData);
            resultProcess = process.Process(sda);
            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);

            process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.WebFormData);
            resultProcess = process.Process(sda);
            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);

            process       = GetDataFactory.Instance.GetCollaborationData(CollaborateDataType.AccountData);
            resultProcess = process.Process(sda);
            FileLogHelper.LogEvent(resultProcess.Success.ToString() + "|" + resultProcess.Result, logFolder);



            SendFilesToFtp sendFile = new SendFilesToFtp(dataFolder, "ftp://ftp.nef.com.tr", "indibox", "sGw1WMtj");

            sendFile.Process();
        }
コード例 #8
0
ファイル: OryxBuilder.cs プロジェクト: puneetg1983/KuduLite
        public override Task Build(DeploymentContext context)
        {
            FileLogHelper.Log("In oryx build...");

            // initialize the repository Path for the build
            context.RepositoryPath = RepositoryPath;

            context.Logger.Log("Repository path is " + context.RepositoryPath);

            // Initialize Oryx Args.
            IOryxArguments args = OryxArgumentsFactory.CreateOryxArguments(environment);

            if (!args.SkipKuduSync)
            {
                // Step 1: Run kudusync
                string kuduSyncCommand = string.Format("kudusync -v 50 -f {0} -t {1} -n {2} -p {3} -i \".git;.hg;.deployment;.deploy.sh\"",
                                                       context.RepositoryPath,
                                                       context.OutputPath,
                                                       context.NextManifestFilePath,
                                                       context.PreviousManifestFilePath
                                                       );

                FileLogHelper.Log("Running KuduSync with  " + kuduSyncCommand);

                RunCommand(context, kuduSyncCommand, false, "Oryx-Build: Running kudu sync...");
            }

            if (args.RunOryxBuild)
            {
                PreOryxBuild(context);

                string buildCommand = args.GenerateOryxBuildCommand(context);
                RunCommand(context, buildCommand, false, "Running oryx build...");

                //
                // Run express build setups if needed
                if (args.Flags == BuildOptimizationsFlags.UseExpressBuild)
                {
                    if (FunctionAppHelper.LooksLikeFunctionApp())
                    {
                        SetupFunctionAppExpressArtifacts(context);
                    }
                    else
                    {
                        ExpressBuilder appServiceExpressBuilder = new ExpressBuilder(environment, settings, propertyProvider, sourcePath);
                        appServiceExpressBuilder.SetupExpressBuilderArtifacts(context.OutputPath, context, args);
                    }
                }
                else if (args.Flags == BuildOptimizationsFlags.DeploymentV2)
                {
                    SetupAppServiceArtifacts(context);
                }
            }
            return(Task.CompletedTask);
        }
コード例 #9
0
 public void Check_H1_Text()
 {
     try
     {
         Assert.AreEqual("About author", _aboutPageObject.H1.Text);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #10
0
 public void Check_H1_Text()
 {
     try
     {
         Assert.AreEqual("Hi there!", _welcomePageObject.H1Welcome.Text);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #11
0
 public void Check_H1_Text()
 {
     try
     {
         Assert.AreEqual("List of posts with authors", _postPageObject.H1Text.Text);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #12
0
 public void Check_Info_About_Author()
 {
     try
     {
         Assert.IsNotNull(_aboutPageObject.About);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #13
0
 public void Check_Is_Page_Report_Exist()
 {
     try
     {
         Assert.IsTrue(_postPageObject.PageReport.Displayed);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #14
0
 public void Check_Table_Name_Heading()
 {
     try
     {
         Assert.AreEqual("Post Title", _postPageObject.GetNameHeadings(3));
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #15
0
 public void Count_Table_Name_Heading()
 {
     try
     {
         Assert.AreEqual(6, _postPageObject.TableHeading.Count);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #16
0
 public void Chech_Is_Table_Exist()
 {
     try
     {
         Assert.IsNotNull(_postPageObject.Table.Displayed);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #17
0
        private MsCrmResult SendToService(DiscoveryForm discoveryForm)
        {
            MsCrmResult returnValue = new MsCrmResult();

            try
            {
                lotusService.UcretsizKesifService lotus = new WindowsServices.ProcessDiscoveryForms.lotusService.UcretsizKesifService();

                //lotusService.RESPONSE result = lotus.CREATERECORD("A3108", 1, discoveryForm.FirstName, discoveryForm.LastName, discoveryForm.Email, discoveryForm.PhoneNumber
                //             , discoveryForm.VisitHour.Value, discoveryForm.CityId.Name, discoveryForm.TownId.Name, discoveryForm.HomeType.Value
                //             , "", ((DateTime)discoveryForm.VisitDate).ToString("dd.MM.yyyy HH:mm"), discoveryForm.InformedBy.Value);



                FileLogHelper.LogFunction(this.GetType().Name, "DefaultPortalId:" + Globals.DefaultPortalId, @Globals.FileLogPath);
                FileLogHelper.LogFunction(this.GetType().Name, "UserParameter:" + (discoveryForm.UserId != null ? discoveryForm.UserId.Id.ToString() : "No User Info"), @Globals.FileLogPath);

                MsCrmResultObject resultUser = PortalUserHelper.GetPortalUserDetail(new Guid(Globals.DefaultPortalId), discoveryForm.UserId.Id, _sda);

                string userName = "";

                if (resultUser.Success)
                {
                    PortalUser portalUser = (PortalUser)resultUser.ReturnObject;

                    userName = portalUser.ContactInfo.Title;
                }
                else
                {
                    userName = discoveryForm.UserId.Name;
                }

                lotusService.RESPONSE result = lotus.CREATERECORD("A3108", Convert.ToDouble(discoveryForm.FormCode), discoveryForm.FirstName, discoveryForm.LastName, discoveryForm.Email, discoveryForm.PhoneNumber
                                                                  , string.Empty, discoveryForm.CityId.Name, discoveryForm.TownId.Name, string.Empty
                                                                  , "", string.Empty, string.Empty, userName);


                if (result.ERRORCODE == 0)
                {
                    returnValue.Success = true;
                    returnValue.Result  = "Servise Gönderildi.";
                }
                else
                {
                    returnValue.Result = result.ERRORCODE + "|" + result.ERRORDESCRIPTION;
                }
            }
            catch (Exception ex)
            {
                returnValue.Result = ex.StackTrace;
            }

            return(returnValue);
        }
コード例 #18
0
 public void Check_Button_SeePosts()
 {
     try
     {
         IWebElement btn = _welcomePageObject.BtnSeePosts;
         Assert.AreEqual("See posts", btn.Text);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #19
0
        void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            FileLogHelper.LogFunction(this.GetType().Name, "Timer Elapsed", @Globals.FileLogPath);

            _timer.Enabled = false;
            _timer.Stop();

            ProcessForms();

            _timer.Enabled = true;
            _timer.Start();
        }
コード例 #20
0
        /// <summary>
        /// 应用程序启动
        /// </summary>
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            // 初始化log4net配置
            XmlConfigurator.Configure();

            // 记录系统启动日志
            var log = FileLogHelper.GetLogger(this.GetType());

            log.Info("系统启动");
        }
コード例 #21
0
 public void Go_To_Welcome_From_Posts()
 {
     try
     {
         Driver.Navigate().GoToUrl("http://localhost:4200/posts");
         WelcomePageObject welcome = _topMenuPageObject.RedirectToHome();
         Assert.AreEqual("http://localhost:4200/home", Driver.Url);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #22
0
 public void Go_To_About_From_Posts_And_Check_H1_Text()
 {
     try
     {
         Driver.Navigate().GoToUrl("http://localhost:4200/posts");
         AboutPageObject about = _topMenuPageObject.RedirectToAbout();
         Assert.AreEqual("About author", Driver.Url);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #23
0
 public void Go_To_Posts_From_Home_And_Check_H1_Text()
 {
     try
     {
         Driver.Navigate().GoToUrl("http://localhost:4200/home");
         PostsPageObject posts = _topMenuPageObject.RedirectToPosts();
         Assert.AreEqual("List of posts with authors", posts.H1Text.Text);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #24
0
 public void Go_To_About_From_Home()
 {
     try
     {
         Driver.Navigate().GoToUrl("http://localhost:4200/home");
         AboutPageObject about = _topMenuPageObject.RedirectToAbout();
         Assert.AreEqual("http://localhost:4200/about", Driver.Url);
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #25
0
 public void Check_List_Menu_Count()
 {
     try
     {
         string url = "http://localhost:4200/home";
         Driver.Navigate().GoToUrl(url);
         Assert.AreEqual(3, _topMenuPageObject.GetListMenuCount());
     }
     catch (AssertFailedException afe)
     {
         FileLogHelper.Save(afe);
     }
 }
コード例 #26
0
ファイル: ServiceProcess.cs プロジェクト: volkanytu/Portal
        private void UpdateNpsSurveyEntityStatusCode(Guid surveyId, NpsSurveyStatus statusCode)
        {
            try
            {
                Entity ent = new Entity("new_npssurvey");
                ent.Id            = surveyId;
                ent["statuscode"] = new OptionSetValue((int)statusCode);

                _service.Update(ent);
            }
            catch (Exception ex)
            {
                FileLogHelper.LogFunction(this.GetType().Name, "SendNpsSurvey_ServiceProcess_UpdateNpsSurveyEntityStatusCode_EXCEPTION:" + ex.Message, ERROR_LOG_PATH);
            }
        }
コード例 #27
0
        private void ProcessRequests(Guid portalId)
        {
            MsCrmResultObject resultRequestList = GiftHelper.GetGiftReuqestListByStatus(portalId, GiftStatus.Confirmed, _sda);

            if (resultRequestList.Success)
            {
                try
                {
                    List <UserGiftRequest> lstRequests = resultRequestList.GetReturnObject <List <UserGiftRequest> >();

                    FileLogHelper.LogFunction(this.GetType().Name, "RequestCount:" + lstRequests.Count.ToString(), @Globals.FileLogPath);

                    foreach (UserGiftRequest req in lstRequests)
                    {
                        MsCrmResult result = SendToServiceBirIleri(req);

                        if (result.Success)
                        {
                            req.OrderCode = result.Result;
                            req.Status    = new OptionSetValueWrapper()
                            {
                                AttributeValue = (int)GiftStatus.ServiceSent
                            };
                        }
                        else
                        {
                            req.ErrorDesc = result.Result;
                            req.Status    = new OptionSetValueWrapper()
                            {
                                AttributeValue = (int)GiftStatus.ServiceError
                            };

                            FileLogHelper.LogFunction(this.GetType().Name, "SendToService::" + result.Result, @Globals.FileLogPath);
                        }

                        GiftHelper.UpdateGiftRequest(req, _service);
                    }
                }
                catch (Exception ex)
                {
                    FileLogHelper.LogFunction(this.GetType().Name, ex.Message, @Globals.FileLogPath);
                }
            }
            else
            {
                FileLogHelper.LogFunction(this.GetType().Name, resultRequestList.Result, @Globals.FileLogPath);
            }
        }
コード例 #28
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public virtual bool Add(T model)
        {
            var session = NHibernateHelper.GetCurrentSession();

            try
            {
                session.Save(model);
            }
            catch (Exception e)
            {
                var log = FileLogHelper.GetLogger(this.GetType());
                log.Error(e.Message, e);
                return(false);
            }
            return(true);
        }
コード例 #29
0
        void _timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            FileLogHelper.LogFunction(this.GetType().Name, "Timer Elapsed", @Globals.FileLogPath);

            _timer.Enabled = false;
            _timer.Stop();

            List <Guid> lstPortalIds = PortalHelper.GetPortalList(_sda);

            foreach (Guid portalId in lstPortalIds)
            {
                ProcessRequests(portalId);
            }

            _timer.Enabled = true;
            _timer.Start();
        }
コード例 #30
0
        private void UpdateSmsEntity(Guid smsId, SmsStatusCode statusCode, string messageState, string messageStatus)
        {
            try
            {
                Entity ent = new Entity("new_sms");
                ent.Id                       = smsId;
                ent["statuscode"]            = new OptionSetValue((int)statusCode);
                ent["new_messagestate"]      = messageState;
                ent["new_messagestatustext"] = messageStatus;

                _service.Update(ent);
            }
            catch (Exception ex)
            {
                FileLogHelper.LogFunction(this.GetType().Name, "SendSms_ServiceProcess_UpdateSmsEntity_EXCEPTION:" + ex.Message, ERROR_LOG_PATH);
            }
        }