private void insert_cau_hoi_moi()
        {
            m_us_cau_hoi = new US_GD_CAU_HOI_HOC_VIEN();
            m_us_cau_hoi.strGHI_CHU_LICH_HEN    = m_txt_ghi_chu_hen.Text;
            m_us_cau_hoi.strGHI_CHU_Y_KIEN_KHAC = m_txt_y_kien_khac.Text;
            m_us_cau_hoi.strNOI_DUNG_CAU_HOI    = m_txt_cau_hoi.Text;
            m_us_cau_hoi.strNOI_DUNG_TRA_LOI    = m_rtb_cau_tra_loi.Text;
            if (CValidateTextBox.IsValid(m_dat_ngay_hen_goi_lai, DataType.DateType, allowNull.YES) &&
                m_dat_ngay_hen_goi_lai.Text.Trim() != "")
            {
                m_us_cau_hoi.datTHOI_DIEM_HEN_GOI_LAI = CIPConvert.ToDatetime(m_dat_ngay_hen_goi_lai.Value);
            }
            m_us_cau_hoi.dcID_CAU_HOI       = m_us_v_cau_hoi.dcID;
            m_us_cau_hoi.dcID_DANH_GIA      = CIPConvert.ToDecimal(m_cbo_danh_gia_tra_loi.SelectedValue);
            m_us_cau_hoi.dcID_LOAI_CAU_HOI  = CIPConvert.ToDecimal(m_cbo_loai_cau_hoi_duoi.SelectedValue);
            m_us_cau_hoi.dcID_NGUOI_TRA_LOI = CAppContext_201.getCurrentUserID();
            m_us_cau_hoi.dcID_TRANG_THAI    = CIPConvert.ToDecimal(m_cbo_trang_thai_cau_hoi.SelectedValue);
            m_us_cau_hoi.dcID_YEU_CAU       = m_us_cuoc_goi.dcID;
            //

            m_us_cau_hoi.Insert();

            //
            if (CIPConvert.ToDecimal(m_cbo_trang_thai_cau_hoi.SelectedValue) == TU_DIEN_TRANG_THAI_GD_CAU_HOI_SV.CHO_TRA_LOI)
            {
                m_dc_id_trang_thai_cuoc_goi = TU_DIEN_TRANG_THAI_DON_HANG.DANG_CHO_GQ;
            }
            m_bl_luu_cau_hoi = true;
            BaseMessages.MsgBox_Infor("Đã lưu câu hỏi trên thành công. Nếu không còn câu hỏi nào nữa, hãy bấm \"End Call\"");
        }
 private void form_2_us_obj()
 {
     m_us.dcID_NGUOI_ADD           = CAppContext_201.getCurrentUserID();
     m_us.strHO_TEN_CHU_DIEN_THOAI = m_txt_ten_chu_dien_thoai.Text.Trim();
     m_us.strSO_DIEN_THOAI         = m_txt_so_dien_thoai.Text.Trim();
     m_us.strGHI_CHU_LY_DO         = m_txt_ghi_chu_ly_do.Text.Trim();
 }
        private void remove_v_dm_black_list()
        {
            if (!HelpUtils.is_validated_edit_grid_row(m_fg.Row, m_fg))
            {
                return;
            }
            if (!BaseMessages.MsgBox_Confirm(THONG_BAO.CF_REMOVE_BLACKLIST))
            {
                return;
            }
            US_V_DM_BLACK_LIST v_us = new US_V_DM_BLACK_LIST();

            grid2us_object(v_us, m_fg.Row);
            try {
                v_us.BeginTransaction();
                CAddRemoveBlackListData v_add_bl_data = new CAddRemoveBlackListData();
                v_add_bl_data = CallCenterUtils.add_remove_blacklist(v_us.strSO_DIEN_THOAI, 20);
                if (v_add_bl_data.Status == TRANG_THAI_GOI_WS.THAT_BAI)
                {
                    BaseMessages.MsgBox_Infor(THONG_BAO.ER_REMOVE_BLACKLIST_KO_THANH_CONG);
                    HelpUtils.ghi_log_he_thong(LOG_TRUY_CAP.REMOVE_BLACKLIST, "BLACK_LIST", "Remove blacklist: " + m_us.strSO_DIEN_THOAI, "Error");
                    return;
                }
                v_us.dcID_NGUOI_REMOVE = CAppContext_201.getCurrentUserID();
                v_us.Update();
                HelpUtils.ghi_log_he_thong(LOG_TRUY_CAP.REMOVE_BLACKLIST, "BLACK_LIST", "Remove blacklist: " + m_us.strSO_DIEN_THOAI, "Remove");
                BaseMessages.MsgBox_Infor(THONG_BAO.SC_REMOVE_BLACKLIST_THANH_CONG);
                v_us.CommitTransaction();
                load_data_2_grid();
            }
            catch (Exception v_e) {
                v_us.Rollback();
                CSystemLog_100.ExceptionHandle(v_e);
            }
        }
 private void set_inital_form_load()
 {
     load_cbo_truong();
     load_cbo_truong_sinh_vien();
     load_data_2_cbo_don_vi_noi_bo();
     load_data_2_cbo_nguoi_dai_dien();
     load_thong_tin_cau_hoi();
     m_obj_trans             = get_trans_object(m_fg);
     m_obj_trans_tab1_assign = get_trans_object_tab1_assign(m_fg_tab1_assign);
     load_data_2_grid();
     load_data_2_grid_tab1_assign();
     m_str_stationcode = m_us_dm_user_station.get_station_id_by_user(CAppContext_201.getCurrentUserID());
     m_txt_email_qlht.AutoCompleteCustomSource = load_thong_tin_email_qlht_search("");
 }
