コード例 #1
0
        /// <summary>
        ///		Graba los datos
        /// </summary>
        protected override void Save()
        {
            if (ValidateData())
            {
                ProjectModel newProject;
                string       targetPath = System.IO.Path.Combine(PathTarget, Name);

                // Crea el proyecto
                newProject = new Application.Bussiness.Solutions.ProjectFactory().Create(_solution, _folder, targetPath);
                // Copia el proyecto origen
                if (!ProjectSource.IsEmpty() && System.IO.File.Exists(ProjectSource))
                {
                    // Copia los archivos
                    LibCommonHelper.Files.HelperFiles.CopyPath(System.IO.Path.GetDirectoryName(ProjectSource), targetPath);
                    // Abre el proyecto que se ha creado
                    newProject = new Application.Bussiness.Solutions.ProjectBussiness().Load(_solution, newProject.File.FullFileName);
                    // Cambia el nombre del proyecto
                    newProject.Name        = Name;
                    newProject.Title       = Name;
                    newProject.Description = null;
                    newProject.KeyWords    = null;
                    newProject.URLBase     = null;
                }
                // Graba el nuevo proyecto
                new Application.Bussiness.Solutions.ProjectBussiness().Save(newProject);
                // Cierra el formulario
                RaiseEventClose(true);
            }
        }
コード例 #2
0
        /// <inheritdoc />
        public override void OnExit()
        {
            FlaxEngine.Content.AssetDisposing -= Content_OnAssetDisposing;

            // Disable events
            _enableEvents = false;

            // Cleanup
            Proxy.ForEach(x => x.Dispose());
            if (ProjectContent != null)
            {
                ProjectContent.Dispose();
                ProjectContent = null;
            }
            if (ProjectSource != null)
            {
                ProjectSource.Dispose();
                ProjectSource = null;
            }
            if (EnginePrivate != null)
            {
                EnginePrivate.Dispose();
                EnginePrivate = null;
            }
            if (EditorPrivate != null)
            {
                EditorPrivate.Dispose();
                EditorPrivate = null;
            }
            Proxy.Clear();
        }
コード例 #3
0
        /// 插入或者更新一条记录
        /// <summary>
        /// 插入或者更新一条记录
        /// </summary>
        /// <param name="BusinessID"></param>
        /// <param name="ProjectID"></param>
        /// <param name="source"></param>
        /// <param name="IsEstablish"></param>
        /// <param name="NotEstablishReason"></param>
        /// <param name="IsSuccess"></param>
        /// <param name="NotSuccessReason"></param>
        /// <returns></returns>
        public bool InseretOrUpdateOneData(string BusinessID, long ProjectID, ProjectSource source, int?IsEstablish, int?NotEstablishReason, int?IsSuccess, int?NotSuccessReason)
        {
            CallResult_ORIG_TaskInfo info = new CallResult_ORIG_TaskInfo();

            info.BusinessID = BusinessID;
            info.ProjectID  = ProjectID;
            info.Source     = (int)source;

            info.IsEstablish        = IsEstablish;
            info.NotEstablishReason = NotEstablishReason;
            info.IsSuccess          = IsSuccess;
            info.NotSuccessReason   = NotSuccessReason;

            info.Status = 0;

            CallResult_ORIG_TaskInfo old = GetCallResult_ORIG_TaskInfoByBusinessID(BusinessID);

            if (old == null)
            {
                //新增
                info.CreateUserID = CommonFunction.ObjectToInteger(BLL.Util.GetLoginUserIDNotCheck(), -1);
                info.CreateTime   = DateTime.Now;
                return(CommonBll.Instance.InsertComAdoInfo(info));
            }
            else
            {
                //更新
                info.RecID            = old.RecID;
                info.LastUpdateUserID = CommonFunction.ObjectToInteger(BLL.Util.GetLoginUserIDNotCheck(), -1);
                info.LastUpdateTime   = DateTime.Now;
                return(CommonBll.Instance.UpdateComAdoInfo(info));
            }
        }
コード例 #4
0
        /// <summary>
        ///		Comprueba que los datos introducidos sean correctos
        /// </summary>
        private bool ValidateData()
        {
            bool validate = false;

            // Comprueba los datos introducidos
            if (Name.IsEmpty())
            {
                DocWriterViewModel.Instance.ControllerWindow.ShowMessage("Introduzca el nombre del archivo");
            }
            else if (PathTarget.IsEmpty() || !System.IO.Directory.Exists(PathTarget))
            {
                DocWriterViewModel.Instance.ControllerWindow.ShowMessage("Introduzca el directorio");
            }
            else if (!ProjectSource.IsEmpty() && (!ProjectSource.EndsWith(ProjectModel.FileName,
                                                                          StringComparison.CurrentCultureIgnoreCase) ||
                                                  !System.IO.File.Exists(ProjectSource)))
            {
                DocWriterViewModel.Instance.ControllerWindow.ShowMessage("Seleccione un nombre de proyecto válido");
            }
            else
            {
                validate = true;
            }
            // Devuelve el valor que indica si los datos son correctos
            return(validate);
        }
