Пример #1
0
 public static List <GetQAnswer> GetQAnswerID(string t_id, string q_id)
 {
     listGetQAnswer.Clear();
     wcf.parti.Service1 _parti     = new wcf.parti.Service1();
     partiDB.RootObject rootObject = new partiDB.RootObject();
     if (listGetQAnswer.Count == 0)
     {
         string json_str = _parti.GetQAnswer(t_id, q_id);
         if (json_str == "e0")//code error
         {
             MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
         }
         else if (json_str == "e1")//no data found
         {
             MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
         }
         else if (json_str == "e2")//can't connect databbase
         {
             MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
         }
         else
         {
             var i = 1;
             rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
             foreach (var vl in rootObject.GetQAnswer)
             {
                 listGetQAnswer.Add(new GetQAnswer(vl.a_id, vl.answer_text, vl.q_id, vl.t_id, vl.status, vl.date_of_modified_date));
             }
         }
     }
     return(listGetQAnswer);
 }
Пример #2
0
        public static List <CheckTraineeForTraining> checkTraineeForTrainings(string trainee_id, string course_id)
        {
            listCheckTraineeForTraining.Clear();
            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();

            string json_str = _parti.CheckTraineeForTraining(trainee_id, course_id);

            if (json_str == "e0")//code error
            {
                MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
            }
            else if (json_str == "e1")//no data found
            {
                MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
            }
            else if (json_str == "e2")//can't connect databbase
            {
                MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
            }
            else
            {
                rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                foreach (var vl in rootObject.CheckTraineeForTraining)
                {
                    listCheckTraineeForTraining.Add(new CheckTraineeForTraining(vl.id, vl.trainee_id, vl.course_id, vl.course_name,
                                                                                vl.title, vl.training_address, vl.training_date, vl.code));
                }
            }

            return(listCheckTraineeForTraining);
        }
Пример #3
0
        public static string SetTraineeForTraining(string action, string id, string trainee_id, string training_id)
        {
            string result = null;

            wcf.parti.Service1 _parti   = new wcf.parti.Service1();
            string             json_str = _parti.EditTraineeForTrainings(action, id, trainee_id, training_id);

            if (json_str == "e0")//code error
            {
                result = "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.";
            }
            else if (json_str == "e1")//no data found
            {
                result = "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.";
            }
            else if (json_str == "e2")//can't connect databbase
            {
                result = "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.";
            }
            else if (json_str == "e5")
            {
                result = "e5:ຈັດການຂໍ້ມູນສຳເລັດ.";
            }

            return(result);
        }
Пример #4
0
 public static List <GetCourse> GetgridData()
 {
     gridData.Clear();
     wcf.parti.Service1 _parti     = new wcf.parti.Service1();
     partiDB.RootObject rootObject = new partiDB.RootObject();
     if (gridData.Count == 0)
     {
         string json_str = _parti.GetCourse();
         if (json_str == "e0")//code error
         {
             MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
         }
         else if (json_str == "e1")//no data found
         {
             MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
         }
         else if (json_str == "e2")//can't connect databbase
         {
             MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
         }
         else
         {
             rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
             foreach (var vl in rootObject.GetCourse)
             {
                 gridData.Add(new GetCourse(vl.id, vl.name, vl.description));
             }
         }
     }
     return(gridData);
 }
