コード例 #1
0
        public void Display_for_chi_tiet(
            decimal ip_v_id_phong_ban
            , DateTime ip_v_dt_tu_ngay
            , DateTime ip_v_dt_den_ngay
            ,decimal ip_v_id_loai_dm)
        {
            m_obj_trans = get_trans_object(m_fg);
            format_controls();
            US_DM_PHONG_BAN v_us_dm_pb = new US_DM_PHONG_BAN();
            DS_DM_PHONG_BAN v_ds_dm_pb = new DS_DM_PHONG_BAN();
            v_us_dm_pb.FillDataset(v_ds_dm_pb, "where ID =" + ip_v_id_phong_ban);
            m_lbl_ten_phong_ban.Text = v_ds_dm_pb.Tables[0].Rows[0][2].ToString();
            m_lbl_tu_ngay.Text = ip_v_dt_tu_ngay.Date.ToShortDateString();
            m_lbl_den_ngay.Text = ip_v_dt_den_ngay.Date.ToShortDateString();
            //DS_V_BC_TINH_HINH_CPN_THEO_PHONG_BAN v_ds = new DS_V_BC_TINH_HINH_CPN_THEO_PHONG_BAN();
            //US_V_BC_TINH_HINH_CPN_THEO_PHONG_BAN v_us = new US_V_BC_TINH_HINH_CPN_THEO_PHONG_BAN();
            //m_us.FillDataset_chi_tiet_dm(m_ds, ip_v_id_phong_ban, ip_v_dt_tu_ngay, ip_v_dt_den_ngay);
            m_dt_den_ngay = ip_v_dt_den_ngay;
            m_dt_tu_ngay = ip_v_dt_tu_ngay;
            m_id_phong_ban = ip_v_id_phong_ban;
            m_id_loai_dm = ip_v_id_loai_dm;

            this.ShowDialog();
        }
コード例 #2
0
 private void load_title()
 {
     decimal v_id_trung_tam = CIPConvert.ToDecimal(m_hdf_id_trung_tam.Value);
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds, "where id=" + v_id_trung_tam);
     m_lbl_ten_trung_tam.Text = v_ds.DM_PHONG_BAN.Rows[0]["TEN_PHONG_BAN"].ToString();
 }
