private void ban_hanh_van_ban( string ip_str_danh_sach_email_ban_hanh , decimal ip_dc_id_van_thu) { US_GD_VAN_THU v_us = new US_GD_VAN_THU(ip_dc_id_van_thu); string[] v_arr_email = ip_str_danh_sach_email_ban_hanh.Split(';'); string v_str_mess = ""; try { for (int i = 0; i < v_arr_email.Length; i++) { if (!v_arr_email[i].Trim().Equals("")) { string v_str_send_to = v_arr_email[i]; if (!v_str_send_to.Contains("@gmail.com") && !v_str_send_to.Contains("@yahoo.com") && !v_str_send_to.Contains("@topica.edu.vn")) v_str_send_to += "@topica.edu.vn"; string v_str_web_url = get_html_contain( get_url_postback_in_email(v_str_send_to,v_us.dcID) , v_us.strTEN_LOAI_VA_TRICH_YEU_ND); if (!HelpUtils.SendEmailWithHtmlContent(v_str_send_to , "[QuanLyVanThu] Ban hanh van ban" , v_str_web_url , v_us.strLINK_SCAN)) { MessageBox.Show("Đã có lỗi trong quá trình thực hiện, bạn vui lòng thực hiện lại thao tác!", "Thông báo"); return; } //Ghi du lieu Ban hanh van ban VanThu v_van_thu = new VanThu(); v_van_thu.ban_hanh_van_ban(v_us.dcID, DateTime.Now, v_str_send_to); //Ghi lich su Ban hanh van ban string v_str_van_ban_so = ""; if (v_us.dcID_LOAI_CONG_VAN == ID_LOAI_VAN_THU.CONG_VAN_DEN) { v_str_van_ban_so = v_us.strSO_CV_DEN; } else v_str_van_ban_so = v_us.strSO_VA_KY_HIEU; v_van_thu.ghi_lich_su_hanh_dong( CAppContext_201.getCurrentUserID() , DateTime.Now , "Ban hành văn bản số: " + v_str_van_ban_so + " cho email: " + v_str_send_to); } } v_us.Update(); MessageBox.Show("Đã gửi email ban hành văn bản thành công!", "Thông báo"); this.Close(); } catch (Exception v_e) { //CSystemLog_301.ExceptionHandle(v_e); MessageBox.Show("Đã có lỗi trong quá trình thực hiện, bạn vui lòng thực hiện lại thao tác!", "Thông báo"); return; } }
private bool save_data() { try { string v_str_file_name = m_txt_file_upload.Text.Split('\\')[m_txt_file_upload.Text.Split('\\').Length - 1]; string v_str_save_file = ConfigurationSettings.AppSettings["DOMAIN"] + "/" + "FileUpload_Vanthu" + "/" + v_str_file_name.Replace(ConfigurationSettings.AppSettings["DOMAIN"] + "/" + "FileUpload_Vanthu" + "/",""); if (!m_txt_file_upload.Text.Trim().Equals("") && !m_txt_file_upload.Text.Contains(ConfigurationSettings.AppSettings["DOMAIN"])) { if (!HelpUtils.ftpTransfer(m_txt_file_upload.Text.Replace(v_str_file_name, ""), v_str_file_name)) return false; } //HelpUtils.open_pdf_file(v_str_file_name, "..//Debug/FileScan"); US_GD_VAN_THU v_us_gd_van_thu = new US_GD_VAN_THU(); v_us_gd_van_thu.dcID = m_dc_id_cong_van; v_us_gd_van_thu.dcID_PHAP_NHAN = CIPConvert.ToDecimal(m_cbx_phap_nhan.SelectedValue); if (m_tcd_ngay_nhap.getValue()==null) { v_us_gd_van_thu.SetNGAY_LAPNull(); } else v_us_gd_van_thu.datNGAY_LAP = CIPConvert.ToDatetime(m_tcd_ngay_nhap.Text,"dd/MM/yyyy"); if (m_tcd_ngay_tren_cv.getValue()==null) { v_us_gd_van_thu.SetNGAY_THANG_TREN_CONG_VANNull(); } else v_us_gd_van_thu.datNGAY_THANG_TREN_CONG_VAN=CIPConvert.ToDatetime(m_tcd_ngay_tren_cv.Text,"dd/MM/yyyy"); v_us_gd_van_thu.strSO_VA_KY_HIEU = new StringBuilder(m_txt_so.Text.Trim()).Append(m_cbx_ky_hieu.Text.Trim()).ToString(); v_us_gd_van_thu.strNGUOI_KY = m_txt_nguoi_ky.Text; v_us_gd_van_thu.strTEN_LOAI_VA_TRICH_YEU_ND = m_txt_ten_loai.Text.Trim(); v_us_gd_van_thu.strNOI_NHAN = m_txt_noi_nhan.Text.Trim(); v_us_gd_van_thu.dcID_NGUOI_NHAN_BAN_LUU = CIPConvert.ToDecimal(m_cbx_ban_luu.SelectedValue); if (m_cbx_ban_luu.Text.Trim() == string.Empty) { MessageBox.Show("Bạn phải chọn Người nhận/Nơi nhận bản lưu", "Cảnh báo"); return false; } if (m_cbx_ban_luu.SelectedValue != null) { v_us_gd_van_thu.dcID_NOI_NGUOI_NHAN = CIPConvert.ToDecimal(m_cbx_ban_luu.SelectedValue); v_us_gd_van_thu.dcID_NGUOI_NHAN_BAN_LUU = CIPConvert.ToDecimal(m_cbx_ban_luu.SelectedValue); } else { v_us_gd_van_thu.SetID_NOI_NGUOI_NHANNull(); v_us_gd_van_thu.SetID_NGUOI_NHAN_BAN_LUUNull(); } v_us_gd_van_thu.strGHI_CHU = m_txt_ghi_chu.Text.Trim(); v_us_gd_van_thu.dcID_TRANG_THAI = CIPConvert.ToDecimal(m_cbx_trang_thai.SelectedValue); v_us_gd_van_thu.strNGUOI_LAP = m_txt_nguoi_nhap.Text.Trim(); if (!m_txt_file_upload.Text.Trim().Equals("")) v_us_gd_van_thu.strLINK_SCAN = v_str_save_file; else v_us_gd_van_thu.strLINK_SCAN = ""; v_us_gd_van_thu.dcID_LOAI_CONG_VAN = (m_rdb_noi_bo.Checked) ? ID_LOAI_VAN_THU.CONG_VAN_DI_NOI_BO : ID_LOAI_VAN_THU.CONG_VAN_DI_BEN_NGOAI; v_us_gd_van_thu.dcID_PHAP_NHAN = CIPConvert.ToDecimal(m_cbx_phap_nhan.SelectedValue); //Tu Dong nhay so cong van if (m_dc_id_cong_van == 0) { v_us_gd_van_thu.Insert(); //US_CM_DM_TU_DIEN v_us = new US_CM_DM_TU_DIEN(); //DS_CM_DM_TU_DIEN v_ds = new DS_CM_DM_TU_DIEN(); //v_us.FillDataset(v_ds, "where ma_tu_dien='" + m_cbx_phap_nhan.Text + "'"); //if (v_ds.CM_DM_TU_DIEN.Count > 0) //{ // string v_str_so = v_ds.Tables[0].Rows[0][CM_DM_TU_DIEN.TEN_NGAN].ToString(); // string v_str_nam = v_ds.Tables[0].Rows[0][CM_DM_TU_DIEN.TEN].ToString(); // v_str_so = CIPConvert.ToStr((CIPConvert.ToDecimal(v_str_so) + 1), "0#"); // v_us.DataRow2Me(v_ds.Tables[0].Rows[0]); // v_us.strTEN = v_str_nam; // v_us.strTEN_NGAN = v_str_so; // v_us.Update(); //} } else v_us_gd_van_thu.Update(); return true; } catch (Exception v_e) { CSystemLog_301.ExceptionHandle(v_e); return false; } }