예제 #1
0
 private void load_data_2_grid()
 {
     m_ds = new DS_HT_USER_GROUP();
     m_us.FillDataset(m_ds);
     m_fg.Redraw = false;
     CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
     m_fg.Redraw = true;
 }
 public US_HT_USER_GROUP(decimal i_dbID)
 {
     pm_objDS = new DS_HT_USER_GROUP();
     pm_strTableName = c_TableName;
     IMakeSelectCmd v_objMkCmd = new CMakeAndSelectCmd(pm_objDS, c_TableName);
     v_objMkCmd.AddCondition("ID", i_dbID, eKieuDuLieu.KieuNumber, eKieuSoSanh.Bang);
     SqlCommand v_cmdSQL;
     v_cmdSQL = v_objMkCmd.getSelectCmd();
     this.FillDatasetByCommand(pm_objDS, v_cmdSQL);
     pm_objDR = getRowClone(pm_objDS.Tables[pm_strTableName].Rows[0]);
 }
예제 #3
0
        public US_HT_USER_GROUP(decimal i_dbID)
        {
            pm_objDS        = new DS_HT_USER_GROUP();
            pm_strTableName = c_TableName;
            IMakeSelectCmd v_objMkCmd = new CMakeAndSelectCmd(pm_objDS, c_TableName);

            v_objMkCmd.AddCondition("ID", i_dbID, eKieuDuLieu.KieuNumber, eKieuSoSanh.Bang);
            SqlCommand v_cmdSQL;

            v_cmdSQL = v_objMkCmd.getSelectCmd();
            this.FillDatasetByCommand(pm_objDS, v_cmdSQL);
            pm_objDR = getRowClone(pm_objDS.Tables[pm_strTableName].Rows[0]);
        }
예제 #4
0
        private void load_data_2_cbo_nhom_nguoi_dung()
        {
            //US_HT_NHOM_NGUOI_SU_DUNG v_us_nhom_nguoi_dung = new US_HT_NHOM_NGUOI_SU_DUNG();
            //DS_HT_NHOM_NGUOI_SU_DUNG v_ds_nhom_nguoi_dung = new DS_HT_NHOM_NGUOI_SU_DUNG();
            //v_us_nhom_nguoi_dung.FillDataset(v_ds_nhom_nguoi_dung);
            //v_ds_nhom_nguoi_dung.EnforceConstraints = false;
            US_HT_USER_GROUP v_us_nhom_nguoi_dung = new US_HT_USER_GROUP();
            DS_HT_USER_GROUP v_ds_nhom_nguoi_dung = new DS_HT_USER_GROUP();

            v_us_nhom_nguoi_dung.FillDataset(v_ds_nhom_nguoi_dung);
            v_ds_nhom_nguoi_dung.EnforceConstraints = false;
            m_cbo_nhom_quyen.ValueMember            = HT_USER_GROUP.ID;
            m_cbo_nhom_quyen.DisplayMember          = HT_USER_GROUP.USER_GROUP_NAME;
            m_cbo_nhom_quyen.DataSource             = v_ds_nhom_nguoi_dung.HT_USER_GROUP;
        }
