protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            //this.Form.DefaultButton = m_cmd_tim_kiem.UniqueID;
            if (!IsPostBack)
            {

                US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
                if (Session[SESSION.AccounLoginYN] == "Y")
                {
                    decimal v_id_user = CIPConvert.ToDecimal(Session[SESSION.UserID]);
                    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 =" + v_id_user);
                    decimal v_id_user_group = CIPConvert.ToDecimal(v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0]["ID_USER_GROUP"]);
                    US_HT_QUAN_HE_SU_DUNG_DU_LIEU v_us_ht_qh_sd_dl = new US_HT_QUAN_HE_SU_DUNG_DU_LIEU();
                    DS_HT_QUAN_HE_SU_DUNG_DU_LIEU v_ds_ht_qh_sd_dl = new DS_HT_QUAN_HE_SU_DUNG_DU_LIEU();
                    v_us_ht_qh_sd_dl.FillDataset(v_ds_ht_qh_sd_dl, "where ID_USER_GROUP =" + v_id_user_group);
                    m_hdf_id_trung_tam.Value = v_ds_ht_qh_sd_dl.HT_QUAN_HE_SU_DUNG_DU_LIEU.Rows[0]["ID_PHONG_BAN"].ToString();
                    set_thang_hien_tai();
                    set_inital_form_mode();
                }
                //thong_bao("", false);
            }
        }
        catch (Exception v_e)
        {
            CSystemLog_301.ExceptionHandle(this, v_e);
        }
    }
 private decimal load_user_quyen(string ip_str_user_name)
 {
     m_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
     m_ds_ht_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();
     m_us_ht_nguoi_su_dung.FillDataset(m_ds_ht_nguoi_su_dung, " WHERE TEN_TRUY_CAP = N'" + ip_str_user_name + "'");
     return(CIPConvert.ToDecimal(m_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0]["ID_USER_GROUP"]));
 }
Example #3
0
    private decimal get_id_user_by_username(string ip_strsusername)
    {
        US_HT_NGUOI_SU_DUNG v_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
        DS_HT_NGUOI_SU_DUNG v_ds_ht_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();

        v_us_ht_nguoi_su_dung.FillDataset(v_ds_ht_nguoi_su_dung, " WHERE TEN_TRUY_CAP=N'" + ip_strsusername + "'");
        return(CIPConvert.ToDecimal(v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0][HT_NGUOI_SU_DUNG.ID]));
    }
Example #4
0
 private void load_data_2_grid()
 {
     m_ds = new DS_HT_NGUOI_SU_DUNG();
     m_us.FillDataset(m_ds);
     m_fg.Redraw = false;
     CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
     m_fg.Redraw = true;
 }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     US_HT_NGUOI_SU_DUNG v_us = new US_HT_NGUOI_SU_DUNG();
     DS_HT_NGUOI_SU_DUNG v_ds = new DS_HT_NGUOI_SU_DUNG();
     v_us.FillDataset(v_ds);
     m_cbo_bill.DataSource = v_ds.HT_NGUOI_SU_DUNG;
     m_cbo_bill.DataValueField = HT_NGUOI_SU_DUNG.ID;
     m_cbo_bill.DataTextField=HT_NGUOI_SU_DUNG.TEN;
     m_cbo_bill.DataBind();
 }
