Beispiel #1
0
        public static void load_data_to_combobox_with_query(ComboBox ip_cbo, string ip_str_value_field, string ip_str_display_field, eTAT_CA ip_e_tat_ca, string ip_query)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();
            DataTable     v_dt = new DataTable();

            v_ds.Tables.Add(v_dt);
            v_us.FillDatasetWithQuery(v_ds, ip_query);

            ip_cbo.DisplayMember = ip_str_display_field;
            ip_cbo.ValueMember   = ip_str_value_field;
            ip_cbo.DataSource    = v_ds.Tables[0];

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds.Tables[0].NewRow();
                v_dr[0] = -1;
                v_dr[1] = "---------- Hãy chọn ----------";
                v_ds.Tables[0].Rows.InsertAt(v_dr, 0);
                ip_cbo.SelectedIndex = 0;
            }
            else if (ip_e_tat_ca == eTAT_CA.TAT_CA)
            {
                DataRow v_dr = v_ds.Tables[0].NewRow();
                v_dr[0] = -1;
                v_dr[1] = "Tất cả";
                v_ds.Tables[0].Rows.InsertAt(v_dr, 0);
                ip_cbo.SelectedIndex = 0;
            }
            else
            {
                ip_cbo.SelectedIndex = 0;
            }
        }