コード例 #3
0
    private void save_grid_to_database()
    {
        US_DM_BILL v_us_dm_bill;
        GridViewRow[] v_arr_gvr = new GridViewRow[m_grv_dm_bill.Rows.Count];
        System.Web.UI.WebControls.TextBox v_txt_so_bill;
        System.Web.UI.WebControls.TextBox v_txt_ma_phong_ban;
        System.Web.UI.WebControls.TextBox v_txt_nguoi_nhan;
        System.Web.UI.WebControls.TextBox v_txt_nguoi_gui;
        System.Web.UI.WebControls.TextBox v_txt_noi_nhan;
        System.Web.UI.WebControls.TextBox v_txt_noi_dung_gui;
        System.Web.UI.WebControls.TextBox v_txt_noi_ghi_chu;
        System.Web.UI.WebControls.RadioButton v_rdb_trong_nuoc;
        //eWorld.UI.CalendarPopup v_dat_ngay_gui;
        m_grv_dm_bill.Rows.CopyTo(v_arr_gvr, 0);

        //Phải chia nhỏ để insert nếu số lượng bản ghi lớn

        int start_number = 0; //vị trí bản ghi bắt đầu insert
        int numbers_record_limited = v_arr_gvr.Length; // số bản ghi được insert k vượt quá 50
        //int numbers_record_remain = v_arr_gvr.Length; //số bản ghi còn lại sau mỗi lần insert

        //while (numbers_record_remain >= 0)
        //{
        //    if (numbers_record_remain - 50 > 0)
        //        numbers_record_limited = 50;
        //    else
        //        numbers_record_limited = numbers_record_remain;
        for (int i = start_number; i < numbers_record_limited; i++)
        {
            v_txt_so_bill = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_so_bill_grid");
            v_txt_ma_phong_ban = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_ma_phong_ban_grid");
            v_txt_nguoi_nhan = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_nguoi_nhan_grid");
            v_txt_nguoi_gui = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_nguoi_gui_grid");
            v_txt_noi_nhan = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_noi_nhan_grid");
            v_txt_noi_dung_gui = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_noi_dung_grid");
            v_txt_noi_ghi_chu = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_ghi_chu_grid");
            v_rdb_trong_nuoc = (System.Web.UI.WebControls.RadioButton)v_arr_gvr[i].FindControl("m_rdb_trong_nuoc");
            //v_dat_ngay_gui = (eWorld.UI.CalendarPopup)v_arr_gvr[i].FindControl("m_dat_ngay_gui");
            System.Web.UI.WebControls.TextBox v_txt_ngay_gui = (System.Web.UI.WebControls.TextBox)v_arr_gvr[i].FindControl("m_txt_ngay_gui_grid");

            US_DM_PHONG_BAN v_us_dm_phong_ban = new US_DM_PHONG_BAN();
            DS_DM_PHONG_BAN v_ds_dm_phong_ban = new DS_DM_PHONG_BAN();
            // chỗ này kiêm tra điêu kiên phân quyen du lieu
            // chi cho luu du lieu cua phong ban duoc phan quyen

            //em bỏ check ơr ma phong ban roi
            if (CIPConvert.ToDecimal(m_hdf_so_ban_ghi.Value) == m_grv_dm_bill.PageIndex) return;
            v_us_dm_phong_ban.FillDataset(v_ds_dm_phong_ban, "where id=" + CIPConvert.ToDecimal(m_hdf_id_trung_tam.Value));
            if (v_ds_dm_phong_ban.DM_PHONG_BAN.Count < 1) continue;
            else
            {
                v_us_dm_bill = new US_DM_BILL();
                //v_us_dm_bill.BeginTransaction();
                v_us_dm_bill.dcID_PHONG_BAN = CIPConvert.ToDecimal(v_ds_dm_phong_ban.DM_PHONG_BAN[0][0]);
                v_us_dm_bill.dcID_TRANG_THAI = CONST_ID_TRANG_THAI_THU.ID_DA_NHAN_NOI_BO;
                v_us_dm_bill.strSO_BILL = v_txt_so_bill.Text.Trim();
                v_us_dm_bill.strGHI_CHU = v_txt_noi_ghi_chu.Text.Trim();
                v_us_dm_bill.strNGUOI_GUI = v_txt_nguoi_gui.Text.Trim();
                v_us_dm_bill.strNGUOI_NHAN = v_txt_nguoi_nhan.Text.Trim();
                v_us_dm_bill.strNOI_NHAN = v_txt_noi_nhan.Text.Trim();
                v_us_dm_bill.strNOI_DUNG = v_txt_noi_dung_gui.Text.Trim();
                //v_us_dm_bill.datNGAY_GUI = v_dat_ngay_gui.SelectedDate;
                v_us_dm_bill.datNGAY_GUI = CIPConvert.ToDatetime(v_txt_ngay_gui.Text.Trim(), "dd/MM/yyyy");
                if (v_rdb_trong_nuoc.Checked == true)
                {
                    v_us_dm_bill.strTRONG_NUOC = "x";
                    v_us_dm_bill.SetNUOC_NGOAINull();
                }
                else
                {
                    v_us_dm_bill.SetTRONG_NUOCNull();
                    v_us_dm_bill.strNUOC_NGOAI = "x";
                }
                v_us_dm_bill.Insert();
                thong_bao("Đã import thành công " + (m_grv_dm_bill.PageIndex + 1) + "/" + m_grv_dm_bill.PageCount, true);
            }
            //}
            //if (numbers_record_limited == 50)
            //    start_number = start_number + 50; // lấy vị trí bản ghi tiếp theo sẽ dc insert nếu còn
            //numbers_record_remain = numbers_record_remain - 50; // tính số bản ghi còn lại chưa insert
        }
        m_grv_dm_bill.PageIndex = m_grv_dm_bill.PageIndex + 1;
        if (CIPConvert.ToDecimal(m_hdf_so_ban_ghi.Value) == m_grv_dm_bill.PageIndex)
        {
            m_grv_dm_bill.DataSource = null;
            m_grv_dm_bill.Visible = false;
        }
        m_grv_dm_bill.DataBind();
    }