예제 #5
0
 private void load_cbo_user_group()
 {
     try
     {
         US_HT_USER_GROUP v_us_user_group = new US_HT_USER_GROUP();
         DS_HT_USER_GROUP v_ds_user_group = new DS_HT_USER_GROUP();
         v_us_user_group.FillDataset(v_ds_user_group);
         m_cbo_user_group.DataSource     = v_ds_user_group.HT_USER_GROUP;
         m_cbo_user_group.DataTextField  = HT_USER_GROUP.USER_GROUP_NAME;
         m_cbo_user_group.DataValueField = CM_DM_LOAI_TD.ID;
         m_cbo_user_group.DataBind();
     }
     catch (Exception v_e)
     {
         throw v_e;
     }
 }
 private bool check_txt_mail()
 {
     US_HT_USER_GROUP v_us_user_group = new US_HT_USER_GROUP();
     DS_HT_USER_GROUP v_ds_user_group = new DS_HT_USER_GROUP();
     string v_ten_mail = m_txt_nhap_mail.Text.Trim() + "@topica.edu.vn";
     if (m_txt_nhap_mail.Text == "")
         return false;
     else
     {
         v_us_user_group.Check_have_mail(v_ds_user_group, v_ten_mail);
         if (v_ds_user_group.HT_USER_GROUP.Rows.Count > 0)
             return true;
         else
             return false;
     }
 }
 private void load_data_2_cbo_nhom_nguoi_dung()
 {
     //US_HT_NHOM_NGUOI_SU_DUNG v_us_nhom_nguoi_dung = new US_HT_NHOM_NGUOI_SU_DUNG();
     //DS_HT_NHOM_NGUOI_SU_DUNG v_ds_nhom_nguoi_dung = new DS_HT_NHOM_NGUOI_SU_DUNG();
     //v_us_nhom_nguoi_dung.FillDataset(v_ds_nhom_nguoi_dung);
     //v_ds_nhom_nguoi_dung.EnforceConstraints = false;
     US_HT_USER_GROUP v_us_nhom_nguoi_dung = new US_HT_USER_GROUP();
     DS_HT_USER_GROUP v_ds_nhom_nguoi_dung = new DS_HT_USER_GROUP();
     v_us_nhom_nguoi_dung.FillDataset(v_ds_nhom_nguoi_dung);
     v_ds_nhom_nguoi_dung.EnforceConstraints = false;
     m_cbo_nhom_quyen.ValueMember = HT_USER_GROUP.ID;
     m_cbo_nhom_quyen.DisplayMember = HT_USER_GROUP.USER_GROUP_NAME;
     m_cbo_nhom_quyen.DataSource = v_ds_nhom_nguoi_dung.HT_USER_GROUP;
 }
 private void load_cbo_user_group_grv()
 {
     try
     {
         US_HT_USER_GROUP v_us_user_group = new US_HT_USER_GROUP();
         DS_HT_USER_GROUP v_ds_user_group = new DS_HT_USER_GROUP();
         v_us_user_group.FillDataset(v_ds_user_group);
         m_cbo_user_group_on_grid.DataSource = v_ds_user_group.HT_USER_GROUP;
         m_cbo_user_group_on_grid.DataTextField = HT_USER_GROUP.USER_GROUP_NAME;
         m_cbo_user_group_on_grid.DataValueField = CM_DM_LOAI_TD.ID;
         m_cbo_user_group_on_grid.DataBind();
     }
     catch (Exception v_e)
     {
         throw v_e;
     }
 }
