예제 #1
0
        public static List<PMS.Model.DTO.Appraisal.CoreValue> GetCoreValuesProgressToUpdateForAjax(string[] result)
        {
            List<PMS.Model.DTO.Appraisal.CoreValue> lst_kpis = null;

            if (!Lib.Utility.Common.IsNullOrEmptyList(result))
            {
                lst_kpis = new List<Model.DTO.Appraisal.CoreValue>();
                string[] arr_values = new string[2];

                foreach (string str_result in result)
                {
                    string[] kparray = str_result.Replace("\"", "").Split(',');
                    //string tmp_comment = kparray[1].Split(':')[1].Replace("}]", "").Trim().TrimEnd('\r', '\n').Replace("\\n", Environment.NewLine).Trim();
                    string tmp_progress = Lib.Utility.Common.ReplaceLineBreaksForDatabase(kparray[1].Split(':')[1].Replace("}]", "").Trim());
                    //string tmp_comment_id = Lib.Utility.Common.ReplaceLineBreaksForDatabase(kparray[2].Split(':')[1].Replace("}]", "").Trim());
                    string tmp_comment_id = kparray[0].Split(':')[1].Trim().Substring(8);
                    PMS.Model.DTO.Appraisal.CoreValue obj_kpi = new Model.DTO.Appraisal.CoreValue()
                    {
                        Id = Convert.ToInt32(tmp_comment_id),
                        Progress = Lib.Utility.Common.ReplaceLineBreaksForDatabase(tmp_progress)
                    };
                    lst_kpis.Add(obj_kpi);
                }
            }
            return lst_kpis;
        }
예제 #2
0
        public static List<PMS.Model.DTO.Appraisal.CoreValue> GetCoreValueItemsToUpdate(string[] result)
        {
            List<PMS.Model.DTO.Appraisal.CoreValue> lst_core_values = null;

            if (!Lib.Utility.Common.IsNullOrEmptyList(result))
            {
                lst_core_values = new List<Model.DTO.Appraisal.CoreValue>();
                string[] arr_values = new string[5];
                string[] arr_seperator = { "^&*" };

                foreach (string str_result in result)
                {
                    if (!string.IsNullOrEmpty(str_result))
                    {
                        //foreach (string str_result in result.Where(sec => sec.Contains("NewKPI")))
                        //{
                        if (!str_result.Contains("NewKPI"))
                        {
                            arr_values = Uri.UnescapeDataString(str_result).Split(arr_seperator, StringSplitOptions.None);
                            PMS.Model.DTO.Appraisal.CoreValue obj_kpi = new Model.DTO.Appraisal.CoreValue()
                            {
                                Id = Convert.ToInt32(arr_values[0]),
                                Appraisal = new Model.DTO.Appraisal.Appraisal() { Id = Convert.ToInt32(arr_values[1]) },
                                Section = new Model.DTO.Master.Section() { Id = Convert.ToInt32(arr_values[2]) },
                                Block = new Model.DTO.Master.Block() { Id = Convert.ToInt32(arr_values[3]) },
                                //CoreValueCompetency = new Model.DTO.Master.CoreValueCompetency() { Id = Convert.ToInt32(arr_values[4]) },
                                //Target = arr_values[4].Trim().TrimEnd('\r', '\n').Replace("\\n", Environment.NewLine)
                                Target = Lib.Utility.Common.ReplaceLineBreaksForDatabase(arr_values[4].Trim())
                            };
                            lst_core_values.Add(obj_kpi);
                        }
                    }
                }
            }
            return lst_core_values;
        }
예제 #3
0
        public static List<PMS.Model.DTO.Appraisal.CoreValue> GetCoreValuesProgressToUpdate(string[] result)
        {
            List<PMS.Model.DTO.Appraisal.CoreValue> lst_kpis = null;

            if (!Lib.Utility.Common.IsNullOrEmptyList(result))
            {
                lst_kpis = new List<Model.DTO.Appraisal.CoreValue>();
                string[] arr_values = new string[2];
                string[] arr_seperator = { "^&*" };

                foreach (string str_result in result)
                {
                    arr_values = Uri.UnescapeDataString(str_result).Split(arr_seperator, StringSplitOptions.None);
                    PMS.Model.DTO.Appraisal.CoreValue obj_kpi = new Model.DTO.Appraisal.CoreValue()
                    {
                        Id = Convert.ToInt32(arr_values[1].Substring(8)),
                        Progress = Lib.Utility.Common.ReplaceLineBreaksForDatabase(arr_values[0])
                    };
                    lst_kpis.Add(obj_kpi);
                }
            }
            return lst_kpis;
        }
예제 #4
0
        public static List<PMS.Model.DTO.Appraisal.CoreValue> GetCoreValueItemsToDelete(string[] result)
        {
            List<PMS.Model.DTO.Appraisal.CoreValue> lst_core_values = null;

            if (!Lib.Utility.Common.IsNullOrEmptyList(result))
            {
                lst_core_values = new List<Model.DTO.Appraisal.CoreValue>();

                foreach (string str_result in result)
                {
                    if (!string.IsNullOrEmpty(str_result))
                    {
                        PMS.Model.DTO.Appraisal.CoreValue obj_kpi = new Model.DTO.Appraisal.CoreValue() { Id = Int32.Parse(str_result) };
                        lst_core_values.Add(obj_kpi);
                    }
                }
            }
            return lst_core_values;
        }