コード例 #4
0
 private void set_intinal_form_load()
 {
     decimal v_id_trung_tam = CIPConvert.ToDecimal(m_hdf_id_trung_tam.Value);
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds, "where id=" + v_id_trung_tam);
     m_lbl_ten_trung_tam.Text = v_ds.DM_PHONG_BAN.Rows[0]["TEN_PHONG_BAN"].ToString();
     m_lbl_thong_tim_grv_dm_bill.Text = "(Chưa có Bill nào được import)";
 }
コード例 #5
0
        private IDictionary get_mapping_col_ten_phong_ban()
        {
            Hashtable v_hst = new Hashtable();

            US_DM_PHONG_BAN v_us_dm_phong_ban = new US_DM_PHONG_BAN();
            DS_DM_PHONG_BAN v_ds_dm_phong_ban = new DS_DM_PHONG_BAN();

            v_us_dm_phong_ban.FillDataset(v_ds_dm_phong_ban);

            foreach(DataRow v_dr in v_ds_dm_phong_ban.DM_PHONG_BAN.Rows) {
                v_hst.Add(v_dr[DM_PHONG_BAN.ID], v_dr[DM_PHONG_BAN.TEN_PHONG_BAN]);
            }
            return v_hst;
        }
コード例 #6
0
            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)
コード例 #7
0
    private void load_data_to_grid()
    {
        decimal v_id_trung_tam = CIPConvert.ToDecimal(m_hdf_id_trung_tam.Value);
        US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
        DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
        v_us.FillDataset(v_ds, "where id=" + v_id_trung_tam);
        m_lbl_title.Text = "Trung tâm - ban: " + v_ds.DM_PHONG_BAN.Rows[0]["TEN_PHONG_BAN"].ToString();
        // lấy mã trung tâm
        m_hdf_ma_trung_tam.Value = v_ds.DM_PHONG_BAN.Rows[0]["MA_PHONG_BAN"].ToString();

        DS_GD_DON_DAT_HANG v_ds_gd_don_dat_hang = new DS_GD_DON_DAT_HANG();
        US_GD_DON_DAT_HANG v_us_gd_don_dat_hang = new US_GD_DON_DAT_HANG();
        //string temp = "01/08/2014
        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_dat_hang.load_ddh_xin_cc_duyet(v_ds_gd_don_dat_hang, v_id_trung_tam, m_dat_cuoi_thang);
        m_grv_don_hang_nhap.DataSource = v_ds_gd_don_dat_hang.GD_DON_DAT_HANG;
        m_grv_don_hang_nhap.DataBind();
        //Lay tong tien dinh muc
        //DateTime v_dau_thang = DateTime.Now.Date.AddDays(-DateTime.Now.Date.Day + 1);
        //DateTime v_cuoi_thang = DateTime.Now.Date.AddMonths(1).AddDays(-DateTime.Now.Date.Day);
        m_lbl_tong_tien_dm.Text = CIPConvert.ToStr(v_us_gd_don_dat_hang.get_tong_tien_dinh_muc_hang_thang(v_id_trung_tam, 173, m_dat_dau_thang, m_dat_cuoi_thang).ToString(), "#,###,##");
        m_lbl_tong_tien_da_chi.Text = CIPConvert.ToStr(v_us_gd_don_dat_hang.get_tong_tien_da_chi_hang_thang(v_id_trung_tam, m_dat_cuoi_thang), "#,###");
    }
コード例 #8
0
        private void load_data_nguoi_nhan_ban_luu()
        {
            try
            {
                US_DM_PHONG_BAN v_us_dm_phong_ban = new US_DM_PHONG_BAN();
                DS_DM_PHONG_BAN v_ds_dm_phong_ban = new DS_DM_PHONG_BAN();
                v_us_dm_phong_ban.FillDataset(v_ds_dm_phong_ban, " order by ma_phong_ban");

                m_cbx_ban_luu.DataSource = v_ds_dm_phong_ban.DM_PHONG_BAN;
                m_cbx_ban_luu.DisplayMember = DM_PHONG_BAN.MA_PHONG_BAN;
                m_cbx_ban_luu.ValueMember = DM_PHONG_BAN.ID;
            }
            catch (Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
            }
        }