Example #6
0
 private void load_data_2_grid()
 {
     try {
         m_us_user.FillDataset(m_ds_user, " WHERE ID_USER_GROUP =" + CIPConvert.ToDecimal(m_cbo_user_group.SelectedValue));
         m_grv_dm_tu_dien.DataSource = m_ds_user.HT_NGUOI_SU_DUNG;
         m_grv_dm_tu_dien.DataBind();
     }
     catch (Exception v_e) {
         throw v_e;
     }
 }
    private string get_ten_by_ten_truy_cap(string ip_str_ten_truy_cap)
    {
        US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung    = new US_HT_NGUOI_SU_DUNG();
        DS_HT_NGUOI_SU_DUNG v_ds_ht_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();

        v_us_nguoi_su_dung.FillDataset(v_ds_ht_nguoi_su_dung, " WHERE TEN_TRUY_CAP = N'" + ip_str_ten_truy_cap + "'");
        if (v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows.Count > 0)
        {
            return(v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0][HT_NGUOI_SU_DUNG.TEN].ToString());
        }
        return("");
    }
    private void load_data_2_cbo_po_quan_ly_chinh_va_phu()
    {
        US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
        DS_HT_NGUOI_SU_DUNG v_ds_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();

        try
        {
            v_us_nguoi_su_dung.FillDataset(v_ds_nguoi_su_dung);

            // Load data to PO phụ trách chính Combobox
            m_cbo_po_phu_trach_chinh.DataSource = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;

            m_cbo_po_phu_trach_chinh.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_chinh.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_chinh.SelectedIndex  = 0;
            m_cbo_po_phu_trach_chinh.DataBind();

            DataRow v_dr_none = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG.NewHT_NGUOI_SU_DUNGRow();
            v_dr_none[HT_NGUOI_SU_DUNG.ID]           = "0";
            v_dr_none[HT_NGUOI_SU_DUNG.TEN]          = "Không có";
            v_dr_none[HT_NGUOI_SU_DUNG.MAT_KHAU]     = "123456";
            v_dr_none[HT_NGUOI_SU_DUNG.TEN_TRUY_CAP] = "KHONG_CO";
            v_dr_none[HT_NGUOI_SU_DUNG.NGAY_TAO]     = CIPConvert.ToDatetime("01/01/2011");
            v_dr_none[HT_NGUOI_SU_DUNG.NGUOI_TAO]    = "ADMIN";
            v_dr_none[HT_NGUOI_SU_DUNG.BUILT_IN_YN]  = "N";
            v_dr_none[HT_NGUOI_SU_DUNG.TRANG_THAI]   = "0";

            v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows.InsertAt(v_dr_none, 0);
            m_cbo_po_phu_trach_phu.DataSource = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;

            m_cbo_po_phu_trach_phu.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
Example #9
0
    public static bool check_user_have_menu()
    {
        object v_obj_id_user_login = HttpContext.Current.Session[SESSION.UserID];
        if (v_obj_id_user_login == null) return false;
        else
        {
            string v_str_url_without_query = get_chuc_nang_without_query();
            if (v_str_url_without_query == "Default.aspx") return true;
            if (v_str_url_without_query == "Account/ChangePassword.aspx") return true;
            if (v_str_url_without_query.Contains("MessageError.aspx")) return true;
            if (v_str_url_without_query.Contains("ChucNang/f604_xac_nhan_cong_van.aspx")) return true;
            if (v_str_url_without_query.Contains("ChucNang/f560_tra_cuu_dm_vpp.aspx")) return true;
            if (CIPConvert.ToDecimal(v_obj_id_user_login) == -1)
            {
                return false;
            }
            else
            {
                DS_HT_NGUOI_SU_DUNG v_ds_ht_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();
                US_HT_NGUOI_SU_DUNG v_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
                v_us_ht_nguoi_su_dung.FillDataset(v_ds_ht_nguoi_su_dung, "where id = " + v_obj_id_user_login.ToString());
                if (v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Count < 1) return false;
                v_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG(CIPConvert.ToDecimal(v_obj_id_user_login));
                US_HT_USER_GROUP v_us_ht_user_group = new US_HT_USER_GROUP(v_us_ht_nguoi_su_dung.dcID_USER_GROUP);
                US_HT_QUYEN_GROUP v_us_ht_quyen_group = new US_HT_QUYEN_GROUP();
                DS_HT_QUYEN_GROUP v_ds_ht_quyen_group = new DS_HT_QUYEN_GROUP();
                v_us_ht_quyen_group.FillDataset(v_ds_ht_quyen_group, "where id_user_group = " + v_us_ht_user_group.dcID +
                    " and id_quyen in (select id from ht_chuc_nang where url_form like N'%" + get_chuc_nang() + "%' and trang_thai_yn ='Y' and hien_thi_yn='Y')");
                if (v_ds_ht_quyen_group.HT_QUYEN_GROUP.Count < 1)
                {
                    v_ds_ht_quyen_group.Clear();
                    v_us_ht_quyen_group.FillDataset(v_ds_ht_quyen_group, "where id_user_group = " + v_us_ht_user_group.dcID +
                    " and id_quyen in (select id from ht_chuc_nang where url_form like N'%" + get_chuc_nang_without_query() + "%' and trang_thai_yn ='Y' and hien_thi_yn='Y')");
                    if (v_ds_ht_quyen_group.HT_QUYEN_GROUP.Count < 1) return false;
                };
            }

        }
        return true;
    }
Example #10
0
    private void load_data_2_po_phu_trach()
    {
        US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
        DS_HT_NGUOI_SU_DUNG v_ds_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();

        DataRow v_dr_none = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG.NewHT_NGUOI_SU_DUNGRow();

        v_dr_none[HT_NGUOI_SU_DUNG.ID]           = "0";
        v_dr_none[HT_NGUOI_SU_DUNG.TEN]          = "Tất cả";
        v_dr_none[HT_NGUOI_SU_DUNG.MAT_KHAU]     = "123456";
        v_dr_none[HT_NGUOI_SU_DUNG.TEN_TRUY_CAP] = "All";
        v_dr_none[HT_NGUOI_SU_DUNG.NGAY_TAO]     = CIPConvert.ToDatetime("01/01/2011");
        v_dr_none[HT_NGUOI_SU_DUNG.NGUOI_TAO]    = "ADMIN";
        v_dr_none[HT_NGUOI_SU_DUNG.BUILT_IN_YN]  = "N";
        v_dr_none[HT_NGUOI_SU_DUNG.TRANG_THAI]   = "0";
        v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows.InsertAt(v_dr_none, 0);
        v_us_nguoi_su_dung.FillDataset(v_ds_nguoi_su_dung, " ORDER BY TEN_TRUY_CAP");
        m_cbo_po_lap_bang_ke.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
        m_cbo_po_lap_bang_ke.DataValueField = HT_NGUOI_SU_DUNG.ID;
        m_cbo_po_lap_bang_ke.DataSource     = v_ds_nguoi_su_dung;
        m_cbo_po_lap_bang_ke.DataBind();
    }
    private void load_2_cbo_po_phu_trach()
    {
        try
        {
            US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
            DS_HT_NGUOI_SU_DUNG v_ds_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();
            // Đổ dữ liệu vào DS
            v_us_nguoi_su_dung.FillDataset(v_ds_nguoi_su_dung, " WHERE ID_USER_GROUP <> " + (int)e_user_group.GIANG_VIEN + " ORDER BY TEN_TRUY_CAP");

            //TReo dữ liệu vào Dropdownlist loại hợp đồng
            // Đây là giá trị thực

            m_cbo_po_phu_trach_hop_dong.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_hop_dong.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            // dây là giá trị hiển thị
            m_cbo_po_phu_trach_hop_dong.DataTextField = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_hop_dong.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    private void load_2_cbo_po_phu_trach()
    {
        try
        {
            US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
            DS_HT_NGUOI_SU_DUNG v_ds_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();
            // Đổ dữ liệu vào DS
            v_us_nguoi_su_dung.FillDataset(v_ds_nguoi_su_dung);

            //TReo dữ liệu vào Dropdownlist loại hợp đồng
            // Đây là giá trị thực
            m_cbo_po_phu_trach.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            // dây là giá trị hiển thị
            m_cbo_po_phu_trach.DataTextField = HT_NGUOI_SU_DUNG.TEN;

            m_cbo_po_phu_trach.DataSource = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                if (!Person.check_user_have_menu())
                {
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "<script type = 'text/javascript'>alert('Bạn không có quyền sử dụng chức năng này!');window.location.replace('/TraCuuKeToan/')</script>");
                }
                US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
                if (Session[SESSION.AccounLoginYN] == "Y")
                {
                    decimal v_id_user = CIPConvert.ToDecimal(Session[SESSION.UserID]);
                    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 =" + v_id_user);
                    decimal v_id_user_group = CIPConvert.ToDecimal(v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0]["ID_USER_GROUP"]);
                    US_HT_QUAN_HE_SU_DUNG_DU_LIEU v_us_ht_qh_sd_dl = new US_HT_QUAN_HE_SU_DUNG_DU_LIEU();
                    DS_HT_QUAN_HE_SU_DUNG_DU_LIEU v_ds_ht_qh_sd_dl = new DS_HT_QUAN_HE_SU_DUNG_DU_LIEU();
                    v_us_ht_qh_sd_dl.FillDataset(v_ds_ht_qh_sd_dl, "where ID_USER_GROUP =" + v_id_user_group);
                    m_hdf_id_trung_tam.Value = v_ds_ht_qh_sd_dl.HT_QUAN_HE_SU_DUNG_DU_LIEU.Rows[0]["ID_PHONG_BAN"].ToString();
                }
                else
                {
                    Response.Redirect("../Default.aspx", false);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }
                set_time_set_ten_trung_tam();
                load_data_to_grid();
                thong_bao("", false);
                view_detail_grv(false);
            }
        }

        catch (System.Exception v_e)
        {
            CSystemLog_301.ExceptionHandle(this, v_e);
        }
    }
    private void load_data_2_cbo_po_quan_ly_chinh_va_phu()
    {
        US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
        DS_HT_NGUOI_SU_DUNG v_ds_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();

        try
        {
            v_us_nguoi_su_dung.FillDataset(v_ds_nguoi_su_dung, " WHERE ID_USER_GROUP <> " + LOAI_USER_QUYEN.GIANG_VIEN);

            // Load data to PO phụ trách chính Combobox
            m_cbo_po_phu_trach_chinh.DataSource = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;

            m_cbo_po_phu_trach_chinh.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_chinh.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_chinh.SelectedIndex  = 0;
            m_cbo_po_phu_trach_chinh.DataBind();

            DataRow v_dr_none = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG.NewHT_NGUOI_SU_DUNGRow();
            v_dr_none[HT_NGUOI_SU_DUNG.ID]  = "0";
            v_dr_none[HT_NGUOI_SU_DUNG.TEN] = "Không có";
            //v_dr_none[HT_NGUOI_SU_DUNG.MAT_KHAU] = "123456";
            v_dr_none[HT_NGUOI_SU_DUNG.TEN_TRUY_CAP] = "KHONG_CO";
            //v_dr_none[HT_NGUOI_SU_DUNG.NGAY_TAO] = CIPConvert.ToDatetime("01/01/2011");
            //v_dr_none[HT_NGUOI_SU_DUNG.NGUOI_TAO] = "ADMIN";
            //v_dr_none[HT_NGUOI_SU_DUNG.BUILT_IN_YN] = "N";
            //v_dr_none[HT_NGUOI_SU_DUNG.TRANG_THAI] = "0";
            v_ds_nguoi_su_dung.EnforceConstraints = false;
            v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows.InsertAt(v_dr_none, 0);

            // Cbo phụ 1
            m_cbo_po_phu_trach_phu.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu.DataBind();

            // Cbo phụ 2
            m_cbo_po_phu_trach_phu2.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu2.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu2.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu2.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu2.DataBind();

            // Cbo phụ 3
            m_cbo_po_phu_trach_phu3.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu3.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu3.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu3.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu3.DataBind();

            // Cbo phụ 4
            m_cbo_po_phu_trach_phu4.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu4.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu4.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu4.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu4.DataBind();

            // Cbo phụ 5
            m_cbo_po_phu_trach_phu5.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu5.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu5.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu5.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu5.DataBind();

            // Cbo phụ 6
            m_cbo_po_phu_trach_phu6.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu6.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu6.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu6.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu6.DataBind();

            // Cbo phụ 7
            m_cbo_po_phu_trach_phu7.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu7.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu7.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu7.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu7.DataBind();

            // Cbo phụ 8
            m_cbo_po_phu_trach_phu8.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu8.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu8.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu8.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu8.DataBind();

            // Cbo phụ 9
            m_cbo_po_phu_trach_phu9.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu9.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu9.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu9.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu9.DataBind();

            // Cbo phụ 10
            m_cbo_po_phu_trach_phu10.DataSource     = v_ds_nguoi_su_dung.HT_NGUOI_SU_DUNG;
            m_cbo_po_phu_trach_phu10.DataValueField = HT_NGUOI_SU_DUNG.TEN_TRUY_CAP;
            m_cbo_po_phu_trach_phu10.DataTextField  = HT_NGUOI_SU_DUNG.TEN;
            m_cbo_po_phu_trach_phu10.SelectedIndex  = 0;
            m_cbo_po_phu_trach_phu10.DataBind();
        }
        catch (Exception v_e)
        {
            throw v_e;
        }
    }
            this.m_pnl_out_place_dm.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.m_grv_don_hang)).EndInit();
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.ResumeLayout(false);
        }

        private void insert_v_gd_don_dat_hang_dinh_muc()
        {
            //	f538_TAD_DUYET_DON_HANG_DE v_fDE = new  f538_TAD_DUYET_DON_HANG_DE();
            //	v_fDE.display();
            load_data_2_grid();
        }

        private void khong_duyet_v_gd_don_dat_hang_dinh_muc()
        {
            if (!CGridUtils.IsThere_Any_NonFixed_Row(m_grv_don_hang)) return;
            if (!CGridUtils.isValid_NonFixed_RowIndex(m_grv_don_hang, m_grv_don_hang.Row)) return;
            grid2us_object(m_us, m_grv_don_hang.Row);
            //	f538_TAD_DUYET_DON_HANG_DE v_fDE = new f538_TAD_DUYET_DON_HANG_DE();
            //	v_fDE.display(m_us);
            US_DM_PHONG_BAN v_us_pb = new US_DM_PHONG_BAN();
            DS_DM_PHONG_BAN v_ds_pb = new DS_DM_PHONG_BAN();
            US_HT_NGUOI_SU_DUNG v_us_user = new US_HT_NGUOI_SU_DUNG();
            DS_HT_NGUOI_SU_DUNG v_ds_user = new DS_HT_NGUOI_SU_DUNG();
            v_us_pb.FillDataset(v_ds_pb, "where ID =" + m_us.dcID_PHONG_BAN);
            string ten_truy_cap = "nv_" + v_ds_pb.Tables[0].Rows[0]["MA_PHONG_BAN"].ToString();
            v_us_user.FillDataset(v_ds_user, "Where TEN_TRUY_CAP = " + "'" + ten_truy_cap + "'");
            string v_mail;
            if (v_ds_user.Tables[0].Rows.Count >= 0)
                v_mail = v_ds_user.Tables[0].Rows[0]["MAIL"].ToString();
            else
            {
                v_mail = "";
                DialogResult result = MessageBox.Show("Chưa có mail người gửi! \nBạn có muốn Không duyệt đơn hàng này mà không gửi mail thông báo?", "Thông báo", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
 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; }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         //this.Form.DefaultButton = m_cmd_tim_kiem.UniqueID;
         if (!IsPostBack)
         {
             //if (!Person.check_user_have_menu())
             //{
             //    ClientScript.RegisterClientScriptBlock(this.GetType(), "alert", "<script type = 'text/javascript'>alert('Bạn không có quyền sử dụng chức năng này!');window.location.replace('/TraCuuKeToan/')</script>");
             //}
             US_HT_NGUOI_SU_DUNG v_us_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
             if (Session[SESSION.AccounLoginYN] == "Y")
             {
                 decimal v_id_user = CIPConvert.ToDecimal(Session[SESSION.UserID]);
                 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 =" + v_id_user);
                 decimal v_id_user_group = CIPConvert.ToDecimal(v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0]["ID_USER_GROUP"]);
                 US_HT_QUAN_HE_SU_DUNG_DU_LIEU v_us_ht_qh_sd_dl = new US_HT_QUAN_HE_SU_DUNG_DU_LIEU();
                 DS_HT_QUAN_HE_SU_DUNG_DU_LIEU v_ds_ht_qh_sd_dl = new DS_HT_QUAN_HE_SU_DUNG_DU_LIEU();
                 v_us_ht_qh_sd_dl.FillDataset(v_ds_ht_qh_sd_dl, "where ID_USER_GROUP =" + v_id_user_group);
                 m_hdf_id_trung_tam.Value = v_ds_ht_qh_sd_dl.HT_QUAN_HE_SU_DUNG_DU_LIEU.Rows[0]["ID_PHONG_BAN"].ToString();
                 m_hdf_id_user.Value = v_id_user.ToString();
                 set_inital_form_mode();
                 view_detail_grv(false);
             }
             thong_bao("", false, false);
         }
     }
     catch (Exception v_e)
     {
         CSystemLog_301.ExceptionHandle(this, v_e);
     }
 }
    protected void m_lbt_khong_duyet_OnClick(object sender, EventArgs e)
    {
        try
        {
            string v_mail;
            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= " + CIPConvert.ToDecimal(m_hdf_id_user.Value));
            if (v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Count > 0)
                v_mail = v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0]["MAIL"].ToString();
            else { v_mail = "";}
            US_GD_DON_DAT_HANG v_us_gd_don_hang = new US_GD_DON_DAT_HANG(CIPConvert.ToDecimal(m_hdf_id_don_hang.Value));
            DateTime v_ngay_dat_hang = CIPConvert.ToDatetime(m_hdf_ngay_gui.Value);
            DateTime m_dat_dau_thang = new DateTime(v_ngay_dat_hang.Year, v_ngay_dat_hang.Month, 1);
            DateTime m_dat_cuoi_thang = m_dat_dau_thang.AddMonths(1).AddDays(-1);
            if (CIPConvert.ToDecimal(m_hdf_form_mode.Value) == CONST_ID_TRANG_THAI_DON_HANG.XIN_TD_DUYET)
                v_us_gd_don_hang.dcID_TRANG_THAI = CONST_ID_TRANG_THAI_DON_HANG.TD_KHONG_DUYET;
            if (CIPConvert.ToDecimal(m_hdf_form_mode.Value) == CONST_ID_TRANG_THAI_DON_HANG.XIN_CC_DUYET)
                v_us_gd_don_hang.dcID_TRANG_THAI = CONST_ID_TRANG_THAI_DON_HANG.CC_KHONG_DUYET;
            v_us_gd_don_hang.Update();
            string v_str_noi_dung = "Dear " + m_hdf_nguoi_gui.Value + ",\n"
                           +"Trung tâm- ban: " + m_hdf_ma_trung_tam.Value + "." + "\n"
                           + "Đơn hàng MP:" + m_lbl_ma_don_hang_de.Text + "  Lần: " + m_hdf_lan_dat.Value + "  Ngày đặt: " + m_hdf_ngay_dat.Value + " Không được duyệt!"
                           + "\n"
                           + "Xin cám ơn!";

            if (!v_mail.Equals("")) { BCTKApp.App_Code.HelpUtils.SendEmailHanhChinhTopica(v_mail, "Thông báo không duyệt", v_str_noi_dung); thong_bao("Đã gửi mail thông báo không duyệt cho người gửi đơn hàng này!",true); }
            else { thong_bao("Chưa gửi mail thông báo duyệt cho người gửi đơn hàng!"); }
            m_grv_don_hang_de.Visible = false;
            m_grv_don_hang_nhap.Visible = false;
        }
        catch (System.Exception v_e)
        {
            CSystemLog_301.ExceptionHandle(this, v_e);
        }
    }