Beispiel #2
0
        public static void gui_mail_thong_bao_cap_nhat_xu_ly_don_hang(US_V_GD_DAT_HANG_GD_LOG_DAT_HANG v_us_log, decimal v_id_nguoi_xu_ly)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from dm_mau_email where id = 16");
            string TIEU_DE  = v_ds.Tables[0].Rows[0]["TIEU_DE_MAIL"].ToString();
            string NOI_DUNG = v_ds.Tables[0].Rows[0]["NOI_DUNG_EMAIL"].ToString();
            string GUI_CC   = v_ds.Tables[0].Rows[0]["GUI_CC"].ToString();

            TIEU_DE  = TIEU_DE.Replace("MA_DON_HANG", v_us_log.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("NOI_DUNG_CAP_NHAT", v_us_log.strGHI_CHU);
            NOI_DUNG = NOI_DUNG.Replace("MA_DON_HANG", v_us_log.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("USER_NHAN_VIEN", v_us_log.strHO_TEN_USER_DAT_HANG);
            NOI_DUNG = NOI_DUNG.Replace("USER_DON_VI", v_us_log.strMA_DON_VI);
            NOI_DUNG = NOI_DUNG.Replace("USER_DIEN_THOAI", v_us_log.strDIEN_THOAI);
            NOI_DUNG = NOI_DUNG.Replace("USER_THOI_GIAN_DAT_HANG", v_us_log.datTHOI_GIAN_TAO.ToString());
            NOI_DUNG = NOI_DUNG.Replace("LOAI_DICH_VU_HO_TRO", v_us_log.strTEN_NHOM_DICH_VU_YEU_CAU);
            NOI_DUNG = NOI_DUNG.Replace("YEU_CAU_CU_THE", v_us_log.strNOI_DUNG_DAT_HANG);
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_HOAN_THANH_THUC_TE", "Chưa Có");
            NOI_DUNG = NOI_DUNG.Replace("LICH_SU_TRAO_DOI", "Hoàn thành đơn hàng chờ TM nghiệm thu");
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_MONG_MUON_SUA_XONG", v_us_log.datTHOI_DIEM_CAN_HOAN_THANH + "hoặc thời gian hoàn thành là:" + v_us_log.datTHOI_GIAN_HOAN_THANH);
            NOI_DUNG = NOI_DUNG.Replace("PHAN_HOI_CUA_DVMC", v_us_log.strPHAN_HOI_TU_DVMC);
            IPCOREUS.US_HT_NGUOI_SU_DUNG v_us_nguoi_xu_ly = new IPCOREUS.US_HT_NGUOI_SU_DUNG(v_id_nguoi_xu_ly);
            NOI_DUNG = NOI_DUNG.Replace("NGUOI_XU_LY_DON_HANG", v_us_nguoi_xu_ly.strTEN_TRUY_CAP);
            NOI_DUNG = NOI_DUNG.Replace("NGUOI_NHAN_DAT_HANG", v_us_log.strNGUOI_TAO_THAO_TAC);
            string        to_cc   = "";
            US_DUNG_CHUNG v_us_tm = new US_DUNG_CHUNG();
            DataSet       v_ds_tm = new DataSet();

            v_ds_tm.Tables.Add(new DataTable());
            v_us_tm.FillDatasetWithQuery(v_ds_tm, "SELECT HT_NGUOI_SU_DUNG.ID,HT_NGUOI_SU_DUNG.EMAIL FROM HT_NGUOI_SU_DUNG_NHOM_CHI_NHANH,HT_NGUOI_SU_DUNG WHERE HT_NGUOI_SU_DUNG_NHOM_CHI_NHANH.ID_NGUOI_SU_DUNG = HT_NGUOI_SU_DUNG.ID AND HT_NGUOI_SU_DUNG_NHOM_CHI_NHANH.ID_NHOM = 4");
            for (int i = 0; i < v_ds_tm.Tables[0].Rows.Count; i++)
            {
                if (i == 0)
                {
                    to_cc = v_ds_tm.Tables[0].Rows[i]["EMAIL"].ToString();
                }
                else
                {
                    GUI_CC += "," + v_ds_tm.Tables[0].Rows[i]["EMAIL"].ToString();
                }
            }

            try
            {
                string user_email = "*****@*****.**";
                string password   = "******";
                IPCOREUS.US_HT_NGUOI_SU_DUNG v_us_fo = new IPCOREUS.US_HT_NGUOI_SU_DUNG(v_us_log.dcID_NGUOI_TAO);
                GUI_CC += "," + v_us_fo.strEMAIL;
                HelpUtils.send_mail("Dịch Vụ Một Cửa<Hoàn tất xử lý>", user_email, password, to_cc, GUI_CC, TIEU_DE, NOI_DUNG);
            }

            catch (Exception v_e)
            {
                CSystemLog_100.ExceptionHandle(v_e);
            }
        }
Beispiel #3
0
 public static decimal GetGPA(decimal v_dc_id_sinh_vien, decimal v_dc_id_hoc_ky)
 {
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     v_us.FillDatasetWithQuery(v_ds, "SELECT * FROM dbo.fn_ket_qua_hoc_tap(" + v_dc_id_hoc_ky.ToString() + "," + v_dc_id_sinh_vien.ToString() + ")");
     return CIPConvert.ToDecimal(v_ds.Tables[0].Rows[0][0].ToString());
 }
Beispiel #4
0
 public static decimal GetDiemSo(decimal v_qua_trinh, decimal v_diem_thi, decimal v_trong_so)
 {
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     v_us.FillDatasetWithQuery(v_ds, "SELECT * FROM dbo.fn_tinh_ket_qua(" + v_qua_trinh.ToString() + "," + v_diem_thi.ToString() + "," + v_trong_so.ToString() + ")");
     return CIPConvert.ToDecimal( v_ds.Tables[0].Rows[0][0].ToString());
 }
Beispiel #5
0
 public static string GetDiemChu(decimal v_qua_trinh,decimal v_diem_thi,decimal v_trong_so)
 {
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     string v_str_query = "SELECT * FROM dbo.fn_tinh_ket_qua(" + v_qua_trinh.ToString().Replace(',', '.') + "," + v_diem_thi.ToString().Replace(',', '.') + "," + v_trong_so.ToString().Replace(',', '.') + ")";
     v_us.FillDatasetWithQuery(v_ds, v_str_query);
     return v_ds.Tables[0].Rows[0][1].ToString();
 }
Beispiel #6
0
        public static void gui_mail_huy_don_hang(US_V_GD_DAT_HANG v_us_log_gd, string v_ly_do)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from dm_mau_email where id =7");
            string TIEU_DE  = v_ds.Tables[0].Rows[0]["TIEU_DE_MAIL"].ToString();
            string NOI_DUNG = v_ds.Tables[0].Rows[0]["NOI_DUNG_EMAIL"].ToString();
            string GUI_CC   = v_ds.Tables[0].Rows[0]["GUI_CC"].ToString();

            TIEU_DE  = TIEU_DE.Replace("MA_DON_HANG", v_us_log_gd.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("MA_DON_HANG", v_us_log_gd.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("USER_NHAN_VIEN", v_us_log_gd.strHO_TEN_USER_DAT_HANG);
            NOI_DUNG = NOI_DUNG.Replace("USER_DON_VI", v_us_log_gd.strMA_DON_VI);
            NOI_DUNG = NOI_DUNG.Replace("USER_DIEN_THOAI", v_us_log_gd.strDIEN_THOAI);
            NOI_DUNG = NOI_DUNG.Replace("USER_THOI_GIAN_DAT_HANG", v_us_log_gd.datTHOI_GIAN_TAO.ToString());
            NOI_DUNG = NOI_DUNG.Replace("LOAI_DICH_VU_HO_TRO", v_us_log_gd.strTEN_YEU_CAU);
            NOI_DUNG = NOI_DUNG.Replace("YEU_CAU_CU_THE", v_us_log_gd.strNOI_DUNG_DAT_HANG);
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_HOAN_THANH_THUC_TE", "chưa có");
            NOI_DUNG = NOI_DUNG.Replace("LICH_SU_TRAO_DOI", "Vừa tiếp nhận.");
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_MONG_MUON_SUA_XONG", v_us_log_gd.datTHOI_DIEM_CAN_HOAN_THANH + " hoặc thời gian hoàn thành là:" + v_us_log_gd.datTHOI_GIAN_HOAN_THANH);
            NOI_DUNG = NOI_DUNG.Replace("PHAN_HOI_CUA_DVMC", "Đơn hàng của bạn đã bị hủy với lý do: " + v_ly_do);
            string        nguoi_xu_ly = "";
            US_DUNG_CHUNG v_us_3      = new US_DUNG_CHUNG();
            DataSet       v_ds_3      = new DataSet();

            v_ds_3.Tables.Add(new DataTable());
            v_us_3.FillDatasetWithQuery(v_ds_3, "select * from V_GD_DAT_HANG_GD_LOG_DAT_HANG where ten_nguoi_tao_thao_tac_log is not null and THAO_TAC_HET_HAN_YN ='N' and ID_DON_HANG=" + v_us_log_gd.dcID);
            for (int i = 0; i < v_ds_3.Tables[0].Rows.Count; i++)
            {
                nguoi_xu_ly += "," + v_ds_3.Tables[0].Rows[i]["TEN_NGUOI_TAO_THAO_TAC_LOG"].ToString();
            }

            NOI_DUNG = NOI_DUNG.Replace("NGUOI_XU_LY_DON_HANG", nguoi_xu_ly);
            NOI_DUNG = NOI_DUNG.Replace("NGUOI_NHAN_DAT_HANG", v_us_log_gd.strNGUOI_TAO);
            US_DUNG_CHUNG v_us_kh = new US_DUNG_CHUNG();
            DataSet       v_ds_kh = new DataSet();

            v_ds_kh.Tables.Add(new DataTable());
            v_us_kh.FillDatasetWithQuery(v_ds_kh, "select * from dm_khach_hang where id=" + v_us_log_gd.dcID_USER_NV_DAT_HANG);
            string to_cc = "";

            to_cc = v_ds_kh.Tables[0].Rows[0]["EMAIL"].ToString();

            try
            {
                string user_email = "*****@*****.**";
                string password   = "******";
                HelpUtils.send_mail("Dịch Vụ Một Cửa<Thông báo hủy đơn hàng>", user_email, password, to_cc, GUI_CC, TIEU_DE, NOI_DUNG);
            }

            catch (Exception v_e)
            {
                CSystemLog_100.ExceptionHandle(v_e);
            }
        }
Beispiel #7
0
        public static decimal GetCPA(decimal v_dc_id_sinh_vien, decimal v_dc_id_hoc_ky)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "SELECT * FROM dbo.fn_ket_qua_hoc_tap(" + v_dc_id_hoc_ky.ToString() + "," + v_dc_id_sinh_vien.ToString() + ")");
            return(CIPConvert.ToDecimal(v_ds.Tables[0].Rows[0][1].ToString()));
        }