コード例 #9
0
        private void load_data_2_cbo_phong_ban()
        {
            DS_DM_PHONG_BAN v_ds_dm_phong_ban = new DS_DM_PHONG_BAN();
            US_DM_PHONG_BAN v_us_dm_phong_ban = new US_DM_PHONG_BAN();
            v_us_dm_phong_ban.FillDataset(v_ds_dm_phong_ban);
            DataRow v_dr_all = v_ds_dm_phong_ban.DM_PHONG_BAN.NewDM_PHONG_BANRow();
            v_dr_all[DM_PHONG_BAN.ID] = 0;
            v_dr_all[DM_PHONG_BAN.TEN_PHONG_BAN] = "Chưa chọn";
            v_dr_all[DM_PHONG_BAN.MA_PHONG_BAN] = "NONE";

            v_ds_dm_phong_ban.DM_PHONG_BAN.Rows.InsertAt(v_dr_all, 0);
            m_cbo_phong_ban.ValueMember = DM_PHONG_BAN.ID;
            m_cbo_phong_ban.DisplayMember = DM_PHONG_BAN.TEN_PHONG_BAN;
            m_cbo_phong_ban.DataSource = v_ds_dm_phong_ban.DM_PHONG_BAN;
        }
コード例 #10
0
 private void save_data()
 {
     if (!check_validate_is_ok()) return;
     //if (!check_tien_bill()) return;
     if (!check_so_bill()) return;
     form_to_us_object();
     switch (get_form_mode(m_hdf_form_mode))
     {
         case LOAI_FORM.THEM:
             m_us_dm_bill.Insert();
             //gui mail to [email protected]
             US_DM_PHONG_BAN v_us_dm_phong_ban = new US_DM_PHONG_BAN();
             DS_DM_PHONG_BAN v_ds_dm_phong_ban = new DS_DM_PHONG_BAN();
             v_us_dm_phong_ban.FillDataset(v_ds_dm_phong_ban, "where id=" + CIPConvert.ToDecimal(m_hdf_id_trung_tam.Value));
             string v_str_ten_phong_ban = v_ds_dm_phong_ban.DM_PHONG_BAN[0][DM_PHONG_BAN.TEN_PHONG_BAN].ToString();
             string v_str_noi_dung = "Thông báo\n TAD đã nhận được thông tin đặt hàng CPN:\n Tên phòng:" + v_str_ten_phong_ban + "\n Tổng số bill: 1 bill"
         + "\n Ngày gửi: " + DateTime.Now.ToString("dd/MM/yyyy");
             string v_str_subject = "[WebsiteQuanLyHanhChinh] Phong ban " + v_str_ten_phong_ban + " nhap bill";
             string v_str_send_mail_to = "";
             US_HT_NGUOI_SU_DUNG v_us_ht_nguoi_su_dung = new US_HT_NGUOI_SU_DUNG(69758);
             v_str_send_mail_to = v_us_ht_nguoi_su_dung.strMAIL;
             if (!v_str_send_mail_to.Equals(""))
                 WinFormControls.SendEmailHanhChinhTopica(v_str_send_mail_to, v_str_subject, v_str_noi_dung);
             //
             load_data_to_grid();
             Huy_thao_tac();
             thong_bao("Đã gửi đăng kí Bill cho TAD!");
             break;
         case LOAI_FORM.SUA:
             m_us_dm_bill.Update();
             load_data_to_grid();
             m_cmd_them.Visible = false;
             m_cmd_sua.Visible = true;
             set_form_mode(LOAI_FORM.THEM);
             Huy_thao_tac();
             thong_bao("Đã cập nhật và gửi đăng kí lại cho TAD!");
             break;
     }
 }