コード例 #5
0
        /// <summary>
        /// 类转换
        /// </summary>
        /// <param name="project"></param>
        /// <returns></returns>
        public ProjectSource ConvertToProject(SimpleProjectource project)
        {
            ProjectSource ps = new ProjectSource();

            ps.Name              = project.Name;
            ps.OnlyInternal      = project.OnlyInternal;
            ps.ProjectSourceID   = project.ProjectSourceID;
            ps.ProjectSourceType = project.ProjectSourceType.ToEnum <ProjectSourceTypeOptions>(ProjectSourceTypeOptions.Domestic);
            ps.SortIndex         = project.SortIndex;
            ps.Status            = project.Status ? StatusOptions.Valid : StatusOptions.Invalid;
            ps.SoftID            = project.SoftID;
            return(ps);
        }
コード例 #6
0
 protected void OnSave(object sender, DirectEventArgs e)
 {
     try
     {
         ProjectSource obj = new ProjectSource();
         obj.ProjectSourceID   = Convert.ToInt32(txtSourceID.Text);
         obj.Name              = txtSourceName.Text;
         obj.SortIndex         = Convert.ToInt32(txtNumSort.Text);
         obj.Status            = StatusOptions.Valid;
         obj.OnlyInternal      = Convert.ToInt32(onlyinternalselect.SelectedItem.Value) > 0 ? true : false;
         obj.ProjectSourceType = (ProjectSourceTypeOptions)Convert.ToInt32(sourcetypeselect.SelectedItem.Value);
         obj.SoftID            = Convert.ToInt32(txtSoftID.Text.Trim());
         biService.AddPrjectSource(obj);
         e.ExtraParamsResponse.Add(new Ext.Net.Parameter("success", "1", false));
         X.Msg.Alert("消息", "添加成功").Show();
     }
     catch (ToUserException ex)
     {
         e.ExtraParamsResponse.Add(new Ext.Net.Parameter("success", "0", false));
         X.Msg.Alert("消息", ex.Message).Show();
     }
 }
コード例 #7
0
ファイル: CLogger.cs プロジェクト: laxmikantsharma/anbc_news
 public static void WriteLog(ProjectSource projectSource, ELogLevel logLevel, String log)
 {
     CLoggerDataAccess.WriteLogToDB(projectSource.ToString(), logLevel.ToString(), log, null);
 }
コード例 #8
0
        /// 补充数据
        /// <summary>
        /// 补充数据
        /// </summary>
        /// <param name="recid"></param>
        /// <param name="custid"></param>
        /// <param name="crmcustid"></param>
        /// <param name="tasktype"></param>
        /// <param name="taskid"></param>
        public void UpdateSMSSendHistoryAfterNewTask(string smsids, string custid, string crmcustid, ProjectSource tasktype, string taskid)
        {
            string sql = @"UPDATE SMSSendHistory
                                    SET CustID='" + SqlFilter(custid) + "', CRMCustID='" + SqlFilter(crmcustid) + "',TaskType=" + (int)tasktype + ",TaskID='" + SqlFilter(taskid) + @"'
                                    WHERE RecID IN (" + Dal.Util.SqlFilterByInCondition(smsids) + ")";

            SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.Text, sql);
        }
コード例 #9
0
        /// 补充数据
        /// <summary>
        /// 补充数据
        /// </summary>
        /// <param name="callid"></param>
        /// <param name="custid"></param>
        /// <param name="custname"></param>
        /// <param name="tasktypeid"></param>
        /// <param name="taskid"></param>
        public void UpdateCallRecordInfoAfterNewTask(string callids, string custid, string custname, ProjectSource tasktypeid, string taskid)
        {
            string sql = @"UPDATE CallRecordInfo 
                                    SET CustID='" + SqlFilter(custid) + "',CustName='" + SqlFilter(custname) + "',TaskTypeID=" + (int)tasktypeid + ",TaskID='" + SqlFilter(taskid) + @"'
                                    WHERE CallID IN (" + Dal.Util.SqlFilterByInCondition(callids) + ")";

            SqlHelper.ExecuteNonQuery(CONNECTIONSTRINGS, CommandType.Text, sql);
        }