Example #19
0
 private string get_current_password(string ip_str_ten_dang_nhap_nguoi_su_dung)
 {
     m_us_ht_nguoi_su_dung.FillDataset(m_ds_ht_nguoi_su_dung, " WHERE TEN_TRUY_CAP='" + ip_str_ten_dang_nhap_nguoi_su_dung + "'");
     return(m_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0][HT_NGUOI_SU_DUNG.MAT_KHAU].ToString());
 }
 private decimal load_user_quyen(string ip_str_user_name)
 {
     m_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG();
     m_ds_ht_nguoi_su_dung = new DS_HT_NGUOI_SU_DUNG();
     m_us_ht_nguoi_su_dung.FillDataset(m_ds_ht_nguoi_su_dung, " WHERE TEN_TRUY_CAP = N'" + ip_str_user_name + "'");
     return CIPConvert.ToDecimal(m_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0]["ID_USER_GROUP"]);
 }
    protected void m_lbt_duyet_OnClick(object sender, EventArgs e)
    {
        try
        {
            if (check_quyen_duyet() == false) { return; }
            string v_mail;
            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= " + CIPConvert.ToDecimal(m_hdf_id_user.Value));
            if (v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Count > 0)
                v_mail = v_ds_ht_nguoi_su_dung.HT_NGUOI_SU_DUNG.Rows[0]["MAIL"].ToString();
            else v_mail = "";
            US_GD_DON_DAT_HANG v_us_gd_don_hang = new US_GD_DON_DAT_HANG(CIPConvert.ToDecimal(m_hdf_id_don_hang.Value));
            int thisyear = DateTime.Now.Year;
            DateTime m_dat_dau_thang = new DateTime(thisyear, int.Parse(m_cbo_chon_thang.SelectedValue.ToString()), 1);
            DateTime m_dat_cuoi_thang = m_dat_dau_thang.AddMonths(1).AddDays(-1);
            v_us_gd_don_hang.dcID_TRANG_THAI = CONST_ID_TRANG_THAI_DON_HANG.DA_DUYET;
            v_us_gd_don_hang.Update();
            m_lbl_tong_tien_da_chi.Text = CIPConvert.ToStr(v_us_gd_don_hang.get_tong_tien_da_chi_hang_thang(v_us_gd_don_hang.dcID_PHONG_BAN, m_dat_cuoi_thang), "#,###");
            string v_str_noi_dung = "Dear " + m_hdf_nguoi_gui.Value + ",\n"
                              +"Trung tâm- ban: " + m_hdf_ma_trung_tam.Value + "." + "\n"
                              + "Đơn hàng VPP Mã phiếu:"+ m_lbl_ma_don_hang_de.Text+ "  Lần: "+ m_hdf_lan_dat.Value+ "  Ngày đặt: "+ m_hdf_ngay_dat.Value+ " đã được duyệt thành công!"
                              + "\n"
                              + "Xin cám ơn!";

            if (!v_mail.Equals("")) { BCTKApp.App_Code.HelpUtils.SendEmailHanhChinhTopica(v_mail, "Thông báo đã duyệt", v_str_noi_dung); thong_bao("Duyệt thành công!", true); }
            else { thong_bao("Duyệt thành công!"); }
            m_grv_don_hang_nhap.Visible = false;
            m_grv_don_hang_de.Visible = false;
        }

        catch (System.Exception v_e)
        {
            CSystemLog_301.ExceptionHandle(this, v_e);
        }
    }