コード例 #11
0
 private bool validate_ma_update(string ip_str_ma,decimal ip_dc_id)
 {
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds, "where ma_phong_ban='" + ip_str_ma + "' or id="+ip_dc_id);
     if (v_ds.DM_PHONG_BAN.Count != 1) return false;
     return true;
 }
コード例 #12
0
 private bool validate_ma_insert(string v_str_ma)
 {
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds, "where ma_phong_ban='" + v_str_ma+"'");
     if (v_ds.DM_PHONG_BAN.Count != 0 && m_e_form_mode==DataEntryFormMode.InsertDataState) return false;
      return true;
 }
コード例 #13
0
 private void set_time()
 {
     m_txt_tu_ngay.Text = (DateTime.Now.Date.AddDays(-DateTime.Now.Date.Day + 1).AddMonths(-6)).ToString("dd/MM/yyyy");
     m_txt_den_ngay.Text = DateTime.Now.ToString("dd/MM/yyyy");
     decimal v_id_trung_tam = CIPConvert.ToDecimal(m_hdf_id_trung_tam.Value);
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds, "where id=" + v_id_trung_tam);
     if(v_ds.DM_PHONG_BAN.Count>0)
     m_lbl_ten_trung_tam.Text = v_ds.DM_PHONG_BAN.Rows[0]["TEN_PHONG_BAN"].ToString();
 }
コード例 #14
0
 private void load_data_2_cbo()
 {
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds,"order by ten_phong_ban ");
     m_cbo_trung_tam.DataSource = v_ds.DM_PHONG_BAN;
     m_cbo_trung_tam.ValueMember = DM_PHONG_BAN.ID;
     m_cbo_trung_tam.DisplayMember = DM_PHONG_BAN.TEN_PHONG_BAN;
 }
コード例 #15
0
 private void load_cbo_trung_tam()
 {
     flag = false;
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds);
     m_cbo_trung_tam.DataSource = v_ds.DM_PHONG_BAN;
     m_cbo_trung_tam.ValueMember = DM_PHONG_BAN.ID;
     m_cbo_trung_tam.DisplayMember = DM_PHONG_BAN.TEN_PHONG_BAN;
     m_cbo_trung_tam.SelectedIndex = 0;
     flag = true;
 }
コード例 #16
0
 private void set_time_set_ten_trung_tam()
 {
     DateTime today = DateTime.Today;
     int numberOfDaysInMonth = DateTime.DaysInMonth(today.Year, today.Month);
     m_txt_tu_ngay.Text = DateTime.Now.Date.AddDays(-DateTime.Now.Date.Day + 1).ToString("dd/MM/yyyy");
     DateTime v_dat_den_ngay = new DateTime(today.Year, today.Month, numberOfDaysInMonth);
     m_txt_den_ngay.Text = v_dat_den_ngay.ToString("dd/MM/yyyy");
     decimal v_id_trung_tam = CIPConvert.ToDecimal(m_hdf_id_trung_tam.Value);
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds, "where id=" + v_id_trung_tam);
     m_lbl_ten_trung_tam.Text = v_ds.DM_PHONG_BAN.Rows[0]["TEN_PHONG_BAN"].ToString();
 }
コード例 #17
0
 private void load_data_to_cbo_phong_ban()
 {
     US_DM_PHONG_BAN v_us_dm_phong_ban = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds_dm_phong_ban = new DS_DM_PHONG_BAN();
     v_us_dm_phong_ban.FillDataset(v_ds_dm_phong_ban, "order by ma_phong_ban");
     m_cbo_phong_ban.DataValueField = DM_PHONG_BAN.ID;
     m_cbo_phong_ban.DataTextField = DM_PHONG_BAN.MA_PHONG_BAN;
     m_cbo_phong_ban.DataSource = v_ds_dm_phong_ban.DM_PHONG_BAN;
     m_cbo_phong_ban.DataBind();
 }