예제 #9
0
 private void load_data_2_grid()
 {
     m_ds = new DS_HT_USER_GROUP();
     m_us.FillDataset(m_ds);
     m_fg.Redraw = false;
     CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
     m_fg.Redraw = true;
 }
    private bool check_validate_grid_is_ok()
    {
        bool v_b_result = true;
        if (Session[SESSION.UserID] == null)
        {
            Response.Redirect("/QuanLyHanhChinh/Default.aspx", false);
        }
        decimal v_dc_id_user = CIPConvert.ToDecimal(Session[SESSION.UserID]);
        US_HT_NGUOI_SU_DUNG v_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG(v_dc_id_user);
        US_HT_USER_GROUP v_us_ht_user_group = new US_HT_USER_GROUP(v_us_ht_nguoi_su_dung.dcID_USER_GROUP);
        DS_HT_USER_GROUP v_ds_ht_user_group = new DS_HT_USER_GROUP();
        US_HT_QUAN_HE_SU_DUNG_DU_LIEU v_us_ht_quan_he_su_dung_du_lieu = new US_HT_QUAN_HE_SU_DUNG_DU_LIEU();
        string v_str_ma_phong_ban = v_us_ht_quan_he_su_dung_du_lieu.get_all_ma_phong_ban_by_id_user_group(v_us_ht_user_group.dcID);

        System.Drawing.Color v_color_alert = System.Drawing.Color.LightGreen;
        System.Drawing.Color v_color_alert_message = System.Drawing.Color.Green;
        System.Drawing.Color v_color_ok = System.Drawing.Color.Blue;
        System.Drawing.Color v_color_dangerous = System.Drawing.Color.LightPink;
        System.Drawing.Color v_color_dangerous_message = System.Drawing.Color.Red;
        System.Drawing.Color v_color_normal = System.Drawing.Color.White;

        GridViewRow[] v_arr_gvr = new GridViewRow[m_grv_dm_bill.Rows.Count];
        m_grv_dm_bill.Rows.CopyTo(v_arr_gvr, 0);
        for (int i = 0; i < v_arr_gvr.Length; i++)
        {
            System.Web.UI.WebControls.TextBox v_txt_so_bill = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_so_bill_grid");

            System.Web.UI.WebControls.TextBox v_txt_ma_phong_ban = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_ma_phong_ban_grid");
            System.Web.UI.WebControls.TextBox v_txt_nguoi_nhan = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_nguoi_nhan_grid");
            System.Web.UI.WebControls.TextBox v_txt_nguoi_gui = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_nguoi_gui_grid");
            System.Web.UI.WebControls.TextBox v_txt_noi_nhan = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_noi_nhan_grid");
            System.Web.UI.WebControls.TextBox v_txt_noi_dung_gui = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_noi_dung_grid");

            //System.Web.UI.WebControls.Label v_lbl_so_bill_message = (System.Web.UI.WebControls.Label)v_arr_gvr[i].FindControl("m_lbl_so_bill_message");
            //System.Web.UI.WebControls.Label v_lbl_ma_phong_ban_message = (System.Web.UI.WebControls.Label)v_arr_gvr[i].FindControl("m_lbl_ma_phong_ban_message");
            //System.Web.UI.WebControls.Label v_lbl_nguoi_nhan_message = (System.Web.UI.WebControls.Label)v_arr_gvr[i].FindControl("m_lbl_nguoi_nhan_message");
            //System.Web.UI.WebControls.Label v_lbl_nguoi_gui_message = (System.Web.UI.WebControls.Label)v_arr_gvr[i].FindControl("m_lbl_nguoi_gui_message");
            //System.Web.UI.WebControls.Label v_lbl_noi_nhan_message = (System.Web.UI.WebControls.Label)v_arr_gvr[i].FindControl("m_lbl_noi_nhan_message");
            //System.Web.UI.WebControls.Label v_lbl_noi_dung_gui_message = (System.Web.UI.WebControls.Label)v_arr_gvr[i].FindControl("m_lbl_noi_dung_message");
            // check so bill
            if (!v_txt_so_bill.Text.Equals("") && check_validate_is_having_so_bill(v_txt_so_bill.Text.Trim()))
            {
                v_txt_so_bill.BackColor = v_color_normal;
                v_txt_so_bill.ToolTip = "Đã có dữ liệu. Click nếu muốn thay đổi";
                //v_lbl_so_bill_message.Text = "Dữ liệu hợp lý!";
                //v_lbl_so_bill_message.ForeColor = v_color_ok;
                //v_lbl_so_bill_message.Font.Bold = true;
            }
            else
            {
                v_txt_so_bill.BackColor = v_color_alert;
                //v_lbl_so_bill_message.Text = "Số bill đã tồn tại hoặc đang để trống!";
                v_txt_so_bill.ToolTip = "Số bill đã tồn tại hoặc đang để trống! Click để thêm hoặc chỉnh sửa";
                //v_lbl_so_bill_message.ForeColor = v_color_dangerous_message;
                //v_lbl_so_bill_message.Font.Bold = true;
                v_b_result = false;
            }
            ////check ma phong ban
            //if(!v_txt_ma_phong_ban.Text.Equals("") && v_str_ma_phong_ban.Contains(v_txt_ma_phong_ban.Text.Trim().ToUpper())) {
            //    v_txt_ma_phong_ban.BackColor = v_color_normal;
            //    v_lbl_ma_phong_ban_message.Text = "Dữ liệu hợp lý!";
            //    v_lbl_ma_phong_ban_message.ForeColor = v_color_ok;
            //    v_lbl_ma_phong_ban_message.Font.Bold = true;
            //}
            //else {
            //    v_txt_ma_phong_ban.BackColor = v_color_dangerous;
            //    v_lbl_ma_phong_ban_message.Text = "Bạn chỉ được nhập bill của phòng: "+v_str_ma_phong_ban+" !";
            //    v_lbl_ma_phong_ban_message.ForeColor = v_color_dangerous_message;
            //    v_lbl_ma_phong_ban_message.Font.Bold = true;
            //    v_b_result = false;
            //}
            //check nguoi gui
            if (!v_txt_nguoi_gui.Text.Equals(""))
            {
                v_txt_nguoi_gui.BackColor = v_color_normal;
                v_txt_nguoi_gui.ToolTip = "Dã có dữ liệu. Click nếu muốn thay đổi";
                //v_lbl_nguoi_gui_message.Text = "Dữ liệu hợp lý!";
                //v_lbl_nguoi_gui_message.ForeColor = v_color_ok;
                //v_lbl_nguoi_gui_message.Font.Bold = true;
            }
            else
            {
                v_txt_nguoi_gui.BackColor = v_color_dangerous;
                //v_lbl_nguoi_gui_message.Text = "Bạn phải nhập người gửi!";
                v_txt_nguoi_gui.ToolTip = "Bạn phải nhập người gửi";
                //v_lbl_nguoi_gui_message.ForeColor = v_color_dangerous_message;
                //v_lbl_nguoi_gui_message.Font.Bold = true;
                v_b_result = false;
            }
            //check so nguoi nhan
            if (!v_txt_nguoi_nhan.Text.Equals(""))
            {
                v_txt_nguoi_nhan.BackColor = v_color_normal;
                v_txt_nguoi_nhan.ToolTip = "Đã có dữ liệu. Click nếu muốn thay đổi";
                //v_lbl_nguoi_nhan_message.Text = "Dữ liệu hợp lý!";
                //v_lbl_nguoi_nhan_message.ForeColor = v_color_ok;
                //v_lbl_nguoi_nhan_message.Font.Bold = true;
            }
            else
            {
                v_txt_nguoi_nhan.BackColor = v_color_dangerous;
                //v_lbl_nguoi_nhan_message.Text = "Bạn phải nhập người nhận!";
                v_txt_noi_nhan.ToolTip = "Bạn phải nhập người nhận";
                //v_lbl_nguoi_nhan_message.ForeColor = v_color_dangerous_message;
                //v_lbl_nguoi_nhan_message.Font.Bold = true;
                v_b_result = false;
            }
            //check so noi nhan
            if (!v_txt_noi_nhan.Text.Equals(""))
            {
                v_txt_noi_nhan.BackColor = v_color_normal;
                v_txt_noi_nhan.ToolTip = "Đã có dữ liệu. Click nếu muốn thay đổi";
                //v_lbl_noi_nhan_message.Text = "Dữ liệu hợp lý!";
                //v_lbl_noi_nhan_message.ForeColor = v_color_ok; ;
                //v_lbl_noi_nhan_message.Font.Bold = true;
            }
            else
            {
                v_txt_noi_nhan.BackColor = v_color_dangerous;
                //v_lbl_noi_nhan_message.Text = "Bạn phải nhập nơi nhận!";
                v_txt_noi_nhan.ToolTip = "Bạn phải nhập người gửi";
                //v_lbl_noi_nhan_message.ForeColor = v_color_dangerous_message;
                //v_lbl_noi_nhan_message.Font.Bold = true;
                v_b_result = false;
            }
            ////check so noi dung gui
            //if (!v_txt_noi_dung_gui.Text.Equals(""))
            //{
            //    v_txt_noi_dung_gui.BackColor = v_color_normal;
            //    v_lbl_noi_dung_gui_message.Text = "Dữ liệu hợp lý!";
            //    v_lbl_noi_dung_gui_message.ForeColor = v_color_ok; ;
            //    v_lbl_noi_dung_gui_message.Font.Bold = true;
            //}
            //else
            //{
            //    v_txt_noi_dung_gui.BackColor = v_color_alert;
            //    v_lbl_noi_dung_gui_message.Text = "Bạn phải nên nhập nội dung gửi!";
            //    v_lbl_noi_dung_gui_message.ForeColor = v_color_alert_message;
            //    v_lbl_noi_dung_gui_message.Font.Bold = true;
            //}
        }
        return v_b_result;
    }