Beispiel #8
0
        public static decimal GetDiemSo(decimal v_qua_trinh, decimal v_diem_thi, decimal v_trong_so)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "SELECT * FROM dbo.fn_tinh_ket_qua(" + v_qua_trinh.ToString() + "," + v_diem_thi.ToString() + "," + v_trong_so.ToString() + ")");
            return(CIPConvert.ToDecimal(v_ds.Tables[0].Rows[0][0].ToString()));
        }
Beispiel #9
0
        public static string GetDiemChu(decimal v_qua_trinh, decimal v_diem_thi, decimal v_trong_so)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            string v_str_query = "SELECT * FROM dbo.fn_tinh_ket_qua(" + v_qua_trinh.ToString().Replace(',', '.') + "," + v_diem_thi.ToString().Replace(',', '.') + "," + v_trong_so.ToString().Replace(',', '.') + ")";

            v_us.FillDatasetWithQuery(v_ds, v_str_query);
            return(v_ds.Tables[0].Rows[0][1].ToString());
        }
 public void display_for_ipphone(CallInfor ip_call_infor)
 {
     m_ip_call_infor = ip_call_infor;
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     v_us.FillDatasetWithQuery(v_ds, "select * from dm_khach_hang where DIEN_THOAI = '" + ip_call_infor.mobile_phone + "'");
     if (v_ds.Tables[0].Rows.Count > 0)
     {
         m_cbo_user_nhan_vien_dat_hang.SelectedValue = CIPConvert.ToDecimal(v_ds.Tables[0].Rows[0][0].ToString());
     }
     m_e_form_mode = DataEntryFormMode.InsertDataState;
     this.ShowDialog();
     m_cbo_phuong_thuc_dat_hang.SelectedValue = 183;
     // nếu đang có đơn hàng thì xử lí như thế nào
 }