コード例 #10
0
 /// 补充数据
 /// <summary>
 /// 补充数据
 /// </summary>
 /// <param name="recid"></param>
 /// <param name="custid"></param>
 /// <param name="crmcustid"></param>
 /// <param name="tasktype"></param>
 /// <param name="taskid"></param>
 public void UpdateSMSSendHistoryAfterTask(string smsids, string custid, string crmcustid, ProjectSource tasktype, string taskid)
 {
     Dal.CallAfterTaskProcess.Instance.UpdateSMSSendHistoryAfterNewTask(smsids, custid, crmcustid, tasktype, taskid);
 }
コード例 #11
0
 /// 补充数据
 /// <summary>
 /// 补充数据
 /// </summary>
 /// <param name="callid"></param>
 /// <param name="custid"></param>
 /// <param name="custname"></param>
 /// <param name="tasktypeid"></param>
 /// <param name="taskid"></param>
 public void UpdateCallRecordInfoAfterTask(string callids, string custid, string custname, ProjectSource tasktypeid, string taskid)
 {
     Dal.CallAfterTaskProcess.Instance.UpdateCallRecordInfoAfterNewTask(callids, custid, custname, tasktypeid, taskid);
 }
コード例 #12
0
 public static void WriteLog(ProjectSource projectSource, ELogLevel logLevel, String log, Exception exception)
 {
     WriteLogToDB(projectSource.ToString(), logLevel.ToString(), log, exception);
 }
コード例 #13
0
 public static void WriteLog(ProjectSource projectSource, ELogLevel logLevel, String log)
 {
     WriteLog(projectSource, logLevel, log, null);
 }
コード例 #14
0
        public ActionResult Index()
        {
            List <Project> projects = ProjectSource.GetProjects();

            return(View(projects));
        }
コード例 #15
0
        public async Task SeedAsync()
        {
            await _context.Database.MigrateAsync().ConfigureAwait(false);

            var result = await _context.Users.AnyAsync();

            if (!await _context.Users.AnyAsync())
            {
                _logger.LogInformation("Generating inbuilt accounts");

                const string adminRoleName = "administrator";
                const string userRoleName  = "user";

                await EnsureRoleAsync(adminRoleName, "Default administrator", ApplicationPermissions.GetAllPermissionValues());
                await EnsureRoleAsync(userRoleName, "Default user", new string[] { });

                await CreateUserAsync("admin", "tempP@ss123", "Administrator", "*****@*****.**", "+1 (123) 000-0000", new string[] { adminRoleName });
                await CreateUserAsync("Nyasha", "tempP@ss123", "Standard User", "*****@*****.**", "+1 (123) 000-0001", new string[] { userRoleName });
                await CreateUserAsync("Grace", "tempP@ss123", "Administrator", "*****@*****.**", "+1 (123) 000-0001", new string[] { adminRoleName });
                await CreateUserAsync("Martin", "tempP@ss123", "Standard User", "*****@*****.**", "+1 (123) 000-0001", new string[] { userRoleName });
                await CreateUserAsync("User1", "tempP@ss123", "Standard User", "*****@*****.**", "+1 (123) 000-0001", new string[] { userRoleName });
                await CreateUserAsync("User2", "tempP@ss123", "Standard User", "*****@*****.**", "+1 (123) 000-0001", new string[] { userRoleName });
                await CreateUserAsync("User3", "tempP@ss123", "Standard User", "*****@*****.**", "+1 (123) 000-0001", new string[] { userRoleName });

                _logger.LogInformation("Inbuilt account generation has completed");
            }

            if (!await _context.ProjectSources.AnyAsync())
            {
                _logger.LogInformation("Seeding initial data");
                var source1 = new ProjectSource {
                    Name = "Facebook"
                };
                var source2 = new ProjectSource {
                    Name = "Google"
                };
                var source3 = new ProjectSource {
                    Name = "Reference"
                };
                var source4 = new ProjectSource {
                    Name = "Website"
                };

                _context.ProjectSources.AddRange(source4, source3, source2, source1);
                _logger.LogInformation("Seeding initial data completed");
            }

            if (!await _context.ProjectStatuses.AnyAsync())
            {
                _logger.LogInformation("Seeding initial data");

                var pS1 = new ProjectStatus {
                    Name = "Parked"
                };
                var pS2 = new ProjectStatus {
                    Name = "In Progress"
                };
                var pS3 = new ProjectStatus {
                    Name = "Awaiting Approval"
                };
                var pS4 = new ProjectStatus {
                    Name = "Completed"
                };

                _context.ProjectStatuses.AddRange(pS4, pS3, pS2, pS1);
                await _context.SaveChangesAsync();

                _logger.LogInformation("Seeding initial data completed");
            }
        }