Пример #5
0
 private void EditApproval(string action)
 {
     wcf.parti.Service1 parti = new wcf.parti.Service1();
     try
     {
         var result = parti.EditApproval(action, txtID.Value, txtAppr_Fullname.Value, txtAppr_Position_name.Value, txtAppr_Position_major.Value,
                                         txtAppr_Relationship_trainee.Value, txtAppr_Office_name.Value, txtAppr_Office_tel.Value, txtAppr_Mobile_tel.Value, txtAppr_Email.Value);
         if (result == "e3")
         {
             MessageBox.swalModal(this.Page, "info", "e3: ມີ ລະຫັດ/ຊື່ຜູ້ໃຊ້ ນີ້ໃນຖານຂໍ້ມູນແລ້ວ ລອງໃສ່ ລະຫັດ/ຊື່ຜູ້ໃຊ້ ໃຫມ່...", "");
         }
         else if (result == "e0")
         {
             MessageBox.swalModal(this.Page, "error", "en:internal error", "");
         }
         else if (result == "e2")
         {
             MessageBox.swalModal(this.Page, "warning", "e2:connection to dbs error...", "");
         }
         else if (result == "e5")
         {
             MessageBox.swalModal(this.Page, "success", "ຈັດການຂໍ້ມູນສຳເລັດ...", Request.RawUrl);
             parti.LoggingAsync("set", "Trainee Approval", "user: "******"username"].ToString() + " had " + action + " a Trainee Approval: " +
                                txtAppr_Fullname.Value + " from system", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
         }
     }
     catch (Exception ex)
     {
         MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
         parti.LoggingAsync("set", "Trainee Approval", ex.Message, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
     }
 }
Пример #6
0
        public static string EditQTitle(string action, string t_id, string title_name, string training_id, string created_date, string q_type)
        {
            string result = null;

            wcf.parti.Service1 _parti   = new wcf.parti.Service1();
            string             json_str = _parti.EditQTitle(action, t_id, title_name, training_id, created_date, q_type, "");

            if (json_str == "e0")//code error
            {
                result = "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.";
            }
            else if (json_str == "e1")//no data found
            {
                result = "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.";
            }
            else if (json_str == "e2")//can't connect databbase
            {
                result = "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.";
            }
            else if (json_str == "e5")
            {
                result = "e5";
            }

            return(result);
        }
Пример #7
0
        public static List <GetUserProfile> GetUserProfileInfo(string id)
        {
            getUserProfile.Clear();
            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();

            string json_str = _parti.GetTrainerList(id);

            if (json_str == "e0")//code error
            {
                MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
            }
            else if (json_str == "e1")//no data found
            {
                MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
            }
            else if (json_str == "e2")//can't connect databbase
            {
                MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
            }
            else
            {
                rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                foreach (var vl in rootObject.GetTrainerList)
                {
                    getUserProfile.Add(new GetUserProfile(vl.id, vl.fullname_la, vl.fullname_eng, vl.date_of_birth, vl.sex, vl.status, vl.village, vl.district,
                                                          vl.province, vl.work_place, vl.department, vl.position, vl.date_of_govermented, vl.office_tel, vl.mobile_tel, vl.email,
                                                          vl.avatar_url, vl.doc1_url, vl.doc2_url, vl.doc3_url, vl.doc4_url, vl.doc5_url, vl.username, vl.education_level, vl.education_major,
                                                          vl.education_country, vl.educated_year, vl.education_name));
                }
            }
            return(getUserProfile);
        }
Пример #8
0
 private void EditApproval(string action)
 {
     wcf.parti.Service1 parti = new wcf.parti.Service1();
     try
     {
         var result = parti.EditApproval(action, txtID.Value, txtAppr_Fullname.Value, txtAppr_Position_name.Value, txtAppr_Position_major.Value,
                                         txtAppr_Relationship_trainee.Value, txtAppr_Office_name.Value, txtAppr_Office_tel.Value, txtAppr_Mobile_tel.Value, txtAppr_Email.Value);
         if (result == "e3")
         {
             MessageBox.swalModal(this.Page, "info", "e3: ມີ ລະຫັດ/ຊື່ຜູ້ໃຊ້ ນີ້ໃນຖານຂໍ້ມູນແລ້ວ ລອງໃສ່ ລະຫັດ/ຊື່ຜູ້ໃຊ້ ໃຫມ່...", "");
         }
         else if (result == "e0")
         {
             MessageBox.swalModal(this.Page, "error", "en:internal error", "");
         }
         else if (result == "e2")
         {
             MessageBox.swalModal(this.Page, "warning", "e2:connection to dbs error...", "");
         }
         else if (result == "e5")
         {
             MessageBox.swalModal(this.Page, "success", "ຈັດການຂໍ້ມູນສຳເລັດ...", Request.RawUrl);
         }
     }
     catch (Exception ex)
     {
         MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
     }
 }
Пример #9
0
        public static List <trainingrpt01> GetRPT01Info(string type, string sdate, string edate)
        {
            listTrainingrpt01s.Clear();
            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();
            if (listTrainingrpt01s.Count == 0)
            {
                string json_str = _parti.GetTrainingRPT01(type, sdate, edate);
                if (json_str == "e0")//code error
                {
                    MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
                }
                else if (json_str == "e1")//no data found
                {
                    MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
                }
                else if (json_str == "e2")//can't connect database
                {
                    MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
                }
                else
                {
                    rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                    foreach (var vl in rootObject.trainingrpt01)
                    {
                        listTrainingrpt01s.Add(new trainingrpt01(vl.course_id, vl.course_name, vl.training_id, vl.title,
                                                                 vl.total_trainee, vl.date_range, vl.organizer, vl.total_event, vl.training_address, vl.total_trainee_fmale));
                    }
                }
            }

            return(listTrainingrpt01s);
        }
Пример #10
0
        public static List <GetLogs> GetgridData(string searchtxt, string date1, string date2)
        {
            gridData.Clear();
            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();

            string json_str = _parti.LoggingAsync("get", "Logs", searchtxt, date1, date2);

            if (json_str == "e0")//code error
            {
                MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
            }
            else if (json_str == "e1")//no data found
            {
                MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
            }
            else if (json_str == "e2")//can't connect databbase
            {
                MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
            }
            else
            {
                rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                foreach (var vl in rootObject.GetLogs)
                {
                    gridData.Add(new GetLogs(vl.id, vl.method, vl.log_txt, vl.date_time));
                }
            }

            return(gridData);
        }
Пример #11
0
        public static List <GetTrainerByTraining> GetTrainerByTrainings(string id)
        {
            TrainerByTrainings.Clear();
            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();

            string json_str = _parti.GetTrainerByTraining(id);

            if (json_str == "e0")//code error
            {
                MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
            }
            else if (json_str == "e1")//no data found
            {
                MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
            }
            else if (json_str == "e2")//can't connect databbase
            {
                MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
            }
            else
            {
                int i = 1;
                rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                foreach (var vl in rootObject.GetTrainerByTraining)
                {
                    TrainerByTrainings.Add(new GetTrainerByTraining(vl.training_id, vl.trainer_id, vl.fullname, vl.work_place));
                    i++;
                }
            }
            return(TrainerByTrainings);
        }
Пример #12
0
 public static List <GetTrainingIDName> getTrainingId(string id, string title)
 {
     GetTrainingIdNames.Clear();
     wcf.parti.Service1 _parti     = new wcf.parti.Service1();
     partiDB.RootObject rootObject = new partiDB.RootObject();
     if (GetTrainingIdNames.Count == 0)
     {
         string json_str = _parti.GetTrainingIdNames(id, title);
         if (json_str == "e0")//code error
         {
             MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
         }
         else if (json_str == "e1")//no data found
         {
             MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
         }
         else if (json_str == "e2")//can't connect databbase
         {
             MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
         }
         else
         {
             rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
             foreach (var vl in rootObject.GetTrainingIDName)
             {
                 GetTrainingIdNames.Add(new GetTrainingIDName(vl.id, vl.title));
             }
         }
     }
     return(GetTrainingIdNames);
 }
Пример #13
0
 public static List <GetTrainingExperience_Trainer> GetTrainingExperiences_Trainer(string id)
 {
     listTrainingExperiences_Trainer.Clear();
     wcf.parti.Service1 _parti     = new wcf.parti.Service1();
     partiDB.RootObject rootObject = new partiDB.RootObject();
     if (listTrainingExperiences_Trainer.Count == 0)
     {
         string json_str = _parti.GetTrainingExperience_Trainer(id);
         if (json_str == "e0")//code error
         {
             MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
         }
         else if (json_str == "e1")//no data found
         {
             MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
         }
         else if (json_str == "e2")//can't connect database
         {
             MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
         }
         else
         {
             rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
             foreach (var vl in rootObject.GetTrainingExperience_Trainer)
             {
                 listTrainingExperiences_Trainer.Add(new GetTrainingExperience_Trainer(vl.training_id,
                                                                                       vl.title, vl.int_or_ext, vl.address, vl.training_date, vl.trainer_id));
             }
         }
     }
     return(listTrainingExperiences_Trainer);
 }
Пример #14
0
        public static string EditExperiance(string action, string id, string experience_id, string responsibility, string office, string years)
        {
            string result = null;

            wcf.parti.Service1 _parti = new wcf.parti.Service1();
            if ((experience_id != "" && responsibility != "" && office != "" && years != "") || (action == "del"))
            {
                string json_str = _parti.EditExperience(action, id, experience_id, responsibility, office, years);
                if (json_str == "e0")//code error
                {
                    result = "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.";
                }
                else if (json_str == "e1")//no data found
                {
                    result = "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.";
                }
                else if (json_str == "e2")//can't connect databbase
                {
                    result = "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.";
                }
                else if (json_str == "e5")
                {
                    result = "e5";
                }
                else if (json_str == "e3")
                {
                    result = "e3";
                }
            }
            return(result);
        }
Пример #15
0
        public static string getCountUserAnswer(string q_type, string t_id, string q_id, string a_id)
        {
            string uan = null;

            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();
            try
            {
                string json_str = _parti.GetCountUserAnswer(q_type, t_id, q_id, a_id);
                if (json_str == "e0")//code error
                {
                    MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
                }
                else if (json_str == "e1")//no data found
                {
                    MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
                }
                else if (json_str == "e2")//can't connect database
                {
                    MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
                }
                else
                {
                    uan = json_str;
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(_Page, "error", "e0:" + ex.Message, "");
            }
            return(uan);
        }
Пример #16
0
 public static List <GetExperience> GetExperianceInfo(string exper_id)
 {
     listGetExperiance.Clear();
     wcf.parti.Service1 _parti     = new wcf.parti.Service1();
     partiDB.RootObject rootObject = new partiDB.RootObject();
     if (listGetExperiance.Count == 0)
     {
         string json_str = _parti.GetExperience(exper_id);
         if (json_str == "e0")//code error
         {
             MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
         }
         else if (json_str == "e1")//no data found
         {
             MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
         }
         else if (json_str == "e2")//can't connect database
         {
             MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
         }
         else
         {
             rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
             foreach (var vl in rootObject.GetExperience)
             {
                 listGetExperiance.Add(new GetExperience(vl.id, vl.experience_id, vl.responsibility, vl.office, vl.years));
             }
         }
     }
     return(listGetExperiance);
 }
Пример #17
0
        private List <GetQTitle> GetQTitleList(string t_id)
        {
            listGetQTitle.Clear();
            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();
            if (listGetQTitle.Count == 0)
            {
                string json_str = _parti.GetQTitle(t_id);
                if (json_str == "e0")//code error
                {
                    MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
                }
                else if (json_str == "e1")//no data found
                {
                    MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
                }
                else if (json_str == "e2")//can't connect databbase
                {
                    MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
                }
                else
                {
                    var i = 1;
                    rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                    foreach (var vl in rootObject.GetQTitle)
                    {
                        listGetQTitle.Add(new GetQTitle(vl.t_id, vl.title_name, vl.training_id, vl.date_of_modified_data, vl.q_type));
                        HtmlElement _tbody = new HtmlElement();
                        var         QType  = "";

                        if (vl.q_type == "b")
                        {
                            QType = "ຄຳຖາມກ່ອນຝຶກ";
                        }
                        else if (vl.q_type == "a")
                        {
                            QType = "ຄຳຖາມຫຼັງຝຶກ";
                        }

                        _tbody.InnerHtml = "<tr class='evalist'><td class='col s1 m1 l1'>" + i + "</td>" +
                                           "<td class='col s2 m2 l2'>" + vl.t_id + "</td>" +
                                           "<td class='col s4 m4 l4'>" + vl.title_name + "</td>" +
                                           "<td class='col s2 m2 l2'>" + QType + " </td>" +
                                           "<td class='col s3 m3 l3 center'><div class='row right'><div class='col'>" +
                                           "<a class='btn-floating waves-effect tooltipped hvr-grow-shadow' data-position='left' data-tooltip='ແກ້ໄຂ' " +
                                           "id='btnEdit" + i + "' name='" + vl.t_id + "' onclick='GetQInfo(" + (i - 1) + ", this.name)'><i class='material-icons right'>edit</i>" +
                                           "</a></div><div class='col'><a class='btn-floating waves-effect tooltipped hvr-grow-shadow' data-position='top' " +
                                           "data-tooltip='ເປີດຫນ້າແບບຟອມສຳລັບຜູ້ຝຶກ' id='btnEvaLink" + i + "' name='" + vl.t_id + "' onclick='GenLink(this.name, " + i + ")'>" +
                                           "<i class='material-icons right'>open_in_new</i></a></div><div class='col'><a class='btn-floating waves-effect tooltipped hvr-grow-shadow modal-trigger' data-position='right' " +
                                           "data-tooltip='ສ້າງ QR Code ສຳລັບແບບຟອມນີ້' id='btnQRGent" + i + "' name='" + vl.t_id + "' onclick='GenQRCode(this.name, " + i + ")'><i class='fas fa-qrcode'></i></a></div></div></td></tr>";
                        tbody.Controls.Add(_tbody);
                        i++;
                    }
                }
            }
            return(listGetQTitle);
        }
Пример #18
0
        protected void EditAction(string eventType, object record)
        {
            try
            {
                partiDB.GetCourse           claCourse = new partiDB.GetCourse();
                Dictionary <string, object> KeyVal    = record as Dictionary <string, object>;

                Parallel.ForEach(KeyVal, key =>
                {
                    if (key.Key == "id")
                    {
                        claCourse.id = (int)key.Value;
                    }
                    else if (key.Key == "name")
                    {
                        claCourse.name = (string)key.Value;
                    }
                    else if (key.Key == "description")
                    {
                        claCourse.description = (string)key.Value;
                    }
                });

                if (eventType == "endAdd")
                {
                    //wcf add users
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditCourse("add", claCourse.id, true, claCourse.name, claCourse.description);
                    ReloadData(result);
                    _parti.LoggingAsync("set", "Course", "user: "******"username"].ToString() + " had add new Course: " +
                                        claCourse.name + " to system", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
                }
                else if (eventType == "endEdit")
                {
                    //wcf update data
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditCourse("edit", claCourse.id, true, claCourse.name, claCourse.description);
                    ReloadData(result);
                    _parti.LoggingAsync("set", "Course", "user: "******"username"].ToString() + " had edit a Course: " +
                                        claCourse.name + " on system", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
                }
                else if (eventType == "endDelete")
                {
                    //wcf delete data
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditCourse("del", claCourse.id, true, claCourse.name, claCourse.description);
                    ReloadData(result);
                    _parti.LoggingAsync("set", "Course", "user: "******"username"].ToString() + " had delete a Course: " +
                                        claCourse.name + " from system", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
            }
        }
Пример #19
0
        protected void EditAction(string eventType, object record)
        {
            try
            {
                partiDB.GetUsers            claUsers = new partiDB.GetUsers();
                Dictionary <string, object> KeyVal   = record as Dictionary <string, object>;

                Parallel.ForEach(KeyVal, key =>
                {
                    if (key.Key == "id")
                    {
                        claUsers.id = (int)key.Value;
                    }
                    else if (key.Key == "username")
                    {
                        claUsers.username = (string)key.Value;
                    }
                    else if (key.Key == "passwd")
                    {
                        claUsers.passwd = (string)key.Value;
                    }
                    else if (key.Key == "rules")
                    {
                        claUsers.rules = (string)key.Value;
                    }
                });

                if (eventType == "endAdd")
                {
                    //wcf add users
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditUsers("add", claUsers.id, true, claUsers.username, enCoding.SetEncryptData(claUsers.passwd), claUsers.rules);
                    ReloadData(result);
                }
                else if (eventType == "endEdit")
                {
                    //wcf update data
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditUsers("edit", claUsers.id, true, claUsers.username, enCoding.SetEncryptData(claUsers.passwd), claUsers.rules);
                    ReloadData(result);
                }
                else if (eventType == "endDelete")
                {
                    //delete data
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditUsers("del", claUsers.id, true, claUsers.username, enCoding.SetEncryptData(claUsers.passwd), claUsers.rules);
                    ReloadData(result);
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
            }
        }
Пример #20
0
        public List <GetTraineeList> GetTraineeLists()
        {
            TraineeLists.Clear();
            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();

            string json_str = _parti.GetTraineeList("");

            if (json_str == "e0")//code error
            {
                MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
            }
            else if (json_str == "e1")//no data found
            {
                MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
            }
            else if (json_str == "e2")//can't connect databbase
            {
                MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
            }
            else
            {
                int i = 1;
                rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                foreach (var vl in rootObject.GetTraineeList)
                {
                    TraineeLists.Add(new GetTraineeList(vl.id, vl.fullname_la, vl.fullname_eng, vl.date_of_birth, vl.sex, vl.status, vl.village, vl.district,
                                                        vl.province, vl.work_place, vl.department, vl.position, vl.date_of_govermented, vl.office_tel, vl.mobile_tel, vl.email, vl.avatar_url,
                                                        vl.approval_id, vl.doc1_url, vl.doc2_url, vl.doc3_url, vl.doc4_url, vl.doc5_url, vl.appr_id, vl.appr_fullname, vl.appr_position_name, vl.appr_position_major,
                                                        vl.appr_relationship_trainee, vl.appr_office_name, vl.appr_office_tel, vl.appr_mobile_tel, vl.appr_email, vl.education_level, vl.education_major,
                                                        vl.education_country, vl.educated_year, vl.education_name));
                    //Render Table
                    HtmlElement _tbody = new HtmlElement();
                    _tbody.InnerHtml = "<tr id='" + i + "' class='search_result'>" +
                                       "<td>" + i + "</td>" +
                                       "<td><img class='materialboxed circle z-depth-3' width='50' " +
                                       "height='50' src='" + vl.avatar_url + "'></td>" +
                                       "<td>" + vl.id + "</td>" +
                                       "<td>" + vl.fullname_la + "</td>" +
                                       "<td>" + vl.work_place + "</td>" +
                                       "<td><div class='row'><div class='col'><button type='button' " +
                                       "class='btn btn-small teal darken-2 tooltipped hvr-grow-shadow modal-trigger z-depth-3' " +
                                       "href='#modalTrainee' data-position='left' data-tooltip='ແກ້ໄຂຂໍ້ມູນ' " +
                                       "id='" + (i - 1) + "' onclick='SetTraineeInfo(this.id)'>" +
                                       "<i class='material-icons'>edit</i></button></div></div></td></tr>";
                    tbBody.Controls.Add(_tbody);
                    i++;
                }
                lblTotalTrainer.InnerText = (i - 1).ToString();
            }
            return(TraineeLists);
        }
Пример #21
0
        private List <GetTrainerList> GetTrainerLists()
        {
            TrainerLists.Clear();
            wcf.parti.Service1 _parti     = new wcf.parti.Service1();
            partiDB.RootObject rootObject = new partiDB.RootObject();

            string json_str = _parti.GetTrainerList("");

            if (json_str == "e0") //code error
            {
                MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
            }
            else if (json_str == "e1") //no data found
            {
                MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
            }
            else if (json_str == "e2") //can't connect databbase
            {
                MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
            }
            else
            {
                int i = 0;
                rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                foreach (var vl in rootObject.GetTrainerList)
                {
                    TrainerLists.Add(new GetTrainerList(vl.id, vl.fullname_la, vl.fullname_eng, vl.date_of_birth, vl.sex, vl.status, vl.village, vl.district,
                                                        vl.province, vl.work_place, vl.department, vl.position, vl.date_of_govermented, vl.office_tel, vl.mobile_tel, vl.email,
                                                        vl.avatar_url, vl.doc1_url, vl.doc2_url, vl.doc3_url, vl.doc4_url, vl.doc5_url, vl.username, vl.education_level, vl.education_major,
                                                        vl.education_country, vl.educated_year, vl.education_name));
                    //Render Carousel
                    HtmlElement carouselItem = new HtmlElement();
                    carouselItem.InnerHtml = "<div class='card card-profiler laotxt hvr-grow-shadow' data-cindex='" + i + "'>" +
                                             "<div class='card-image'>" +
                                             "<a href='#'><img class='img' src='" + vl.avatar_url.Replace("~", "") + "'></a>" +
                                             "</div>" +
                                             "<div class='table center'>" +
                                             "<p class='truncate'>" + vl.fullname_la + "</p>" +
                                             "<p class='truncate'>" + vl.position + "</p>" +
                                             "<button id='btn" + i + "' value='" + i + "' onclick='SetTrainerInfo(this.value); return false;' type='button' " +
                                             "class='btn-floating btn-small waves-effect waves-light red darken-3 tooltipped modal-trigger' href='#modalTrainer' data-position='buttom' " +
                                             "data-tooltip='ຂໍ້ມູນເພີ່ມຕື່ມ'><i class='material-icons'>keyboard_arrow_down</i></button>" +
                                             "</div></div>";
                    crsTrainerList.Controls.AddAt(i, carouselItem);
                    i++;
                }
                lblTotalTrainer.InnerText = i.ToString();
            }
            return(TrainerLists);
        }
Пример #22
0
        public List <GetCompareYearPlan> SumYearPlanThisyear()
        {
            planByTimeRanges.Clear();
            try
            {
                wcf.parti.Service1 _parti     = new wcf.parti.Service1();
                partiDB.RootObject rootObject = new partiDB.RootObject();
                gridDataCourses = GetgridData();
                if (planByTimeRanges.Count == 0)
                {
                    foreach (var i in gridDataCourses)
                    {
                        if (i.id == 0)
                        {
                            goto Line1;
                        }
                        else
                        {
                            string json_str = _parti.GetCompareYearPlan(i.id.ToString(), thisyear, "Y");
                            if (json_str == "e0")//code error
                            {
                                MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
                            }
                            else if (json_str == "e1")//no data found
                            {
                                MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
                            }
                            else if (json_str == "e2")//can't connect database
                            {
                                MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
                            }
                            else
                            {
                                rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                                foreach (var vl in rootObject.GetCompareYearPlan)
                                {
                                    planByTimeRanges.Add(new GetCompareYearPlan(thisyear, i.id.ToString(), vl.CourseName, vl.Targets, vl.DoneTarget));
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(_Page, "error", "e0:" + ex.Message, "");
            }
Line1:
            return(planByTimeRanges);
        }
Пример #23
0
        protected void EditAction(string eventType, object record)
        {
            try
            {
                partiDB.GetCourse           claCourse = new partiDB.GetCourse();
                Dictionary <string, object> KeyVal    = record as Dictionary <string, object>;

                Parallel.ForEach(KeyVal, key =>
                {
                    if (key.Key == "id")
                    {
                        claCourse.id = (int)key.Value;
                    }
                    else if (key.Key == "name")
                    {
                        claCourse.name = (string)key.Value;
                    }
                    else if (key.Key == "description")
                    {
                        claCourse.description = (string)key.Value;
                    }
                });

                if (eventType == "endAdd")
                {
                    //wcf add users
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditCourse("add", claCourse.id, true, claCourse.name, claCourse.description);
                    ReloadData(result);
                }
                else if (eventType == "endEdit")
                {
                    //wcf update data
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditCourse("edit", claCourse.id, true, claCourse.name, claCourse.description);
                    ReloadData(result);
                }
                else if (eventType == "endDelete")
                {
                    //wcf delete data
                    wcf.parti.Service1 _parti = new wcf.parti.Service1();
                    var result = _parti.EditCourse("del", claCourse.id, true, claCourse.name, claCourse.description);
                    ReloadData(result);
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
            }
        }
Пример #24
0
        public static string SetTraining(string action, string id, string title, string course_id, string int_or_ext, string training_address, string training_district, string training_province,
                                         string training_days, string training_date, string description, string date_of_modified_data)
        {
            string result = null;

            wcf.parti.Service1 _parti   = new wcf.parti.Service1();
            string             json_str = _parti.EditTrainings(action, id, title, course_id, int_or_ext, training_address, training_district, training_province,
                                                               training_days, training_date, description, date_of_modified_data);

            if (json_str == "e0")//code error
            {
                result = "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.";
            }
            else if (json_str == "e1")//no data found
            {
                result = "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.";
            }
            else if (json_str == "e2")//can't connect databbase
            {
                result = "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.";
            }
            else if (json_str == "e5")
            {
                result = "e5:ບັນທຶກຕາລາງການຝຶກອົບຮົມເຂົ້າລະບົບຮຽບຮ້ອຍ!";
            }
            else if (json_str == "e3")
            {
                json_str = _parti.EditTrainings("edit", id, title, course_id, int_or_ext, training_address, training_district, training_province,
                                                training_days, training_date, description, date_of_modified_data);
                if (json_str == "e0")//code error
                {
                    result = "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.";
                }
                else if (json_str == "e1")//no data found
                {
                    result = "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.";
                }
                else if (json_str == "e2")//can't connect databbase
                {
                    result = "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.";
                }
                else if (json_str == "e5")
                {
                    result = "e5:ບັນທຶກຕາລາງການຝຶກອົບຮົມເຂົ້າລະບົບຮຽບຮ້ອຍ!";
                }
            }

            return(result);
        }
Пример #25
0
        protected void btnDel_OnClick(object sender, EventArgs e)
        {
            wcf.parti.Service1 _parti = new wcf.parti.Service1();
            try
            {
                string action     = "del";
                string sex        = null;
                string status     = null;
                string renamePath = Server.MapPath(txtAvatarHidd_I.Value);

                var result = _parti.EditTrainee(action, txtID.Value, txtNameLA.Value, txtNameEng.Value, dtpBD.Value, sex,
                                                status, txtVill.Value, txtDistrict.Value, txtProvince.Value,
                                                txtWork_place.Value, txtDepartment.Value, txtPosition.Value, txtDate_of_govermented.Value,
                                                txtOffice_tel.Value, txtMobile_tel.Value, txtEmail.Value, txtAvatarHidd_I.Value,
                                                txtID.Value, txtReferDoc1Hidd_I.Value, txtReferDoc2Hidd_I.Value, txtReferDoc3Hidd_I.Value,
                                                txtReferDoc4Hidd_I.Value, txtReferDoc5Hidd_I.Value);

                if (result == "e3")
                {
                    MessageBox.swalModal(this.Page, "info", "e3: ມີລະຫັດນີ້ໃນຖານຂໍ້ມູນແລ້ວ ລອງໃສ່ລະຫັດໃຫມ່...", "");
                }
                else if (result == "e0")
                {
                    MessageBox.swalModal(this.Page, "error", "en:internal error", "");
                }
                else if (result == "e2")
                {
                    MessageBox.swalModal(this.Page, "warning", "e2:connection to dbs error...", "");
                }
                else if (result == "e5")
                {
                    if (txtAvatarHidd_I.Value != "")
                    {
                        File.Delete(renamePath);
                    }
                    EditApproval(action);
                    EditEducation(action);
                    string currentPage = Request.RawUrl;
                    MessageBox.swalModal(this.Page, "success", "ຈັດການຂໍ້ມູນສຳເລັດ...", currentPage);
                    _parti.LoggingAsync("set", "Trainee", "user: "******"username"].ToString() + " had delete a Trainee: " +
                                        txtNameLA.Value + " from system", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
                _parti.LoggingAsync("set", "Trainee", ex.Message, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
            }
        }
Пример #26
0
        private void EditEducation(string action)
        {
            wcf.parti.Service1 parti   = new wcf.parti.Service1();
            string             country = null;

            if (rdEduIn.Checked)
            {
                country = "in";
            }
            else if (rdEduOut.Checked)
            {
                country = "out";
            }

            try
            {
                var result = parti.EditEducation(action, txtID.Value, txtEducation_level.Value,
                                                 txtEducation_major.Value, country, txtEducated_year.Value, txtEducation_Name.Value);
                if (result == "e3")
                {
                    MessageBox.swalModal(this.Page, "info", "e3: ມີ ລະຫັດ/ຊື່ຜູ້ໃຊ້ ນີ້ໃນຖານຂໍ້ມູນແລ້ວ ລອງໃສ່ ລະຫັດ/ຊື່ຜູ້ໃຊ້ ໃຫມ່...", "");
                }
                else if (result == "e0")
                {
                    MessageBox.swalModal(this.Page, "error", "en:internal error", "");
                }
                else if (result == "e2")
                {
                    MessageBox.swalModal(this.Page, "warning", "e2:connection to dbs error...", "");
                }
                else if (result == "e5")
                {
                    MessageBox.swalModal(this.Page, "success", "ຈັດການຂໍ້ມູນສຳເລັດ...", Request.RawUrl);
                    parti.LoggingAsync("set", "User Trainer Education", "user: "******"username"].ToString() + " had " + action + " a User Trainer Education: " +
                                       txtID.Value + " on system", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
                parti.LoggingAsync("set", "User Trainer Education", ex.Message, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "");
            }
        }
Пример #27
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            try
            {
                wcf.parti.Service1 _parti     = new wcf.parti.Service1();
                string             action     = "del";
                string             sex        = null;
                string             status     = null;
                string             renamePath = Server.MapPath(txtAvatarHidd_I.Value);

                string result = _parti.EditTrainer(action, txtIDHidden.Value, txtNameLa.Value, txtNameEng.Value, dtpBD.Value, sex, status, txtVillage.Value,
                                                   txtDistrict.Value, txtProvince.Value, txtWork_place.Value, txtDepartment.Value, txtPosition.Value, txtDate_of_govermented.Value,
                                                   txtOffice_tel.Value, txtMobile_tel.Value, txtEmail.Value, lblPicUrlPath.InnerText, txtReferDoc1Hidd_I.Value, txtReferDoc2Hidd_I.Value,
                                                   txtReferDoc3Hidd_I.Value, txtReferDoc4Hidd_I.Value, txtReferDoc5Hidd_I.Value, txtUsername.Value);
                if (result == "e3")
                {
                    MessageBox.swalModal(this.Page, "info", "e3: ມີລະຫັດນີ້ໃນຖານຂໍ້ມູນແລ້ວ ລອງໃສ່ລະຫັດໃຫມ່...", "");
                }
                else if (result == "e0")
                {
                    MessageBox.swalModal(this.Page, "error", "en:internal error", "");
                }
                else if (result == "e2")
                {
                    MessageBox.swalModal(this.Page, "warning", "e2:connection to dbs error...", "");
                }
                else if (result == "e5")
                {
                    if (avartaUrl.Value != "~/img/avatar.png")
                    {
                        File.Delete(renamePath);
                    }
                    EditEducation(action);
                    string currentPage = Request.RawUrl;
                    MessageBox.swalModal(this.Page, "success", "ຈັດການຂໍ້ມູນສຳເລັດ...", currentPage);
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
            }
        }
Пример #28
0
        private void EditEducation(string action)
        {
            wcf.parti.Service1 parti   = new wcf.parti.Service1();
            string             country = null;

            if (rdEduIn.Checked)
            {
                country = "in";
            }
            else if (rdEduOut.Checked)
            {
                country = "out";
            }

            try
            {
                var result = parti.EditEducation(action, txtID.Value, txtEducation_level.Value,
                                                 txtEducation_major.Value, country, txtEducated_year.Value, txtEducation_Name.Value);
                if (result == "e3")
                {
                    MessageBox.swalModal(this.Page, "info", "e3: ມີ ລະຫັດ/ຊື່ຜູ້ໃຊ້ ນີ້ໃນຖານຂໍ້ມູນແລ້ວ ລອງໃສ່ ລະຫັດ/ຊື່ຜູ້ໃຊ້ ໃຫມ່...", "");
                }
                else if (result == "e0")
                {
                    MessageBox.swalModal(this.Page, "error", "en:internal error", "");
                }
                else if (result == "e2")
                {
                    MessageBox.swalModal(this.Page, "warning", "e2:connection to dbs error...", "");
                }
                else if (result == "e5")
                {
                    MessageBox.swalModal(this.Page, "success", "ຈັດການຂໍ້ມູນສຳເລັດ...", Request.RawUrl);
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
            }
        }
Пример #29
0
        public List <SumYearlyCourse> GetpieChart()
        {
            List <@SumYearlyCourse> chartData = new List <@SumYearlyCourse>();

            try
            {
                wcf.parti.Service1 _parti     = new wcf.parti.Service1();
                partiDB.RootObject rootObject = new partiDB.RootObject();

                string json_str = _parti.SumYearlyCourse();
                rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                foreach (var vl in rootObject.SumYearlyCourse)
                {
                    chartData.Add(new SumYearlyCourse(vl.course, vl.total, vl.course + ", " + vl.total.ToString("N")));
                }
            }
            catch (Exception ex)
            {
                MessageBox.swalModal(this.Page, "error", "en:internal error[" + ex.Message.Replace("'", "") + "]", "");
            }
            return(chartData);
        }
Пример #30
0
 public static List <GetYearPlan> GetgridDataYearPlans()
 {
     try
     {
         gridDataYearPlans.Clear();
         wcf.parti.Service1 _parti     = new wcf.parti.Service1();
         partiDB.RootObject rootObject = new partiDB.RootObject();
         if (gridDataYearPlans.Count == 0)
         {
             string json_str = _parti.GetYearPlans("");
             if (json_str == "e0")//code error
             {
                 MessageBox.swalModal(_Page, "error", "e0:ລະບົບຂັດຂ້ອງຕິດຕໍ່ຜູ້ເບີ່ງແຍ່ງດ່ວນ.", "");
             }
             else if (json_str == "e1")//no data found
             {
                 MessageBox.swalModal(_Page, "info", "e1:ບໍ່ມີຂໍ້ມູນທີ່ຈະສະແດງ.", "");
             }
             else if (json_str == "e2")//can't connect databbase
             {
                 MessageBox.swalModal(_Page, "warning", "e2:ບໍ່ສາມາດເຊື່ອມຕໍ່ຖານຂໍ້ມູນໄດ້.", "");
             }
             else
             {
                 rootObject = JsonConvert.DeserializeObject <partiDB.RootObject>(json_str);
                 foreach (var vl in rootObject.GetYearPlans)
                 {
                     gridDataYearPlans.Add(new GetYearPlan(vl.id, vl.year_plan, vl.course_id, vl.target));
                 }
             }
         }
     }
     catch (Exception)
     {
         gridDataYearPlans = null;
     }
     return(gridDataYearPlans);
 }