Beispiel #11
0
 private bool check_du_lieu()
 {
     if (m_txt_tai_khoan.Text=="")
     {
         m_txt_output.Text = "Thông tin chưa đầy đủ";
         return false;
     }
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     v_us.FillDatasetWithQuery(v_ds, "select * from user_name where  tai_khoan='" + m_txt_tai_khoan.Text+"' and trang_thai_hsd = 7");
     if (v_ds.Tables[0].Rows.Count!=0)
     {
         m_txt_output.Text = "Tài khoản này đã tồn tại!";
         return false;
     }
     return true;
 }
Beispiel #12
0
        private void format_controll_for_each_user(decimal p)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from V_HT_PHAN_QUYEN_CHO_NHOM where id_NHOM_NGUOI_SU_DUNG=" + us_user.dcIDNhom);

            ArrayList visiblePages = ribbonControl1.TotalPageCategory.GetVisiblePages();

            foreach (RibbonPage page in visiblePages)
            {
                for (int i = 0; i < v_ds.Tables[0].Rows.Count; i++)
                {
                    if (page.Name == v_ds.Tables[0].Rows[i]["CONTROL_NAME"].ToString())
                    {
                        page.Visible = true;
                        break;
                    }
                    else
                    {
                        page.Visible = false;
                    }
                }
            }
            if (us_user.dcIDNhom == 1 || us_user.dcIDNhom == 5)
            {
                m_rib_dm_cau_hoi.Visible = true;
            }
            else
            {
                m_rib_dm_cau_hoi.Visible = false;
            }

            if (us_user.dcIDNhom != 3 && us_user.dcIDNhom != 5)
            {
                m_barsubitem_tao_moi_user.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            }
            if (us_user.dcID != 134 && us_user.dcID != 141)
            {
                m_rib_dm_email.Visible  = false;
                m_rib_blacklist.Visible = false;
            }
        }
Beispiel #13
0
        private bool check_du_lieu()
        {
            if (m_txt_tai_khoan.Text == "")
            {
                m_txt_output.Text = "Thông tin chưa đầy đủ";
                return(false);
            }
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from user_name where  tai_khoan='" + m_txt_tai_khoan.Text + "' and trang_thai_hsd = 7");
            if (v_ds.Tables[0].Rows.Count != 0)
            {
                m_txt_output.Text = "Tài khoản này đã tồn tại!";
                return(false);
            }
            return(true);
        }