Beispiel #5
0
        private void form_2_usobject()
        {
            switch (m_e_form_mode)
            {
            // thêm câu hỏi bắt buộc phải thêm câu trả lời
            case e_form_mode.THEM_CAU_HOI:
                m_us_dm_cau_hoi.dcID_TO_CHUC                = CIPConvert.ToDecimal(m_cbo_don_vi_truong.SelectedValue);
                m_us_dm_cau_hoi.dcID_NHOM_CAU_HOI           = CIPConvert.ToDecimal(m_cbo_nhom_cau_hoi.SelectedValue);
                m_us_dm_cau_hoi.strNOI_DUNG_CAU_HOI         = m_txt_noi_dung_cau_hoi.Text.Trim();
                m_us_dm_cau_hoi.strCAU_TRA_LOI              = m_txt_cau_tra_loi.Text;
                m_us_dm_cau_hoi.datNGAY_TAO                 = m_dat_ngay_tao.Value;
                m_us_dm_cau_hoi.dcNGUOI_TAO                 = CAppContext_201.getCurrentUserID();
                m_us_dm_cau_hoi.dcID_TRANG_THAI_CAU_TRA_LOI = CIPConvert.ToDecimal(m_cbo_trang_thai_cau_tra_loi.SelectedValue);
                if (m_txt_link_tai_lieu.Text.Trim() != "")
                {
                    m_us_dm_cau_hoi.strLINK_TL_THAM_KHAO = m_txt_link_tai_lieu.Text.Trim();
                }
                else
                {
                    m_us_dm_cau_hoi.SetLINK_TL_THAM_KHAONull();
                }
                break;

            // Sửa câu hỏi, ko cho sửa câu trả lời
            case e_form_mode.SUA_CAU_HOI:
                m_us_dm_cau_hoi.dcID_TO_CHUC          = CIPConvert.ToDecimal(m_cbo_don_vi_truong.SelectedValue);
                m_us_dm_cau_hoi.dcID_NHOM_CAU_HOI     = CIPConvert.ToDecimal(m_cbo_nhom_cau_hoi.SelectedValue);
                m_us_dm_cau_hoi.strNOI_DUNG_CAU_HOI   = m_txt_noi_dung_cau_hoi.Text.Trim();
                m_us_dm_cau_hoi.dcNGUOI_CAP_NHAT_CUOI = CAppContext_201.getCurrentUserID();
                m_us_dm_cau_hoi.datNGAY_CAP_NHAP_CUOI = DateTime.Today;
                break;

            // ko thay đổi câu hỏi
            case e_form_mode.DUYET_CAU_TRA_LOI:
                m_us_dm_cau_tra_loi.strCAU_TRA_LOI       = m_txt_cau_tra_loi.Text.Trim();
                m_us_dm_cau_tra_loi.strLINK_TL_THAM_KHAO = m_txt_link_tai_lieu.Text.Trim();
                m_us_dm_cau_tra_loi.dcID_TRANG_THAI      = CIPConvert.ToDecimal(m_cbo_trang_thai_cau_tra_loi.SelectedValue);
                break;

            // ko thay đổi câu hỏi; dùng  procedure riêng để thêm câu trả lời cho câu hỏi
            case e_form_mode.THEM_CAU_TRA_LOI:
                m_us_dm_cau_hoi.strCAU_TRA_LOI       = m_txt_cau_tra_loi.Text.Trim();
                m_us_dm_cau_hoi.datNGAY_TAO          = DateTime.Now;
                m_us_dm_cau_hoi.dcNGUOI_TAO          = CAppContext_201.getCurrentUserID();
                m_us_dm_cau_hoi.strLINK_TL_THAM_KHAO = m_txt_link_tai_lieu.Text.Trim();
                break;
            }
        }
 private void form_2_us_assign_cho_qlht()
 {
     m_us_gd_xu_ly_noi_bo.dcID_NGUOI_LIEN_QUAN  = m_us_dm_qlht.dcID;
     m_us_gd_xu_ly_noi_bo.dcID_USER_GOI         = CAppContext_201.getCurrentUserID();
     m_us_gd_xu_ly_noi_bo.dcID_HANH_DONG_NOI_BO = TU_DIEN_XU_LU_NB.ASSIGN;
     m_us_gd_xu_ly_noi_bo.strDUNG_SO_KHAC_YN    = "N";
     m_us_gd_xu_ly_noi_bo.strSO_DIEN_THOAI_GOI  = "";
     m_us_gd_xu_ly_noi_bo.dcID_CAU_HOI          = m_dc_id_cau_hoi_xu_ly;
     m_us_gd_xu_ly_noi_bo.dcID_CUOC_GOI         = 0;
     m_us_gd_xu_ly_noi_bo.strGHI_CHU            = m_us_dm_qlht.strTEN_THAT;
     m_us_gd_xu_ly_noi_bo.strCALL_ID            = "";
     m_us_gd_xu_ly_noi_bo.strVOICE_CALL_LINK    = m_us_dm_qlht.strACCOUNT;
     m_us_gd_xu_ly_noi_bo.datEND_TIME           = DateTime.Now;
     m_us_gd_xu_ly_noi_bo.datSTART_TIME         = DateTime.Now;
     m_us_gd_xu_ly_noi_bo.dcSTATION_ID          = 0;
     m_us_gd_xu_ly_noi_bo.dcDURATION            = 0;
     m_us_gd_xu_ly_noi_bo.strSTATUS             = "Y";
     m_us_gd_xu_ly_noi_bo.strERROR_CODE         = "";
     m_us_gd_xu_ly_noi_bo.strERROR_DESC         = "";
     m_us_gd_xu_ly_noi_bo.datDATETIME_RESPOND   = DateTime.Now;
     m_us_gd_xu_ly_noi_bo.dcRINGTIME            = 0;
     m_us_gd_xu_ly_noi_bo.strNOI_DUNG_TRAO_DOI  = m_txt_ghi_chu_toi_qlht.Text.Trim();
 }
        void m_pic_call_hoc_vien_Click(object sender, EventArgs e)
        {
            try
            {
                CallInfor v_call_info_obj = new CallInfor();
                v_call_info_obj = HelpUtils.call_2_contact(m_txt_dien_thoai.Text.Trim()
                                                           , f002_main_form.m_str_stationId
                                                           , CAppContext_201.getCurrentUserName());

                m_us_cuoc_goi.strCALL_ID          = v_call_info_obj.call_id;
                m_us_cuoc_goi.strCUOC_GOI_VAO_YN  = "N";
                m_us_cuoc_goi.strHO_TEN_SINH_VIEN = m_txt_ho_ten.Text;
                m_us_cuoc_goi.strLOP           = m_txt_ma_lop.Text;
                m_us_cuoc_goi.strMA_SINH_VIEN  = m_txt_ma_hoc_vien.Text;
                m_us_cuoc_goi.strNOI_SINH      = m_txt_noi_sinh.Text;
                m_us_cuoc_goi.strSO_DIEN_THOAI = m_txt_dien_thoai.Text;
                if (m_cbo_truong.SelectedValue != null)
                {
                    m_us_cuoc_goi.strTRUONG = m_cbo_truong.SelectedValue.ToString();
                }
                else
                {
                    m_us_cuoc_goi.strTRUONG = "------";
                }
                m_us_cuoc_goi.dcID_NGUOI_DUNG         = CAppContext_201.getCurrentUserID();
                m_us_cuoc_goi.dcSTATION_ID            = CIPConvert.ToDecimal(f002_main_form.m_str_stationId);
                m_us_cuoc_goi.dcID_TRANG_THAI         = -1;
                m_us_cuoc_goi.dcID_CAU_HOI_LIEN_QUAN  = CIPConvert.ToDecimal(m_fg[m_fg.Row, (int)e_col_Number.ID_CAU_HOI]);
                m_us_cuoc_goi.dcID_CUOC_GOI_LIEN_QUAN = CIPConvert.ToDecimal(m_fg[m_fg.Row, (int)e_col_Number.ID_YEU_CAU]);
                m_us_cuoc_goi.Insert();
            }
            catch (Exception v_e)
            {
                CSystemLog_100.ExceptionHandle(v_e);
            }
        }
        private void form_2_usobject_goi_noi_bo()
        {
            m_us_gd_xu_ly_noi_bo.dcID_NGUOI_LIEN_QUAN  = CIPConvert.ToDecimal(m_cbo_nguoi_dai_dien.SelectedValue);
            m_us_gd_xu_ly_noi_bo.dcID_USER_GOI         = CAppContext_201.getCurrentUserID();
            m_us_gd_xu_ly_noi_bo.dcID_HANH_DONG_NOI_BO = TU_DIEN_XU_LU_NB.GOI_DIEN;
            if (m_chb_dung_so_khac.Checked)
            {
                m_us_gd_xu_ly_noi_bo.strDUNG_SO_KHAC_YN = "Y";
            }
            else
            {
                m_us_gd_xu_ly_noi_bo.strDUNG_SO_KHAC_YN = "N";
            }
            m_us_gd_xu_ly_noi_bo.strSO_DIEN_THOAI_GOI = m_txt_dien_thoai_ndd.Text.Trim();
            m_us_gd_xu_ly_noi_bo.dcID_CAU_HOI         = m_dc_id_cau_hoi_xu_ly;
            m_us_gd_xu_ly_noi_bo.strCALL_ID           = m_call_infor.call_id;
            m_us_gd_xu_ly_noi_bo.strERROR_CODE        = m_call_infor.error_code;
            m_us_gd_xu_ly_noi_bo.strERROR_DESC        = m_call_infor.error_desc;
            m_us_gd_xu_ly_noi_bo.dcSTATION_ID         = CIPConvert.ToDecimal(m_str_stationcode);

            if (m_call_infor.ringtime != null && m_call_infor.ringtime != "")
            {
                m_us_gd_xu_ly_noi_bo.dcRINGTIME = CIPConvert.ToDecimal(m_call_infor.ringtime);
            }
            else
            {
                m_us_gd_xu_ly_noi_bo.dcRINGTIME = 0;
            }

            if (m_call_infor.duration != null && m_call_infor.duration != "")
            {
                m_us_gd_xu_ly_noi_bo.dcDURATION = CIPConvert.ToDecimal(m_call_infor.duration);
            }
            else
            {
                m_us_gd_xu_ly_noi_bo.dcDURATION = 0;
            }

            if (m_call_infor.link_down_record != null && m_call_infor.link_down_record != "")
            {
                m_us_gd_xu_ly_noi_bo.strVOICE_CALL_LINK = m_call_infor.link_down_record;
            }
            else
            {
                m_us_gd_xu_ly_noi_bo.strVOICE_CALL_LINK = "";
            }

            if (m_call_infor.start_time != null && m_call_infor.start_time != "")
            {
                m_us_gd_xu_ly_noi_bo.datSTART_TIME = HelpUtils.string_2_datetime(m_call_infor.start_time);
            }
            else
            {
                m_us_gd_xu_ly_noi_bo.datSTART_TIME = DateTime.Now;
            }

            if (m_call_infor.end_time != null && m_call_infor.end_time != "")
            {
                m_us_gd_xu_ly_noi_bo.datEND_TIME = HelpUtils.string_2_datetime(m_call_infor.end_time);
            }
            else
            {
                m_us_gd_xu_ly_noi_bo.SetEND_TIMENull();
            }

            if (m_call_infor.datetime_response != null && m_call_infor.datetime_response != "")
            {
                m_us_gd_xu_ly_noi_bo.datDATETIME_RESPOND = HelpUtils.string_2_datetime(m_call_infor.datetime_response);
            }
            else
            {
                m_us_gd_xu_ly_noi_bo.datDATETIME_RESPOND = DateTime.Now;
            }

            m_us_gd_xu_ly_noi_bo.strNOI_DUNG_TRAO_DOI = m_txt_noi_dung_trao_doi.Text.Trim();
        }
        //private void insert_cuoc_goi_moi()
        //{
        //    m_us_cuoc_goi = new US_GD_CUOC_GOI_YEU_CAU();
        //    m_us_cuoc_goi.dcCALL_ID = CIPConvert.ToDecimal(m_call_id);
        //    m_us_cuoc_goi.strCUOC_GOI_VAO_YN = "Y";
        //    m_us_cuoc_goi.strHO_TEN_SINH_VIEN = m_txt_ho_ten.Text;
        //    m_us_cuoc_goi.strLOP = m_txt_ma_lop.Text;
        //    m_us_cuoc_goi.strMA_SINH_VIEN = m_txt_ma_hoc_vien.Text;
        //    m_us_cuoc_goi.strNOI_SINH = m_txt_noi_sinh.Text;
        //    m_us_cuoc_goi.strSO_DIEN_THOAI = m_txt_dien_thoai.Text;
        //    m_us_cuoc_goi.strTRUONG = CIPConvert.ToStr(m_cbo_truong.SelectedValue);
        //    m_us_cuoc_goi.dcID_NGUOI_DUNG = CAppContext_201.getCurrentUserID();
        //    m_us_cuoc_goi.dcSTATION_ID = CIPConvert.ToDecimal(f001_main_form.m_str_stationId);


        //    m_us_cuoc_goi.Insert();

        //}
        private void insert_cuoc_goi_moi()
        {
            // Trường hợp này xảy ra khi bấm nút Lưu câu hỏi lần đầu tiên
            // Nếu cuộc gọi chưa được insert thì phải insert trước
            if (m_us_cuoc_goi.dcID == -1)
            {
                m_us_cuoc_goi.strCALL_ID          = m_call_id;
                m_us_cuoc_goi.strCUOC_GOI_VAO_YN  = "Y";
                m_us_cuoc_goi.strHO_TEN_SINH_VIEN = m_txt_ho_ten.Text;
                m_us_cuoc_goi.strLOP             = m_txt_ma_lop.Text;
                m_us_cuoc_goi.strMA_SINH_VIEN    = m_txt_ma_hoc_vien.Text;
                m_us_cuoc_goi.strNOI_SINH        = m_txt_noi_sinh.Text;
                m_us_cuoc_goi.strSO_DIEN_THOAI   = m_txt_dien_thoai.Text;
                m_us_cuoc_goi.strTRUONG          = CIPConvert.ToStr(m_cbo_truong.SelectedValue);
                m_us_cuoc_goi.dcID_NGUOI_DUNG    = CAppContext_201.getCurrentUserID();
                m_us_cuoc_goi.dcSTATION_ID       = CIPConvert.ToDecimal(f002_main_form.m_str_stationId);
                m_us_cuoc_goi.dcID_TRANG_THAI    = -1;
                m_us_cuoc_goi.strHO_TEN_QLHT     = m_txt_ho_ten_qlht.Text.Trim();
                m_us_cuoc_goi.strDIEN_THOAI_QLHT = m_txt_dien_thoai_qlht.Text.Trim();

                if (m_e_form_mode == e_form_mode.NHAP_TAY)
                {
                    m_us_cuoc_goi.dcTHOI_DIEM_GOI = THOI_DIEM_GOI.GOI_BUOI_TOI;
                }
                else if (m_e_form_mode == e_form_mode.TU_DONG_OPEN)
                {
                    m_us_cuoc_goi.dcTHOI_DIEM_GOI = THOI_DIEM_GOI.GOI_BAN_NGAY;
                }
                m_us_cuoc_goi.Insert();
            }
            // Trường hợp này xảy ra khi bấm nút End Call
            // Nếu cuộc gọi đã được insert rồi thì chỉ việc update thông tin còn lại.
            else
            {
                CallInfor v_call_info = new CallInfor();
                if (m_e_form_mode == e_form_mode.TU_DONG_OPEN)
                {
                    v_call_info = HelpUtils.get_call_infor(m_call_id
                                                           );
                }
                else
                {
                    v_call_info = HelpUtils.get_call_infor_overtime(m_call_id
                                                                    );
                }


                m_us_cuoc_goi.strERROR_CODE = v_call_info.error_code;
                m_us_cuoc_goi.strERROR_DESC = v_call_info.error_desc;

                m_us_cuoc_goi.strSTATUS          = v_call_info.status;
                m_us_cuoc_goi.strVOICE_CALL_LINK = v_call_info.link_down_record;
                if (v_call_info.datetime_response != null)
                {
                    m_us_cuoc_goi.datDATETIME_RESPOND = HelpUtils.string_2_datetime(v_call_info.datetime_response);
                }
                else
                {
                    m_us_cuoc_goi.datDATETIME_RESPOND = CIPConvert.ToDatetime("01/01/1900", "dd/MM/yyyy");
                }
                if (v_call_info.end_time != null)
                {
                    m_us_cuoc_goi.datEND_TIME = HelpUtils.string_2_datetime(v_call_info.end_time);
                }
                else
                {
                    m_us_cuoc_goi.datEND_TIME = CIPConvert.ToDatetime("01/01/1900", "dd/MM/yyyy");
                }
                if (v_call_info.start_time != null)
                {
                    m_us_cuoc_goi.datSTART_TIME = HelpUtils.string_2_datetime(v_call_info.start_time);
                }
                else
                {
                    m_us_cuoc_goi.datSTART_TIME = CIPConvert.ToDatetime("01/01/1900", "dd/MM/yyyy");
                }
                m_us_cuoc_goi.dcDURATION          = CIPConvert.ToDecimal(v_call_info.duration);
                m_us_cuoc_goi.dcID_TRANG_THAI     = m_dc_id_trang_thai_cuoc_goi;
                m_us_cuoc_goi.dcRINGTIME          = CIPConvert.ToDecimal(v_call_info.ringtime);
                m_us_cuoc_goi.strHO_TEN_SINH_VIEN = m_txt_ho_ten.Text.Trim();
                m_us_cuoc_goi.dcID_NGUOI_DUNG     = CAppContext_201.getCurrentUserID();
                m_us_cuoc_goi.strSO_DIEN_THOAI    = m_txt_dien_thoai.Text;
                m_us_cuoc_goi.strCUOC_GOI_VAO_YN  = "Y";
                m_us_cuoc_goi.strCALL_ID          = m_call_id;

                if (m_e_form_mode == e_form_mode.NHAP_TAY)
                {
                    m_us_cuoc_goi.dcTHOI_DIEM_GOI = THOI_DIEM_GOI.GOI_BUOI_TOI;
                }
                else if (m_e_form_mode == e_form_mode.TU_DONG_OPEN)
                {
                    m_us_cuoc_goi.dcTHOI_DIEM_GOI = THOI_DIEM_GOI.GOI_BAN_NGAY;
                }

                m_us_cuoc_goi.Update();
                BaseMessages.MsgBox_Infor("Đã lưu thông tin cuộc gọi thành công");
            }
        }