예제 #11
0
 public void Check_have_mail(DS_HT_USER_GROUP v_ds_user_group, string v_ten_mail)
 {
     CStoredProc v_stored_proc = new CStoredProc("pr_Check_have_mail");
     v_stored_proc.addNVarcharInputParam("@MAIL", v_ten_mail);
     v_stored_proc.fillDataSetByCommand(this, v_ds_user_group);
 }
 private void load_cbo_user_group()
 {
     US_HT_USER_GROUP v_us_user_group = new US_HT_USER_GROUP();
         DS_HT_USER_GROUP v_ds_user_group = new DS_HT_USER_GROUP();
         v_us_user_group.FillDataset(v_ds_user_group);
         m_cbo_user_group.DataSource = v_ds_user_group.HT_USER_GROUP;
         m_cbo_user_group.DataTextField = HT_USER_GROUP.USER_GROUP_NAME;
         m_cbo_user_group.DataValueField = CM_DM_LOAI_TD.ID;
         m_cbo_user_group.DataBind();
 }
 private bool gui_mail_thong_bao_cho_td()
 {
     string v_user_group_name = "TD_" + m_hdf_ma_trung_tam.Value.ToUpper();
     US_HT_USER_GROUP v_us_user_group = new US_HT_USER_GROUP();
     DS_HT_USER_GROUP v_ds_user_group = new DS_HT_USER_GROUP();
     v_us_user_group.FillDataset(v_ds_user_group, "where USER_GROUP_NAME = '" + v_user_group_name + "' or USER_GROUP_NAME= '" + v_user_group_name + "-TU'");
     if (v_ds_user_group.HT_USER_GROUP.Rows.Count > 0)
     {
         decimal v_id_user_group = CIPConvert.ToDecimal(v_ds_user_group.HT_USER_GROUP.Rows[0]["ID"]);
         US_HT_NGUOI_SU_DUNG v_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
         IP.Core.IPData.DS_HT_NGUOI_SU_DUNG v_ds_ht_nguoi_su_dung = new IP.Core.IPData.DS_HT_NGUOI_SU_DUNG();
         v_us_ht_nguoi_su_dung.FillDataset(v_ds_ht_nguoi_su_dung, "where ID_USER_GROUP =" + v_id_user_group);
         string v_mail = v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0]["MAIL"].ToString();
         string v_str_noi_dung = "Kính gửi: Trưởng phòng " + " " + m_hdf_ma_trung_tam.Value
                                 + "\n"
                                 + "Vui lòng truy cập vào đường link bên dưới để duyệt đơn hàng VPP. Xin cám ơn!"
                                 + "\n"
                                 + "http://trm.topica.edu.vn/QuanLyHanhChinh/ChucNang/f481_td_duyet_don_hang_1.aspx?id_phong_ban=" + m_hdf_id_trung_tam.Value + "&form_mode=" + CONST_ID_TRANG_THAI_DON_HANG.XIN_TD_DUYET; ;
         if (!v_mail.Equals("")) { BCTKApp.App_Code.HelpUtils.SendEmailHanhChinhTopica(v_mail, "Xin TD duyệt đơn hàng VPP", v_str_noi_dung); return true; }
         else { thong_bao("Chưa có địa chỉ mail của TD.", true); return false; }
     }
     else
     { thong_bao("Không tìm thấy user TD để gửi mail.", true); return false; }
 }
 private bool check_txt_mail(string ip_ten_mail)
 {
     US_HT_USER_GROUP v_us_user_group = new US_HT_USER_GROUP();
     DS_HT_USER_GROUP v_ds_user_group = new DS_HT_USER_GROUP();
     if (ip_ten_mail == "")
         return false;
     else
     {
         v_us_user_group.Check_have_mail(v_ds_user_group, ip_ten_mail);
         if (v_ds_user_group.HT_USER_GROUP.Rows.Count > 0)
             return true;
         else
             return false;
     }
 }
 public US_HT_USER_GROUP()
 {
     pm_objDS = new DS_HT_USER_GROUP();
     pm_strTableName = c_TableName;
     pm_objDR = pm_objDS.Tables[pm_strTableName].NewRow();
 }