Beispiel #14
0
        public static void gui_mail_thong_bao_chuyen_don_hang(US_V_GD_DAT_HANG_GD_LOG_DAT_HANG v_us_log_gd, decimal v_id_nguoi_xu_ly, decimal v_id_nguoi_nhan)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from dm_mau_email where id =10");
            string TIEU_DE  = v_ds.Tables[0].Rows[0]["TIEU_DE_MAIL"].ToString();
            string NOI_DUNG = v_ds.Tables[0].Rows[0]["NOI_DUNG_EMAIL"].ToString();
            string GUI_CC   = v_ds.Tables[0].Rows[0]["GUI_CC"].ToString();

            TIEU_DE  = TIEU_DE.Replace("MA_DON_HANG", v_us_log_gd.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("MA_DON_HANG", v_us_log_gd.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("USER_NHAN_VIEN", v_us_log_gd.strHO_TEN_USER_DAT_HANG);
            NOI_DUNG = NOI_DUNG.Replace("USER_DON_VI", v_us_log_gd.strMA_DON_VI);
            NOI_DUNG = NOI_DUNG.Replace("USER_DIEN_THOAI", v_us_log_gd.strDIEN_THOAI);
            NOI_DUNG = NOI_DUNG.Replace("USER_THOI_GIAN_DAT_HANG", v_us_log_gd.datTHOI_GIAN_TAO.ToString());
            NOI_DUNG = NOI_DUNG.Replace("LOAI_DICH_VU_HO_TRO", v_us_log_gd.strTEN_NHOM_DICH_VU_YEU_CAU);
            NOI_DUNG = NOI_DUNG.Replace("YEU_CAU_CU_THE", v_us_log_gd.strNOI_DUNG_DAT_HANG);
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_HOAN_THANH_THUC_TE", "chưa có");
            NOI_DUNG = NOI_DUNG.Replace("LICH_SU_TRAO_DOI", "Vừa tiếp nhận.");
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_MONG_MUON_SUA_XONG", v_us_log_gd.datTHOI_DIEM_CAN_HOAN_THANH + "hoặc thời gian hoàn thành là:" + v_us_log_gd.datTHOI_GIAN_HOAN_THANH);
            NOI_DUNG = NOI_DUNG.Replace("PHAN_HOI_CUA_DVMC", v_us_log_gd.strPHAN_HOI_TU_DVMC);
            IPCOREUS.US_HT_NGUOI_SU_DUNG v_us_nguoi_xu_ly = new IPCOREUS.US_HT_NGUOI_SU_DUNG(v_id_nguoi_xu_ly);
            NOI_DUNG = NOI_DUNG.Replace("NGUOI_XU_LY_DON_HANG", v_us_nguoi_xu_ly.strTEN_TRUY_CAP);
            NOI_DUNG = NOI_DUNG.Replace("NGUOI_NHAN_DAT_HANG", v_us_log_gd.strNGUOI_TAO_THAO_TAC);
            IPCOREUS.US_HT_NGUOI_SU_DUNG v_us_nguoi_nhan = new IPCOREUS.US_HT_NGUOI_SU_DUNG(v_id_nguoi_nhan);
            string to_cc = v_us_nguoi_nhan.strEMAIL;

            try
            {
                string user_email = "*****@*****.**";
                string password   = "******";
                IPCOREUS.US_HT_NGUOI_SU_DUNG v_us_fo = new IPCOREUS.US_HT_NGUOI_SU_DUNG(v_us_log_gd.dcID_NGUOI_TAO);
                GUI_CC += "," + v_us_fo.strEMAIL;
                HelpUtils.send_mail("Dịch Vụ Một Cửa", user_email, password, to_cc, GUI_CC, TIEU_DE, NOI_DUNG);
            }
            catch (Exception v_e)
            {
                CSystemLog_100.ExceptionHandle(v_e);
            }
        }
Beispiel #15
0
        public static void phan_quyen_user(Control m_form)
        {
            List<Control> v_list = new List<Control>();
            GetAllControls(m_form,v_list);

            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from phan_quyen_nhom_user where trang_thai_hsd=7 and id_nhom =" + User.id_nhom);

            foreach (Control control in v_list)
            {

                    for (int i = 0; i < v_ds.Tables[0].Rows.Count; i++)
                    {
                        if (control.Name == v_ds.Tables[0].Rows[i]["CONTROL"].ToString())
                        {
                            control.Visible = false;
                        }
                    }

            }
        }
Beispiel #16
0
        public static void phan_quyen_user(Control m_form)
        {
            List <Control> v_list = new List <Control>();

            GetAllControls(m_form, v_list);

            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from phan_quyen_nhom_user where trang_thai_hsd=7 and id_nhom =" + User.id_nhom);

            foreach (Control control in v_list)
            {
                for (int i = 0; i < v_ds.Tables[0].Rows.Count; i++)
                {
                    if (control.Name == v_ds.Tables[0].Rows[i]["CONTROL"].ToString())
                    {
                        control.Visible = false;
                    }
                }
            }
        }
Beispiel #17
0
        private void phan_quyen_user(decimal id_nhom)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet       v_ds = new DataSet();

            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from phan_quyen_nhom_user where trang_thai_hsd=7 and id_nhom =" + id_nhom);

            ArrayList visiblePages = m_rib_main.TotalPageCategory.GetVisiblePages();

            foreach (RibbonPage page in visiblePages)
            {
                for (int i = 0; i < v_ds.Tables[0].Rows.Count; i++)
                {
                    if (page.Name == v_ds.Tables[0].Rows[i]["CONTROL"].ToString())
                    {
                        page.Visible = false;
                        break;
                    }
                    else
                    {
                        page.Visible = true;
                    }
                }
            }
            //fix code -> nhục
            if (User.id_nhom == 3)
            {
                RibbonPageGroup group = m_rib_main.GetGroupByName("m_rib_xu_ly_diem");
                group.Visible = false;
            }
            else if (User.id_nhom == 2)
            {
                RibbonPageGroup group = m_rib_main.GetGroupByName("m_rib_quan_ly_diem_thi");
                group.Visible = false;
            }
        }