コード例 #18
0
    private void load_data_to_grid()
    {
        decimal v_id_trung_tam = CIPConvert.ToDecimal(m_hdf_id_trung_tam.Value);
        US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
        DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
        v_us.FillDataset(v_ds, "where id=" + v_id_trung_tam);
        m_lbl_title.Text = "Trung tâm - ban: " + v_ds.DM_PHONG_BAN.Rows[0]["TEN_PHONG_BAN"].ToString();
        // lấy mã trung tâm
        m_hdf_ma_trung_tam.Value = v_ds.DM_PHONG_BAN.Rows[0]["MA_PHONG_BAN"].ToString();

        DS_GD_DON_DAT_HANG v_ds_gd_don_dat_hang = new DS_GD_DON_DAT_HANG();
        US_GD_DON_DAT_HANG v_us_gd_don_dat_hang = new US_GD_DON_DAT_HANG();
        //string temp = "01/08/2014";
        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_dat_hang.load_ddh_xin_td_duyet(v_ds_gd_don_dat_hang, v_id_trung_tam, m_dat_cuoi_thang);
        m_grv_don_hang_nhap.DataSource = v_ds_gd_don_dat_hang.GD_DON_DAT_HANG;
        m_grv_don_hang_nhap.DataBind();
        //Lay tong tien dinh muc
        m_lbl_tong_tien_dm.Text = CIPConvert.ToStr(v_us_gd_don_dat_hang.get_tong_tien_dinh_muc_hang_thang(v_id_trung_tam, 173, m_dat_dau_thang, m_dat_cuoi_thang).ToString(), "#,###,##");
        m_lbl_tong_tien_da_chi.Text = CIPConvert.ToStr(v_us_gd_don_dat_hang.get_tong_tien_da_chi_hang_thang(v_id_trung_tam, m_dat_cuoi_thang), "#,###");

        //check duyệt
        //if(m_grv_don_hang_nhap.Rows.Count>1)

        //for (int i = 0; i < v_ds_gd_don_dat_hang.GD_DON_DAT_HANG.Rows.Count; i++)
        //{
        //    if (CIPConvert.ToDecimal(v_ds_gd_don_dat_hang.GD_DON_DAT_HANG.Rows[i]["PHAN_TRAM_VUOT"]) >= 120)
        //    {
        //        m_grv_don_hang_nhap.
        //    }
        //    else
        //    { }
        //}
    }
コード例 #19
0
 private void load_cbo_trung_tam()
 {
     m_trang_thai = false;
     US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
     DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
     v_us.FillDataset(v_ds);
     m_cbo_trung_tam.DataSource = v_ds.DM_PHONG_BAN;
     m_cbo_trung_tam.ValueMember = DM_PHONG_BAN.ID;
     m_cbo_trung_tam.DisplayMember = DM_PHONG_BAN.TEN_PHONG_BAN;
     DataRow v_dr = v_ds.DM_PHONG_BAN.NewRow();
     v_dr[DM_PHONG_BAN.ID] = -1;
     v_dr[DM_PHONG_BAN.MA_PHONG_BAN] = "Tất cả";
     v_dr[DM_PHONG_BAN.TEN_PHONG_BAN] = "Tất cả";
     v_ds.DM_PHONG_BAN.Rows.InsertAt(v_dr, 0);
     m_cbo_trung_tam.SelectedIndex = 0;
     m_trang_thai = true;
 }
コード例 #20
0
        private void load_cbo_phong_ban()
        {
            US_DM_PHONG_BAN v_us = new US_DM_PHONG_BAN();
            DS_DM_PHONG_BAN v_ds = new DS_DM_PHONG_BAN();
            v_us.FillDataset(v_ds, "order by ten_phong_ban");
            m_cbo_phong_ban.DataSource = v_ds.DM_PHONG_BAN;
            m_cbo_phong_ban.ValueMember = DM_PHONG_BAN.ID;
            m_cbo_phong_ban.DisplayMember = DM_PHONG_BAN.TEN_PHONG_BAN;

            DataRow v_dr = v_ds.DM_PHONG_BAN.NewRow();
            v_dr[DM_PHONG_BAN.ID] = -1;
            v_dr[DM_PHONG_BAN.MA_PHONG_BAN] = "";
            v_dr[DM_PHONG_BAN.TEN_PHONG_BAN] = "------------Tất cả------------";

            v_ds.DM_PHONG_BAN.Rows.InsertAt(v_dr, 0);
            m_cbo_phong_ban.SelectedIndex = 0;
            flag = true;
        }