예제 #16
0
 public US_HT_USER_GROUP()
 {
     pm_objDS        = new DS_HT_USER_GROUP();
     pm_strTableName = c_TableName;
     pm_objDR        = pm_objDS.Tables[pm_strTableName].NewRow();
 }
 private bool check_txt_mail()
 {
     US_HT_USER_GROUP v_us_user_group = new US_HT_USER_GROUP();
     DS_HT_USER_GROUP v_ds_user_group = new DS_HT_USER_GROUP();
     string v_ten_mail = m_txt_nhap_mail.Text.Trim() + "@topica.edu.vn";
     //string v_ten_mail = m_txt_nhap_mail.Text.Trim() + "@gmail.com";
     if (m_txt_nhap_mail.Text == "")
     {
         thong_bao("Bạn chưa nhập mail",true);
         m_txt_nhap_mail.Focus();
         return false;
     }
     else
     {
         v_us_user_group.Check_have_mail(v_ds_user_group, v_ten_mail);
         if (v_ds_user_group.HT_USER_GROUP.Rows.Count > 0)
             return true;
         else
         {
             thong_bao("Địa chỉ mail không hợp lệ hoặc chưa cung cấp cho TAD.\nVui lòng liên hệ với TAD để biết thêm chi tiết.");
             return false;
         }
     }
 }