Beispiel #18
0
        public static void load_data_to_combobox_with_query(ComboBox ip_cbo, string ip_str_value_field, string ip_str_display_field, eTAT_CA ip_e_tat_ca, string ip_query)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            DataTable v_dt = new DataTable();
            v_ds.Tables.Add(v_dt);
            v_us.FillDatasetWithQuery(v_ds, ip_query);

            ip_cbo.DisplayMember = ip_str_display_field;
            ip_cbo.ValueMember = ip_str_value_field;
            ip_cbo.DataSource = v_ds.Tables[0];

            if (ip_e_tat_ca == eTAT_CA.YES)
            {
                DataRow v_dr = v_ds.Tables[0].NewRow();
                v_dr[0] = -1;
                v_dr[1] = "------ Tất cả ------";
                v_ds.Tables[0].Rows.InsertAt(v_dr, 0);
                ip_cbo.SelectedIndex = 0;
            }
            else
            {
                ip_cbo.SelectedIndex = 0;
            }
        }
Beispiel #19
0
        private void phan_quyen_user(decimal id_nhom)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from phan_quyen_nhom_user where trang_thai_hsd=7 and id_nhom =" + id_nhom);

            ArrayList visiblePages = m_rib_main.TotalPageCategory.GetVisiblePages();

            foreach (RibbonPage page in visiblePages)
            {

                for (int i = 0; i < v_ds.Tables[0].Rows.Count; i++)
                {
                    if (page.Name == v_ds.Tables[0].Rows[i]["CONTROL"].ToString())
                    {

                        page.Visible = false;
                        break;
                    }
                    else page.Visible = true;
                }
            }
            //fix code -> nhục
            if (User.id_nhom == 3)
            {
                RibbonPageGroup group = m_rib_main.GetGroupByName("m_rib_xu_ly_diem");
                group.Visible = false;
            }
            else if (User.id_nhom==2)
            {
                 RibbonPageGroup group = m_rib_main.GetGroupByName("m_rib_quan_ly_diem_thi");
                group.Visible = false;
            }
        }
        private void gui_emai_xac_nhan(US_GD_DAT_HANG m_us)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from dm_mau_email where id =10");
            string TIEU_DE = v_ds.Tables[0].Rows[0]["TIEU_DE_MAIL"].ToString();
            string NOI_DUNG = v_ds.Tables[0].Rows[0]["NOI_DUNG_EMAIL"].ToString();
            string GUI_CC = v_ds.Tables[0].Rows[0]["GUI_CC"].ToString();

            TIEU_DE = TIEU_DE.Replace("MA_DON_HANG", m_us.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("MA_DON_HANG", m_us.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("USER_NHAN_VIEN", m_txt_ho_ten_nguoi_dat_hang.Text);
            NOI_DUNG = NOI_DUNG.Replace("USER_DON_VI", m_cbo_dv_don_vi.Text);
            NOI_DUNG = NOI_DUNG.Replace("USER_DIEN_THOAI", m_txt_dien_thoai.Text);
            NOI_DUNG = NOI_DUNG.Replace("USER_THOI_GIAN_DAT_HANG", m_us.datTHOI_GIAN_TAO.ToString());
            NOI_DUNG = NOI_DUNG.Replace("LOAI_DICH_VU_HO_TRO", m_cbo_dich_vu.Text);
            NOI_DUNG = NOI_DUNG.Replace("YEU_CAU_CU_THE", m_txt_yeu_cau_cu_the.Text);
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_HOAN_THANH_THUC_TE", "chưa có");
            NOI_DUNG = NOI_DUNG.Replace("LICH_SU_TRAO_DOI", "Vừa tiếp nhận.");
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_MONG_MUON_SUA_XONG", m_dat_thoi_diem_can_hoan_thanh.Text + "hoặc thời gian hoàn thành là:" + m_cbo_thoi_gian_hoan_thanh.Text);
            NOI_DUNG = NOI_DUNG.Replace("PHAN_HOI_CUA_DVMC", m_txt_phan_hoi_tu_dvmc.Text);
            string nguoi_xu_ly = "";

            for (int i = 0; i < m_lst_id_nguoi_xu_ly.Count; i++)
            {
                US_DUNG_CHUNG v_us_2 = new US_DUNG_CHUNG();
                DataSet v_ds_2 = new DataSet();
                v_ds_2.Tables.Add(new DataTable());
                v_us_2.FillDatasetWithQuery(v_ds_2, "select * from ht_nguoi_su_dung where id=" + m_lst_id_nguoi_xu_ly[i]);
                nguoi_xu_ly += v_ds_2.Tables[0].Rows[0]["TEN_TRUY_CAP"].ToString() + " , ";
            }
            NOI_DUNG = NOI_DUNG.Replace("NGUOI_XU_LY_DON_HANG", nguoi_xu_ly);
            NOI_DUNG = NOI_DUNG.Replace("NGUOI_NHAN_DAT_HANG", m_cbo_nguoi_nhan_dat_hang.Text);
            US_DUNG_CHUNG v_us_1 = new US_DUNG_CHUNG();
            DataSet v_ds_1 = new DataSet();
            v_ds_1.Tables.Add(new DataTable());
            v_us_1.FillDatasetWithQuery(v_ds_1, "select * from dm_khach_hang where id=" + m_us.dcID_USER_NV_DAT_HANG);
            string to_cc = "";
            to_cc = v_ds_1.Tables[0].Rows[0]["EMAIL"].ToString();
            try
            {
                Mail.sendEmail(user_email, password, to_cc, TIEU_DE, NOI_DUNG);

            }

            catch (Exception v_e)
            {

                CSystemLog_301.ExceptionHandle(v_e);
            }
        }
        private void gui_mail_cap_nhat_deadline()
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from dm_mau_email where id =11");
            string TIEU_DE = v_ds.Tables[0].Rows[0]["TIEU_DE_MAIL"].ToString();
            string NOI_DUNG = v_ds.Tables[0].Rows[0]["NOI_DUNG_EMAIL"].ToString();
            string GUI_CC = v_ds.Tables[0].Rows[0]["GUI_CC"].ToString();

            TIEU_DE = TIEU_DE.Replace("MA_DON_HANG", m_us.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("MA_DON_HANG", m_us.strMA_DON_HANG);
            NOI_DUNG = NOI_DUNG.Replace("USER_NHAN_VIEN", m_txt_ho_ten_nguoi_dat_hang.Text);
            NOI_DUNG = NOI_DUNG.Replace("USER_DON_VI", m_cbo_dv_don_vi.Text);
            NOI_DUNG = NOI_DUNG.Replace("USER_DIEN_THOAI", m_txt_dien_thoai.Text);
            NOI_DUNG = NOI_DUNG.Replace("USER_THOI_GIAN_DAT_HANG", m_us.datTHOI_GIAN_TAO.ToString());
            NOI_DUNG = NOI_DUNG.Replace("LOAI_DICH_VU_HO_TRO", m_cbo_dich_vu.Text);
            NOI_DUNG = NOI_DUNG.Replace("YEU_CAU_CU_THE", m_txt_yeu_cau_cu_the.Text);
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_HOAN_THANH_THUC_TE", "chưa có");
            NOI_DUNG = NOI_DUNG.Replace("LICH_SU_TRAO_DOI", "Vừa tiếp nhận.");
            NOI_DUNG = NOI_DUNG.Replace("THOI_GIAN_MONG_MUON_SUA_XONG", m_dat_thoi_diem_can_hoan_thanh.Text);
            NOI_DUNG = NOI_DUNG.Replace("PHAN_HOI_CUA_DVMC", m_txt_phan_hoi_tu_dvmc.Text);
            string nguoi_xu_ly = "";
            US_DUNG_CHUNG v_us_3 = new US_DUNG_CHUNG();
            DataSet v_ds_3 = new DataSet();
            v_ds_3.Tables.Add(new DataTable());
            v_us_3.FillDatasetWithQuery(v_ds_3, "select * from V_GD_DAT_HANG_GD_LOG_DAT_HANG where ten_nguoi_tao_thao_tac_log is not null and THAO_TAC_HET_HAN_YN ='N' and ID_DON_HANG=" + m_us.dcID);
            for (int i = 0; i < v_ds_3.Tables[0].Rows.Count; i++)
            {
                nguoi_xu_ly += "," + v_ds_3.Tables[0].Rows[i]["TEN_NGUOI_TAO_THAO_TAC_LOG"].ToString();
            }

            NOI_DUNG = NOI_DUNG.Replace("NGUOI_XU_LY_DON_HANG", nguoi_xu_ly);
            NOI_DUNG = NOI_DUNG.Replace("NGUOI_NHAN_DAT_HANG", m_cbo_nguoi_nhan_dat_hang.Text);
            US_DUNG_CHUNG v_us_1 = new US_DUNG_CHUNG();
            DataSet v_ds_1 = new DataSet();
            v_ds_1.Tables.Add(new DataTable());
            v_us_1.FillDatasetWithQuery(v_ds_1, "select * from dm_khach_hang where id=" + m_us.dcID_USER_NV_DAT_HANG);
            string to_cc = "";
            to_cc = v_ds_1.Tables[0].Rows[0]["EMAIL"].ToString();

            try
            {
                Mail.sendEmail(user_email, password, to_cc, TIEU_DE, NOI_DUNG);

            }

            catch (Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
            }
        }
 private void load_data_2_grid_khach_hang_don_hang()
 {
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     v_us.FillDatasetWithQuery(v_ds, "select * from V_DON_HANG_TRANG_THAI where ID_USER_NV_DAT_HANG =" + m_cbo_user_nhan_vien_dat_hang.SelectedValue.ToString() + "order by THOI_GIAN_TAO");
     m_grc_user_don_hang.DataSource = v_ds.Tables[0];
 }
 private void load_data_to_lich_su_thuc_hien()
 {
     US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
     DataSet v_ds = new DataSet();
     v_ds.Tables.Add(new DataTable());
     v_us.FillDatasetWithQuery(v_ds, "select * from v_GD_DAT_HANG_GD_LOG_DAT_HANG where ID_DON_HANG=" + m_us.dcID.ToString() + "order by NGAY_LAP_THAO_TAC DESC");
     m_grc_lich_su_thuc_hien.DataSource = v_ds.Tables[0];
 }
Beispiel #24
0
        private void format_controll_for_each_user(decimal p)
        {
            US_DUNG_CHUNG v_us = new US_DUNG_CHUNG();
            DataSet v_ds = new DataSet();
            v_ds.Tables.Add(new DataTable());
            v_us.FillDatasetWithQuery(v_ds, "select * from V_HT_PHAN_QUYEN_CHO_NHOM where id_NHOM_NGUOI_SU_DUNG=" + us_user.dcIDNhom);

            ArrayList visiblePages = ribbonControl1.TotalPageCategory.GetVisiblePages();

            foreach (RibbonPage page in visiblePages)
            {
                for (int i = 0; i < v_ds.Tables[0].Rows.Count; i++)
                {
                    if (page.Name == v_ds.Tables[0].Rows[i]["CONTROL_NAME"].ToString())
                    {

                        page.Visible = true;
                        break;
                    }
                    else page.Visible = false;
                }
            }
            if (us_user.dcIDNhom == 1 || us_user.dcIDNhom == 5)
            {
                m_rib_dm_cau_hoi.Visible = true;

            }
            else m_rib_dm_cau_hoi.Visible = false;

            if (us_user.dcIDNhom != 3 && us_user.dcIDNhom != 5)
            {
                m_barsubitem_tao_moi_user.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            }
            if (us_user.dcID != 134 && us_user.dcID != 141)
            {
                m_rib_dm_email.Visible = false;
                m_rib_blacklist.Visible = false;
            }
        }