private void load_data_2_cbo()
        {
            DS_CM_DM_TU_DIEN v_ds_cm_dm_tu_dien = new DS_CM_DM_TU_DIEN();
            US_CM_DM_TU_DIEN v_us_cm_dm_tu_dien = new US_CM_DM_TU_DIEN();
            v_us_cm_dm_tu_dien.FillDataset(v_ds_cm_dm_tu_dien, "where id_loai_tu_dien = "+ CONST_ID_CM_DM_LOAI_TD.ID_LOAI_DINH_MUC);

            m_cbo_loai_dinh_muc.DataSource = v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
            m_cbo_loai_dinh_muc.DisplayMember = CM_DM_TU_DIEN.TEN_NGAN;
            m_cbo_loai_dinh_muc.ValueMember = CM_DM_TU_DIEN.ID;
        }
Example #2
0
        private void get_so_ky_hieu()
        {
            var v_us_cm_dm_tu_dien = new US_CM_DM_TU_DIEN();
            var v_ds_cm_dm_tu_dien = new DS_CM_DM_TU_DIEN();

            v_us_cm_dm_tu_dien.FillDataset(v_ds_cm_dm_tu_dien, "where MA_TU_DIEN = '" + _loaiCongVan + "' and TEN = '" + getYear() + "'");
            var v_int_cv_count = 1;
            if (v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Rows.Count > 0)
            {
                var v_dr = v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN.Rows[0];
                int.TryParse(v_dr[CM_DM_TU_DIEN.TEN_NGAN].ToString(), out v_int_cv_count);
            }
            else if(!string.IsNullOrEmpty(_loaiCongVan))
            {
                //v_us_cm_dm_tu_dien.strMA_TU_DIEN = _loaiCongVan;
                //v_us_cm_dm_tu_dien.dcID_LOAI_TU_DIEN = 26;
                //v_us_cm_dm_tu_dien.strTEN_NGAN = "01";
                //v_us_cm_dm_tu_dien.strTEN = this.Text;
                //v_us_cm_dm_tu_dien.Insert();
            }
            this.Text = string.Format("{0:00}", v_int_cv_count) + "/" + getYear();
        }
 private void load_cbo_trang_thai()
 {
     m_trang_thai = false;
     BCTKUS.US_CM_DM_TU_DIEN v_us = new BCTKUS.US_CM_DM_TU_DIEN();
     BCTKDS.DS_CM_DM_TU_DIEN v_ds = new BCTKDS.DS_CM_DM_TU_DIEN();
     v_us.FillDataset(v_ds, "where id_loai_tu_dien = " + 12);
     m_cbo_trang_thai.DataSource = v_ds.CM_DM_TU_DIEN;
     m_cbo_trang_thai.ValueMember = CM_DM_TU_DIEN.ID;
     m_cbo_trang_thai.DisplayMember = CM_DM_TU_DIEN.TEN;
     DataRow v_dr = v_ds.CM_DM_TU_DIEN.NewRow();
     v_dr[CM_DM_TU_DIEN.ID] = -1;
     v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = 12;
     v_dr[CM_DM_TU_DIEN.TEN] = "Tất cả";
     v_dr[CM_DM_TU_DIEN.TEN_NGAN] = "Tất cả";
     v_dr[CM_DM_TU_DIEN.MA_TU_DIEN] = "TRANG_THAI_THU";
     v_dr[CM_DM_TU_DIEN.GHI_CHU] = " ";
     v_ds.CM_DM_TU_DIEN.Rows.InsertAt(v_dr, 0);
     m_cbo_trang_thai.SelectedIndex = 0;
     m_trang_thai = true;
 }
        private bool insert_data()
        {
            try
            {
                string v_str_file_name = m_txt_file_upload.Text.Split('\\')[m_txt_file_upload.Text.Split('\\').Length - 1];
                string v_str_save_file = ConfigurationSettings.AppSettings["DOMAIN"] + "/" + "FileUpload_Vanthu" + "/" + v_str_file_name.Replace(ConfigurationSettings.AppSettings["DOMAIN"] + "/" + "FileUpload_Vanthu" + "/","");
                if (!m_txt_file_upload.Text.Trim().Equals("") && !m_txt_file_upload.Text.Contains(ConfigurationSettings.AppSettings["DOMAIN"]))
                {
                    if (!HelpUtils.ftpTransfer(m_txt_file_upload.Text.Replace(v_str_file_name, ""), v_str_file_name)) return false;
                }

                US_GD_VAN_THU v_us_gd_van_thu = new US_GD_VAN_THU();
                if (m_dc_id_van_thu != 0) v_us_gd_van_thu = new US_GD_VAN_THU(m_dc_id_van_thu);

                if (m_tcd_ngay_tren_cv.getValue() == null) v_us_gd_van_thu.SetNGAY_THANG_TREN_CONG_VANNull();
                else
                    v_us_gd_van_thu.datNGAY_THANG_TREN_CONG_VAN = CIPConvert.ToDatetime(m_tcd_ngay_tren_cv.Text, "dd/MM/yyyy");

                if (m_tcd_ngay_nhap.getValue() == null) v_us_gd_van_thu.SetNGAY_LAPNull();
                else
                    v_us_gd_van_thu.datNGAY_LAP = CIPConvert.ToDatetime(m_tcd_ngay_nhap.Text, "dd/MM/yyyy");

                v_us_gd_van_thu.strSO_VA_KY_HIEU = m_txt_so_va_ky_hieu.Text.Trim();
                v_us_gd_van_thu.strTEN_LOAI_VA_TRICH_YEU_ND = m_txt_ten_loai.Text.Trim();

                US_DM_PHONG_BAN_PHAP_NHAN v_us_dm_phong_ban = new US_DM_PHONG_BAN_PHAP_NHAN();
                DS_DM_PHONG_BAN_PHAP_NHAN v_ds_dm_phong_ban = new DS_DM_PHONG_BAN_PHAP_NHAN();

                if (m_cbx_ban_luu.SelectedValue != null)
                {
                    v_us_dm_phong_ban.FillDataset(v_ds_dm_phong_ban,
                                                  " where id_phong_ban = " + m_cbx_ban_luu.SelectedValue);
                    v_us_gd_van_thu.dcID_NGUOI_NHAN_BAN_LUU = CIPConvert.ToDecimal(m_cbx_ban_luu.SelectedValue);
                    v_us_gd_van_thu.dcID_NOI_NGUOI_NHAN = CIPConvert.ToDecimal(m_cbx_ban_luu.SelectedValue);
                }
                else
                {
                    v_us_gd_van_thu.SetID_NGUOI_NHAN_BAN_LUUNull();
                    v_us_gd_van_thu.SetID_NOI_NGUOI_NHANNull();
                }

                if (v_ds_dm_phong_ban.Tables[0].Rows.Count > 0)
                    v_us_gd_van_thu.dcID_PHAP_NHAN = CIPConvert.ToDecimal(v_ds_dm_phong_ban.Tables[0].Rows[0][DM_PHONG_BAN_PHAP_NHAN.ID_PHAP_NHAN]);
                else v_us_gd_van_thu.SetID_PHAP_NHANNull();

                v_us_gd_van_thu.strGHI_CHU = m_txt_ghi_chu.Text.Trim();
                v_us_gd_van_thu.dcID_TRANG_THAI = CIPConvert.ToDecimal(m_cbx_trang_thai.SelectedValue);
                v_us_gd_van_thu.strNGUOI_LAP = m_txt_nguoi_nhap.Text.Trim();
                if (!m_txt_file_upload.Text.Trim().Equals(string.Empty))
                    v_us_gd_van_thu.strLINK_SCAN = v_str_save_file;
                else v_us_gd_van_thu.strLINK_SCAN = string.Empty;
                v_us_gd_van_thu.strSO_CV_DEN = m_txt_so_cv_den.Text.Trim();
                v_us_gd_van_thu.strNOI_GUI = m_txt_noi_gui.Text.Trim();
                v_us_gd_van_thu.dcID_LOAI_CONG_VAN = ID_LOAI_VAN_THU.CONG_VAN_DEN;
                v_us_gd_van_thu.strNOI_NHAN = m_cbx_ban_luu.Text.Trim();
                if (v_us_dm_phong_ban.dcID == -1)
                {
                    v_us_gd_van_thu.Insert();
                    US_CM_DM_TU_DIEN v_us = new US_CM_DM_TU_DIEN();
                    DS_CM_DM_TU_DIEN v_ds = new DS_CM_DM_TU_DIEN();
                    v_us.FillDataset(v_ds, "where ma_tu_dien='CV_DEN'");
                    if (v_ds.CM_DM_TU_DIEN.Count > 0)
                    {
                        v_us.DataRow2Me(v_ds.Tables[0].Rows[0]);
                        string v_str_so = v_ds.Tables[0].Rows[0][CM_DM_TU_DIEN.TEN_NGAN].ToString();
                        string v_str_nam = v_ds.Tables[0].Rows[0][CM_DM_TU_DIEN.TEN].ToString();
                        v_str_so = CIPConvert.ToStr(CIPConvert.ToDecimal(v_str_so) + 1, "0#");
                        m_txt_so_cv_den.Text = v_str_so + "/" + v_str_nam;
                        v_us.strTEN = v_str_nam;
                        v_us.strTEN_NGAN = v_str_so;
                        v_us.Update();
                    }
                }
                else
                {
                    v_us_dm_phong_ban.Update();
                }
                return true;
            }
            catch (Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
                return false;
            }
        }
 private void load_thong_tin_so_va_ky_hieu_van_ban()
 {
     US_CM_DM_TU_DIEN v_us = new US_CM_DM_TU_DIEN();
     DS_CM_DM_TU_DIEN v_ds = new DS_CM_DM_TU_DIEN();
     v_us.FillDataset(v_ds, "where ma_tu_dien='CV_DEN'");
     if (v_ds.CM_DM_TU_DIEN.Count > 0)
     {
         string v_str_so = v_ds.Tables[0].Rows[0][CM_DM_TU_DIEN.TEN_NGAN].ToString();
         string v_str_nam = v_ds.Tables[0].Rows[0][CM_DM_TU_DIEN.TEN].ToString();
         m_txt_so_cv_den.Text = v_str_so + "/" + v_str_nam;
     }
 }
        private void load_data_trang_thai()
        {
            try
            {
                US_CM_DM_TU_DIEN v_us_cm_dm_tu_dien = new US_CM_DM_TU_DIEN();
                DS_CM_DM_TU_DIEN v_ds_cm_dm_tu_dien = new DS_CM_DM_TU_DIEN();
                v_us_cm_dm_tu_dien.FillDataset(v_ds_cm_dm_tu_dien, "where ma_tu_dien in ('CHO_SO_VAO_SO_DONG_DAU','DA_LUU','DA_CHUYEN_DEN_NGUOI_NHAN','NGUOI_NHAN_DA_NHAN_DUOC') order by ten_ngan");

                m_cbx_trang_thai.DataSource = v_ds_cm_dm_tu_dien.CM_DM_TU_DIEN;
                m_cbx_trang_thai.DisplayMember = CM_DM_TU_DIEN.TEN;
                m_cbx_trang_thai.ValueMember = CM_DM_TU_DIEN.ID;
            }
            catch (Exception v_e)
            {
                CSystemLog_301.ExceptionHandle(v_e);
            }
        }
 private void load_cbo_loai_de_xuat()
 {
     BCTKUS.US_CM_DM_TU_DIEN v_us = new BCTKUS.US_CM_DM_TU_DIEN();
     BCTKDS.DS_CM_DM_TU_DIEN v_ds = new BCTKDS.DS_CM_DM_TU_DIEN();
     v_us.FillDataset(v_ds, "where id_loai_tu_dien =" + 17);
     m_cbo_loai_de_xuat.DataSource = v_ds.CM_DM_TU_DIEN;
     m_cbo_loai_de_xuat.ValueMember = CM_DM_TU_DIEN.ID;
     m_cbo_loai_de_xuat.DisplayMember = CM_DM_TU_DIEN.TEN_NGAN;
     DataRow v_dr = v_ds.CM_DM_TU_DIEN.NewRow();
     v_dr[CM_DM_TU_DIEN.ID] = -1;
     v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = 17;
     v_dr[CM_DM_TU_DIEN.MA_TU_DIEN] = "";
     v_dr[CM_DM_TU_DIEN.TEN_NGAN] = "----------------------------Tất cả-----------------------------";
     v_dr[CM_DM_TU_DIEN.TEN] = "";
     v_dr[CM_DM_TU_DIEN.GHI_CHU] = "";
     v_ds.CM_DM_TU_DIEN.Rows.InsertAt(v_dr, 0);
     m_cbo_trung_tam.SelectedIndex = 0;
 }
 private void load_cbo_loai_de_xuat()
 {
     US_CM_DM_TU_DIEN v_us = new US_CM_DM_TU_DIEN();
     DS_CM_DM_TU_DIEN v_ds = new DS_CM_DM_TU_DIEN();
     v_us.FillDataset(v_ds,"where id_loai_tu_dien ="+17);
     m_cbo_loai_de_xuat.DataSource = v_ds.CM_DM_TU_DIEN;
     m_cbo_loai_de_xuat.ValueMember = CM_DM_TU_DIEN.ID;
     m_cbo_loai_de_xuat.DisplayMember = CM_DM_TU_DIEN.TEN_NGAN;
 }
 private void load_data_2_cbo()
 {
     US_CM_DM_TU_DIEN v_us_td = new US_CM_DM_TU_DIEN();
     DS_CM_DM_TU_DIEN v_ds_td = new DS_CM_DM_TU_DIEN();
     v_us_td.FillDataset(v_ds_td," where id_loai_tu_dien= 16 ");
     m_cbo_loai_co_so.DisplayMember = CM_DM_TU_DIEN.TEN;
     m_cbo_loai_co_so.ValueMember = CM_DM_TU_DIEN.ID;
     m_cbo_loai_co_so.DataSource = v_ds_td.CM_DM_TU_DIEN;
 }
 private void load_data_to_cbo_trang_thai()
 {
     BCTKUS.US_CM_DM_TU_DIEN v_us_trang_thai_van_thu = new BCTKUS.US_CM_DM_TU_DIEN();
     BCTKDS.DS_CM_DM_TU_DIEN v_ds_trang_thai_van_thu = new BCTKDS.DS_CM_DM_TU_DIEN();
     v_us_trang_thai_van_thu.FillDataset(v_ds_trang_thai_van_thu, "where id_loai_tu_dien=22"); //id loai tu dien trang thai van thu
     DataRow v_dr = v_ds_trang_thai_van_thu.CM_DM_TU_DIEN.NewRow();
     v_dr[CM_DM_TU_DIEN.ID] = -1;
     v_dr[CM_DM_TU_DIEN.GHI_CHU] = "";
     v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = 22;
     v_dr[CM_DM_TU_DIEN.MA_TU_DIEN] = "TatCa";
     v_dr[CM_DM_TU_DIEN.TEN] = "0 - Tất cả";
     v_dr[CM_DM_TU_DIEN.TEN_NGAN] = "0 - Tất cả";
     v_ds_trang_thai_van_thu.Tables[0].Rows.InsertAt(v_dr, 0);
     v_ds_trang_thai_van_thu.AcceptChanges();
     m_cbo_trang_thai.DisplayMember = CM_DM_TU_DIEN.TEN_NGAN;
     m_cbo_trang_thai.ValueMember = CM_DM_TU_DIEN.ID;
     m_cbo_trang_thai.DataSource = v_ds_trang_thai_van_thu.CM_DM_TU_DIEN;
 }
 private void load_cbo_loai_dinh_muc()
 {
     BCTKUS.US_CM_DM_TU_DIEN v_us = new BCTKUS.US_CM_DM_TU_DIEN();
     BCTKDS.DS_CM_DM_TU_DIEN v_ds = new BCTKDS.DS_CM_DM_TU_DIEN();
     v_us.FillDataset(v_ds, "where id_loai_tu_dien =" + 17);
     m_cbo_loai_dm.DataSource = v_ds.CM_DM_TU_DIEN;
     m_cbo_loai_dm.ValueMember = CM_DM_TU_DIEN.ID;
     m_cbo_loai_dm.DisplayMember = CM_DM_TU_DIEN.TEN_NGAN;
     //DataRow v_dr = v_ds.CM_DM_TU_DIEN.NewRow();
     //v_dr[CM_DM_TU_DIEN.ID] = -1;
     //v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = 17;
     //v_dr[CM_DM_TU_DIEN.MA_TU_DIEN] = " ";
     //v_dr[CM_DM_TU_DIEN.TEN] = "Tất cả";
     //v_dr[CM_DM_TU_DIEN.TEN_NGAN] = "Tất cả";
     //v_ds.CM_DM_TU_DIEN.Rows.InsertAt(v_dr, 0);
     //m_cbo_loai_dm.SelectedIndex = 0;
     flag_loai_dm = true;
 }
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(884, 562);
            this.Controls.Add(this.m_pnl_top);
            this.Controls.Add(this.m_grv_trang_thai);
            this.Controls.Add(this.m_pnl_out_place_dm);
            this.Name = "f511_TRA_CUU_TRANG_THAI_CPN";
            this.Text = "F511-Tra cứu trạng thái CPN";
            this.Load += new System.EventHandler(this.f511_TRA_CUU_TRANG_THAI_CPN_Load);
            this.m_pnl_out_place_dm.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.m_grv_trang_thai)).EndInit();
            this.m_pnl_top.ResumeLayout(false);
            this.m_pnl_top.PerformLayout();
            this.ResumeLayout(false);
        }

        private void insert_v_dm_bill()
        {
            //	f511_TRA_CUU_TRANG_THAI_CPN_DE v_fDE = new  f511_TRA_CUU_TRANG_THAI_CPN_DE();
            //	v_fDE.display();
 private void load_cbo_trang_thai()
 {
     BCTKUS.US_CM_DM_TU_DIEN v_us = new BCTKUS.US_CM_DM_TU_DIEN();
     DS_CM_DM_TU_DIEN v_ds = new DS_CM_DM_TU_DIEN();
     v_us.FillDataset(v_ds, "where ID_LOAI_TU_DIEN=" + 12);
     m_cbo_trang_thai.DataSource = v_ds.CM_DM_TU_DIEN;
     m_cbo_trang_thai.DataValueField = CM_DM_TU_DIEN.ID;
     m_cbo_trang_thai.DataTextField = CM_DM_TU_DIEN.TEN;
     DataRow v_dr = v_ds.CM_DM_TU_DIEN.NewRow();
     v_dr[CM_DM_TU_DIEN.ID] = -1;
     v_dr[CM_DM_TU_DIEN.ID_LOAI_TU_DIEN] = 12;
     v_dr[CM_DM_TU_DIEN.TEN] = "-----Tất cả-----";
     v_dr[CM_DM_TU_DIEN.TEN_NGAN] = "-----Tất cả-----";
     v_dr[CM_DM_TU_DIEN.MA_TU_DIEN] = "TRANG_THAI_THU";
     v_dr[CM_DM_TU_DIEN.GHI_CHU] = " ";
     v_ds.CM_DM_TU_DIEN.Rows.InsertAt(v_dr, 0);
     m_cbo_trang_thai.SelectedIndex = 0;
     m_cbo_trang_thai.DataBind();
 }
 private void load_txt_cbo_trang_thai()
 {
     BCTKUS.US_CM_DM_TU_DIEN v_us = new BCTKUS.US_CM_DM_TU_DIEN();
     BCTKDS.DS_CM_DM_TU_DIEN v_ds = new BCTKDS.DS_CM_DM_TU_DIEN();
     if (m_id_trang_thai != -1)
     {
         v_us.FillDataset(v_ds, "where id = " + m_id_trang_thai);
         m_cbo_trang_thai.Text = v_ds.Tables[0].Rows[0][4].ToString();
     }
     else
     {
         m_cbo_trang_thai.Text = "Tất cả";
     }
 }
 public void Display_for_chi_tiet(decimal v_id_phap_nhan, decimal v_id_trang_thai, DateTime v_dt_tu_ngay, DateTime v_dt_den_ngay, decimal v_tong_bill, decimal v_tong_chi_phi)
 {
     m_obj_trans = get_trans_object(m_fg);
     format_controls();
     m_dt_tu_ngay = v_dt_tu_ngay;
     m_dt_den_ngay = v_dt_den_ngay;
     m_id_trang_thai = v_id_trang_thai;
     load_txt_cbo_trang_thai();
     BCTKUS.US_CM_DM_TU_DIEN v_us_td = new BCTKUS.US_CM_DM_TU_DIEN();
     BCTKDS.DS_CM_DM_TU_DIEN v_ds_td = new BCTKDS.DS_CM_DM_TU_DIEN();
     US_V_TONG_TIEN_BILL_THEO_PHONG_BAN v_us_tong_hop = new US_V_TONG_TIEN_BILL_THEO_PHONG_BAN();
     DS_V_TONG_TIEN_BILL_THEO_PHONG_BAN v_ds_tong_hop = new DS_V_TONG_TIEN_BILL_THEO_PHONG_BAN();
     v_us_td.FillDataset(v_ds_td, "where ID =" + v_id_phap_nhan);
     m_lbl_phap_nhan.Text ="PN: " + v_ds_td.Tables[0].Rows[0][4].ToString().ToUpper();
     m_lbl_tu_ngay.Text = v_dt_tu_ngay.Date.ToShortDateString();
     m_lbl_den_ngay.Text = v_dt_den_ngay.Date.ToShortDateString();
     m_lbl_tong_bill.Text = CIPConvert.ToStr(v_tong_bill, "#,###");
     m_lbl_tong_chi_phi.Text = CIPConvert.ToStr(v_tong_chi_phi, "#,###") + "   (VNĐ)";
     v_us_tong_hop.FillDataset_chi_phi_theo_phong_ban(v_ds_tong_hop, v_id_phap_nhan, v_id_trang_thai, v_dt_tu_ngay, v_dt_den_ngay);
     m_fg.Redraw = false;
     CGridUtils.Dataset2C1Grid(v_ds_tong_hop, m_fg, m_obj_trans);
     CGridUtils.MakeSoTT(0, m_fg);
     m_fg.Redraw = true;
     this.ShowDialog();
 }
Example #16
0
 private void load_data_2_cbo_trang_thai()
 {
     US_CM_DM_TU_DIEN v_us = new US_CM_DM_TU_DIEN();
     DS_CM_DM_TU_DIEN v_ds = new DS_CM_DM_TU_DIEN();
     v_us.FillDataset(v_ds, "Where id_loai_tu_dien = 12");
     m_cbo_trang_thai.DataSource = v_ds.CM_DM_TU_DIEN;
     m_cbo_trang_thai.ValueMember = CM_DM_TU_DIEN.ID;
     m_cbo_trang_thai.DisplayMember = CM_DM_TU_DIEN.TEN;
 }