コード例 #21
0
        public void Display_for_chi_tiet(decimal ip_v_id_phong_ban, decimal ip_v_id_trang_thai, DateTime ip_v_dt_tu_ngay, DateTime ip_v_dt_den_ngay, decimal ip_v_tong_bill, decimal ip_v_tong_tien)
        {
            m_obj_trans = get_trans_object(m_fg);
            format_controls();
            US_DM_PHONG_BAN v_us_dm_pb = new US_DM_PHONG_BAN();
            DS_DM_PHONG_BAN v_ds_dm_pb = new DS_DM_PHONG_BAN();
            US_V_TONG_HOP_CPN_THEO_PHONG_BAN v_us_tong_hop_CPN = new US_V_TONG_HOP_CPN_THEO_PHONG_BAN();
            DS_V_TONG_HOP_CPN_THEO_PHONG_BAN v_ds_tong_hop_CPN = new DS_V_TONG_HOP_CPN_THEO_PHONG_BAN();
            v_us_dm_pb.FillDataset(v_ds_dm_pb, "where ID =" + ip_v_id_phong_ban);
            m_lbl_ten_phong_ban.Text = "CHI TIẾT CÁC BILL CỦA " + v_ds_dm_pb.Tables[0].Rows[0][2].ToString().ToUpper();
            m_lbl_tu_ngay.Text = ip_v_dt_tu_ngay.Date.ToShortDateString();
            m_lbl_den_ngay.Text = ip_v_dt_den_ngay.Date.ToShortDateString();
            m_lbl_tong_bill.Text = CIPConvert.ToStr(ip_v_tong_bill, "#,###");
            m_lbl_tong_tien.Text = CIPConvert.ToStr(ip_v_tong_tien, "#,###") + "   (VNĐ)";
            v_us_tong_hop_CPN.FillDataset_chi_tiet_Bill(v_ds_tong_hop_CPN, ip_v_id_phong_ban, ip_v_id_trang_thai, ip_v_dt_tu_ngay, ip_v_dt_den_ngay);
            m_fg.Redraw = true;
            CGridUtils.Dataset2C1Grid(v_ds_tong_hop_CPN, m_fg, m_obj_trans);
            CGridUtils.MakeSoTT(0, m_fg);
            decimal v_dc_tong_doanh_thu = 0;
            //m_v_us.get_tong_doanh_thu(v_dc_tong_doanh_thu);
            for (int i = 1; i <= v_ds_tong_hop_CPN.V_TONG_HOP_CPN_THEO_PHONG_BAN.Count; i++)
            {
                if (m_fg[i, (int)e_col_Number.SO_TIEN] == null) { }
                else
                     v_dc_tong_doanh_thu += CIPConvert.ToDecimal((m_fg[i, (int)e_col_Number.SO_TIEN]));
            }
            if (v_dc_tong_doanh_thu == 0) m_lbl_chua_tinh_vat.Text = "0 VNĐ";
            else m_lbl_chua_tinh_vat.Text = CIPConvert.ToStr(v_dc_tong_doanh_thu, "#,###.##") + "   VNĐ";

            m_fg.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Count // chỗ này dùng hàm count tức là để đếm, có thể dùng các hàm khác thay thế
             , 0
             , (int)e_col_Number.NGAY_GUI // chỗ này là tên trường mà mình nhóm
             , (int)e_col_Number.TRANG_THAI // chỗ này là tên trường mà mình Count
             , "{0}"
             );
            m_fg.Subtotal(C1.Win.C1FlexGrid.AggregateEnum.Sum
                , 0
                , (int)e_col_Number.NGAY_GUI
                , (int)e_col_Number.SO_TIEN
                , "{0}"
                );
            m_fg.Redraw = true;
            m_fg.Tree.Show(1);
            this.ShowDialog();
        }