Exemplo n.º 1
0
        public void rptTC_Phieuchi(String mPhieunxid)
        {
            try
            {
                DevExpress.Utils.WaitDialogForm Dlg = new DevExpress.Utils.WaitDialogForm("Vui lòng chờ, hệ thống đang xử lý...", "In phiếu nhập");

                rptTC_Phieuchi oReport = new rptTC_Phieuchi();
                SqlParameter[] arrPara = new SqlParameter[2];
                arrPara[0]       = new SqlParameter("@Phieutcid", SqlDbType.NVarChar, 50);
                arrPara[0].Value = mPhieunxid;
                arrPara[1]       = new SqlParameter("@Nguoidung", SqlDbType.NVarChar, 50);
                arrPara[1].Value = MTGlobal.MT_USER_LOGIN;
                DataTable otblRpt = new MTSQLServer().wRead("rptTC_Phieuthuchi", arrPara);

                Dlg.Close();
                if (otblRpt != null)
                {
                    oReport.DataSource = otblRpt;
                    oReport.BindData();
                    setParameterInfo(oReport);
                    setFormatReport(oReport);
                    SetMarginReport(oReport, false, 30, 30, 30, 25);
                    PrintPreview oPreview = new PrintPreview();
                    oPreview.report = oReport;

                    oPreview.ShowDialog();
                }

                Dlg.Close();
            }
            catch (Exception ex) { }
        }
        void refreshData()
        {
            DevExpress.Utils.WaitDialogForm dlg = new DevExpress.Utils.WaitDialogForm("Ачаалж байна...", "Түр хүлээнэ үү.");

            try
            {
                dlg.Show();

                mainTableDTLGrid = new DataTable();
                adapterDTLGrid   = new SqlDataAdapter("SELECT * FROM TBLBOOKREMAINDER ORDER BY CREATED DESC", frmMain.conn);
                builderDTLGrid   = new SqlCommandBuilder(adapterDTLGrid);
                adapterDTLGrid.Fill(mainTableDTLGrid);
                frmMain.dataTableColumnNameToUpper(mainTableDTLGrid);

                mainTableDTLGridView = new DataTable();
                adapterDTLGridView   = new SqlDataAdapter("SELECT TBLBOOKREMAINDER.*, TBLBOOK.NAME, TBLBOOK.CODE FROM TBLBOOKREMAINDER LEFT JOIN TBLBOOK ON TBLBOOK.BOOKID = TBLBOOKREMAINDER.BOOKID ORDER BY TBLBOOKREMAINDER.CREATED", frmMain.conn);
                adapterDTLGridView.Fill(mainTableDTLGridView);
                frmMain.dataTableColumnNameToUpper(mainTableDTLGridView);
                gridControl1.DataSource = mainTableDTLGridView;

                barSave.Enabled    = false;
                barCancel.Enabled  = false;
                barRefresh.Enabled = true;

                dlg.Close();
            }
            catch (Exception ex)
            {
                dlg.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 3
0
        public void rptCN_BaocaoCongnophaithuTH(DataTable otblRpt, String mNgaydau, String mNgaycuoi)
        {
            try
            {
                DevExpress.Utils.WaitDialogForm Dlg = new DevExpress.Utils.WaitDialogForm("Vui lòng chờ, hệ thống đang xử lý...", "Báo cáo bán hàng");

                rptCN_CanthuTH oReport = new rptCN_CanthuTH();
                Dlg.Close();
                if (otblRpt != null)
                {
                    oReport.DataSource = otblRpt;
                    oReport.BindData();
                    oReport.Parameters["parThangNam"].Value = String.Format("Từ ngày: {0}   đến ngày: {1} ", mNgaydau, mNgaycuoi);

                    setParameterInfo(oReport);
                    setFormatReport(oReport);
                    SetMarginReport(oReport, true, 30, 30, 30, 25);

                    PrintPreview oPreview = new PrintPreview();
                    oPreview.report = oReport;
                    oPreview.ShowDialog();
                }
                Dlg.Close();
            }
            catch (Exception ex) { }
        }
Exemplo n.º 4
0
        private void btnNhapHang_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            DevExpress.Utils.WaitDialogForm frmWailt = new DevExpress.Utils.WaitDialogForm("...", "Đang thêm phiếu nhập kho mới ");
            frmWailt.LookAndFeel.SetSkinStyle("Seven Classic");

            try
            {
                frmWailt.Show();
                if (busDatHang.UpdateTinhTrangDatHang(mode, lsDatHang[sttDH - 1].MaHoaDon, "Đã Giao") == 1)
                {
                    frmWailt.Close();
                    DevExpress.XtraEditors.XtraMessageBox.Show("Thêm phiếu nhập kho thành công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    frmWailt.Close();
                    DevExpress.XtraEditors.XtraMessageBox.Show("Thêm phiếu nhập khothất bại!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                frmWailt.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 5
0
        void refreshData()
        {
            DevExpress.Utils.WaitDialogForm dlg = new DevExpress.Utils.WaitDialogForm("Ачаалж байна...", "Түр хүлээнэ үү.");

            try
            {
                dlg.Show();

                command             = new SqlCommand();
                command.Connection  = frmMain.conn;
                command.CommandText = "SELECT TBLUSER.USERID, TBLUSER.ISACTIVE, TBLSTUDENT.LASTNAME, TBLSTUDENT.FIRSTNAME, TBLSTUDENT.CODE, TBLSTUDENT.MOBILEPHONE, TBLSTUDENT.EMAIL, Addr1 +' '+ Addr2 ADDRESS FROM TBLUSER LEFT JOIN TBLSTUDENT ON TBLSTUDENT.STUDENTID = TBLUSER.STUDENTID ORDER BY TBLUSER.CREATED";
                command.CommandType = CommandType.Text;

                SqlDataReader dr = command.ExecuteReader();
                mainTable.Clear();
                mainTable.Load(dr);
                frmMain.dataTableColumnNameToUpper(mainTable);
                gridControl1.DataSource = mainTable;
                command.Dispose();

                dlg.Close();
            }
            catch (Exception ex)
            {
                dlg.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 6
0
        static void Main( )
        {
            DevExpress.Skins.SkinManager.EnableFormSkins();
            DevExpress.LookAndFeel.LookAndFeelHelper.ForceDefaultLookAndFeelChanged();
            DevExpress.Skins.SkinManager.EnableMdiFormSkins();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DevExpress.Utils.WaitDialogForm waiting = new DevExpress.Utils.WaitDialogForm();
            waiting.SetCaption("Connecting . . .!");
            waiting.Text = "";
            waiting.Show();

            if (DataQueryProvider.Connect() == false)
            {
                waiting.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show("Please check connection", "Auto generator", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            DataQueryProvider.InitDataTables();

            Form1 form = new Form1();

            waiting.Close();

            Application.Run(form);
        }
 private void btnDongY_Click(object sender, EventArgs e)
 {
     if (txtTenNguyenLieu.Text.Trim().Length == 0)
     {
         DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Tên Nguyên Liệu !", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtTenNguyenLieu.Focus();
     }
     else
         if (txtDonVi.Text.Trim().Length == 0)
         {
             DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập đơn vị nguyên liêu!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtDonVi.Focus();
         }
         else
         {
             _nguyenlieu.TenNL = txtTenNguyenLieu.Text.Trim();
             _nguyenlieu.DonVi = txtDonVi.Text.Trim();
             DevExpress.Utils.WaitDialogForm frmWailt = new DevExpress.Utils.WaitDialogForm("...", "Đang thêm nguyên liệu mới ");
             frmWailt.LookAndFeel.SetSkinStyle("Seven Classic");
             frmWailt.Show();
             if (busNguyenLieu.InsertNguyenLieu(mode, NguyenLieu) == 1)
             {
                 frmWailt.Close();
                 DevExpress.XtraEditors.XtraMessageBox.Show("Thêm dử liệu thành công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 frmWailt.Close();
                 DevExpress.XtraEditors.XtraMessageBox.Show("Thêm dử liệu thất bại!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
 }
Exemplo n.º 8
0
 private void PatientTableWithSearch_SearchCompleted(object sender, DTO.BenhNhanDTO e)
 {
     DevExpress.Utils.WaitDialogForm f = new DevExpress.Utils.WaitDialogForm();
     this.timer1.Tick += new EventHandler((s, er) =>
     {
         var interval = (DateTime.Now - this.time).TotalSeconds;
         if (!f.IsDisposed && interval > 5)
         {
             this.timer1.Stop();
             f.Close();
             MessageBox.Show("Không thể load dữ liệu", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     });
     this.timer1.Interval = 1000;
     this.time            = DateTime.Now;
     this.timer1.Start();
     this.searchBenhNhan(e, (listPatients, result) =>
     {
         f.Close();
         this.timer1.Stop();
         if (result.Equals(COM.Constant.RES_SUC))
         {
             this.table.fetchData(listPatients);
         }
         else
         {
             MessageBox.Show("Không tìm thấy kết quả phù hợp!", "Lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
     });
 }
Exemplo n.º 9
0
        void refreshData()
        {
            DevExpress.Utils.WaitDialogForm dlg = new DevExpress.Utils.WaitDialogForm("Ачаалж байна...", "Түр хүлээнэ үү.");

            try
            {
                dlg.Show();

                command            = new SqlCommand();
                command.Connection = frmMain.conn;
                if (para != null)
                {
                    command.CommandText = "SELECT * FROM TBLAUTHOR WHERE " + para[1] + " ORDER BY CREATED DESC";
                }
                else
                {
                    command.CommandText = "SELECT * FROM TBLAUTHOR ORDER BY CREATED DESC";
                }
                command.CommandType = CommandType.Text;

                SqlDataReader dr = command.ExecuteReader();
                mainTable.Clear();
                mainTable.Load(dr);
                frmMain.dataTableColumnNameToUpper(mainTable);
                gridControl1.DataSource = mainTable;
                command.Dispose();

                dlg.Close();
            }
            catch (Exception ex)
            {
                dlg.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 10
0
        public void rptDM_SanPham()
        {
            try{
                DevExpress.Utils.WaitDialogForm Dlg = new DevExpress.Utils.WaitDialogForm("Vui lòng chờ, hệ thống đang xử lý...", "In sản phẩm");

                rptDM_SanPham oReport = new  rptDM_SanPham();
                DataTable     otblRpt = new MTSQLServer().wRead("rptDM_SanPham", null, false);

                Dlg.Close();
                if (otblRpt != null)
                {
                    oReport.DataSource = otblRpt;
                    oReport.BindData();
                    setParameterInfo(oReport);
                    setFormatReport(oReport);
                    SetMarginReport(oReport, false, 30, 30, 30, 25);

                    PrintPreview oPreview = new PrintPreview();
                    oPreview.report = oReport;
                    oPreview.ShowDialog();
                }
                else
                {
                    Utils.showMessage("Không tìm thấy dữ liệu báo cáo..", "Thông báo");
                }

                Dlg.Close();
            }
            catch (Exception ex) { }
        }
Exemplo n.º 11
0
        public void rptTL_DiemTichLuy(int isChiTiet, DataTable tblKH)
        {
            try
            {
                DevExpress.Utils.WaitDialogForm Dlg = new DevExpress.Utils.WaitDialogForm("Vui lòng chờ, hệ thống đang xử lý...", "In điểm tích lũy chi tiết");

                rptTL_DiemTichLuy oReport = new rptTL_DiemTichLuy();
                SqlParameter[]    arrPara = new SqlParameter[2];
                arrPara[0]       = new SqlParameter("@isChiTiet", SqlDbType.Int);
                arrPara[0].Value = 1;
                arrPara[1]       = new SqlParameter("@tblMADT", SqlDbType.Structured);
                arrPara[1].Value = tblKH;

                DataTable otblRpt = new MTSQLServer().wRead("rptTL_TongDiemTL", arrPara);

                Dlg.Close();
                if (otblRpt != null)
                {
                    oReport.DataSource = otblRpt;
                    oReport.BindData();
                    setParameterInfo(oReport);
                    setFormatReport(oReport);
                    SetMarginReport(oReport, true, 30, 30, 30, 25);
                    PrintPreview oPreview = new PrintPreview();
                    oPreview.report = oReport;

                    oPreview.ShowDialog();
                }

                Dlg.Close();
            }
            catch (Exception ex) { }
        }
Exemplo n.º 12
0
 private void btnDongY_Click(object sender, EventArgs e)
 {
     if (txtTenNguyenLieu.Text.Trim().Length == 0)
     {
         DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập Tên Nguyên Liệu !", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtTenNguyenLieu.Focus();
     }
     else
     if (txtDonVi.Text.Trim().Length == 0)
     {
         DevExpress.XtraEditors.XtraMessageBox.Show("Bạn chưa nhập đơn vị nguyên liêu!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtDonVi.Focus();
     }
     else
     {
         _nguyenlieu.TenNL = txtTenNguyenLieu.Text.Trim();
         _nguyenlieu.DonVi = txtDonVi.Text.Trim();
         DevExpress.Utils.WaitDialogForm frmWailt = new DevExpress.Utils.WaitDialogForm("...", "Đang thêm nguyên liệu mới ");
         frmWailt.LookAndFeel.SetSkinStyle("Seven Classic");
         frmWailt.Show();
         if (busNguyenLieu.InsertNguyenLieu(mode, NguyenLieu) == 1)
         {
             frmWailt.Close();
             DevExpress.XtraEditors.XtraMessageBox.Show("Thêm dử liệu thành công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             frmWailt.Close();
             DevExpress.XtraEditors.XtraMessageBox.Show("Thêm dử liệu thất bại!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Exemplo n.º 13
0
        public void rptHH_Baocaonhapxuatton(DataTable oTblSPChon)
        {
            try{
                DevExpress.Utils.WaitDialogForm Dlg = new DevExpress.Utils.WaitDialogForm("Vui lòng chờ, hệ thống đang xử lý...", "In sản phẩm");
                DataTable otblChon = new DataTable();
                otblChon.Columns.Add(new DataColumn("Maspid", typeof(System.String)));
                otblChon.Columns.Add(new DataColumn("Masp", typeof(System.String)));
                foreach (DataRow vsR in oTblSPChon.Rows)
                {
                    DataRow vR = otblChon.NewRow();
                    vR["Maspid"] = vsR["Maspid"];
                    vR["Masp"]   = vsR["Masp"];
                    otblChon.Rows.Add(vR);
                }

                SqlParameter[] arrPara = new SqlParameter[5];
                arrPara[0]           = new SqlParameter("@tblSanpham", SqlDbType.Structured);
                arrPara[0].Value     = otblChon;
                arrPara[1]           = new SqlParameter("@Ngaydau", SqlDbType.NVarChar, 15);
                arrPara[1].Value     = MTGlobal.MT_TUNGAY;
                arrPara[2]           = new SqlParameter("@Ngaycuoi", SqlDbType.NVarChar, 15);
                arrPara[2].Value     = MTGlobal.MT_DENNGAY;
                arrPara[3]           = new SqlParameter("@Nguoidung", SqlDbType.NVarChar, 50);
                arrPara[3].Value     = MTGlobal.MT_USER_LOGIN;
                arrPara[4]           = new SqlParameter("@Ngayin", SqlDbType.NVarChar, 50);
                arrPara[4].Direction = ParameterDirection.Output;
                DataTable otblRpt = new MTSQLServer().wRead("rptHH_Baocaonhapxuatton", arrPara);

                if (otblRpt == null || otblRpt.Rows.Count <= 0)
                {
                    Utils.showMessage("Không tìm thấy dữ liệu...", "Thông báo");
                    Dlg.Close();
                    return;
                }

                rptHH_Baocaonhapxuatton oReport = new rptHH_Baocaonhapxuatton();
                Dlg.Close();
                if (otblRpt != null)
                {
                    oReport.DataSource = otblRpt;
                    oReport.BindData();
                    setParameterInfo(oReport);
                    oReport.Parameters["parThangNam"].Value = arrPara[4].Value.ToString();
                    setFormatReport(oReport);
                    SetMarginReport(oReport, true, 30, 30, 30, 25);

                    PrintPreview oPreview = new PrintPreview();
                    oPreview.report = oReport;
                    oPreview.ShowDialog();
                }
                else
                {
                    Utils.showMessage("Không tìm thấy dữ liệu báo cáo..", "Thông báo");
                }
                Dlg.Close();
            }
            catch (Exception ex) { }
        }
Exemplo n.º 14
0
        void refreshData()
        {
            DevExpress.Utils.WaitDialogForm dlg = new DevExpress.Utils.WaitDialogForm("Ачаалж байна...", "Түр хүлээнэ үү.");

            try
            {
                dlg.Show();

                string whereStr = " WHERE TBLBOOKORDER.REASON <> 0";
                if (txtStudentID.Tag != null)
                {
                    whereStr += " AND TBLBOOKORDER.STUDENTID = '" + Convert.ToString(txtStudentID.Tag) + "'";
                }
                if (txtBookID.Tag != null)
                {
                    whereStr += " AND TBLBOOKORDER.BOOKID = '" + Convert.ToString(txtBookID.Tag) + "'";
                }
                try
                {
                    command             = new SqlCommand();
                    command.Connection  = frmMain.conn;
                    command.CommandText = @"SELECT TBLBOOKORDER.*,
                                                   TBLSTUDENT.CODE      STUDENTCODE,
                                                   TBLSTUDENT.FIRSTNAME STUDENTNAME,
                                                   TBLSTUDENT.LASTNAME,
                                                   TBLSTUDENT.REGNO,
                                                   TBLSTUDENT.GENDER,
                                                   TBLBOOK.CODE         BOOKCODE,
                                                   TBLBOOK.NAME         BOOKNAME
                                              FROM TBLBOOKORDER
                                              LEFT JOIN TBLSTUDENT
                                                ON TBLBOOKORDER.STUDENTID = TBLSTUDENT.STUDENTID
                                              LEFT JOIN TBLBOOK
                                                ON TBLBOOK.BOOKID = TBLBOOKORDER.BOOKID" + whereStr;
                    command.CommandType = CommandType.Text;

                    SqlDataReader dr = command.ExecuteReader();
                    mainTable.Clear();
                    mainTable.Load(dr);
                    frmMain.dataTableColumnNameToUpper(mainTable);
                    gridControl1.DataSource = mainTable;
                    command.Dispose();
                    dlg.Close();
                }
                catch (Exception ex)
                {
                    dlg.Close();
                    DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message);
                }
            }
            catch (Exception ex)
            {
                dlg.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 15
0
        void refreshData()
        {
            DevExpress.Utils.WaitDialogForm dlg = new DevExpress.Utils.WaitDialogForm("Ачаалж байна...", "Түр хүлээнэ үү.");

            try
            {
                dlg.Show();

                string studentID = string.Empty;
                if (txtStudentID.Tag != null)
                {
                    studentID = "WHERE TBLBOOKORDER.STUDENTID = '" + Convert.ToString(txtStudentID.Tag) + "'";
                }
                mainTableDTLGrid = new DataTable();
                adapterDTLGrid   = new SqlDataAdapter("SELECT * FROM TBLBOOKORDER " + (string.IsNullOrEmpty(studentID) ? " WHERE STATUS = '0' " : studentID + " AND STATUS = '0' ") + " ORDER BY CREATED DESC", frmMain.conn);
                builderDTLGrid   = new SqlCommandBuilder(adapterDTLGrid);
                adapterDTLGrid.Fill(mainTableDTLGrid);
                frmMain.dataTableColumnNameToUpper(mainTableDTLGrid);

                mainTableDTLGridView = new DataTable();
                adapterDTLGridView   = new SqlDataAdapter(@"SELECT TBLBOOKORDER.*,
                                                                   TBLSTUDENT.FIRSTNAME             STUDENTNAME,
                                                                   TBLSTUDENT.CODE                  STUDENTCODE,
                                                                   TBLSTUDENT.LASTNAME,
                                                                   TBLSTUDENT.REGNO,
                                                                   TBLSTUDENT.GENDER,
                                                                   TBLBOOK.NAME                     BOOKNAME,
                                                                   TBLBOOK.CODE                     BOOKCODE,
                                                                   TBLBOOKREMAINDER.REMAINDER,
                                                                   TBLBOOKREMAINDER.FIRSTRETURNDATE
                                                              FROM TBLBOOKORDER
                                                              LEFT JOIN TBLSTUDENT
                                                                ON TBLSTUDENT.STUDENTID = TBLBOOKORDER.STUDENTID
                                                              LEFT JOIN TBLBOOK
                                                                ON TBLBOOK.BOOKID = TBLBOOKORDER.BOOKID
                                                              LEFT JOIN TBLBOOKREMAINDER
                                                                ON TBLBOOKREMAINDER.BOOKID = TBLBOOK.BOOKID
                                                             " + (string.IsNullOrEmpty(studentID) ? " WHERE TBLBOOKORDER.STATUS = '0' " : studentID + " AND TBLBOOKORDER.STATUS = '0' ") + @"
                                                             ORDER BY TBLBOOKORDER.CREATED", frmMain.conn);
                adapterDTLGridView.Fill(mainTableDTLGridView);
                frmMain.dataTableColumnNameToUpper(mainTableDTLGridView);
                gridControl1.DataSource = mainTableDTLGridView;

                barSave.Enabled    = false;
                barCancel.Enabled  = false;
                barRefresh.Enabled = true;

                dlg.Close();
            }
            catch (Exception ex)
            {
                dlg.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 16
0
        private bool Save()
        {
            if (!IsFieldValueValid())
            {
                return(false);
            }
            bool success = false;

            DevExpress.Utils.WaitDialogForm waitForm = new DevExpress.Utils.WaitDialogForm("正在更新容器数据...", "请稍候...");
            try
            {
                ContainerEntity editEntity = PrepareSave();
                //int ret = containerDal.SaveContainerCode(editEntity, isNew, Utils.ConvertUtil.ToInt(txtNum.Text));
                //if (ret == -1)
                //    MsgBox.Warn("容器编号已存在,请改为其他的容器编号。");
                //else if (ret == 0)
                //    MsgBox.Warn("未更新任何容器。");
                //else
                if (isNew)
                {
                    int ret = AddInfo(editEntity, isNew, Utils.ConvertUtil.ToInt(txtNum.Text));
                    if (ret == 0)
                    {
                        MsgBox.Warn("未更新任何容器。");
                    }
                    else
                    {
                        success = true;
                        if (DataSourceChanged != null)
                        {
                            DataSourceChanged(editEntity, null);
                        }
                        MsgBox.OK(string.Format("已更新{0}个容器。", ret));
                    }
                }
                else
                {
                    bool ret = SaveUpdateContainerInfo(editEntity, isNew, Utils.ConvertUtil.ToInt(txtNum.Text));
                    success = true;
                    if (DataSourceChanged != null)
                    {
                        DataSourceChanged(editEntity, null);
                    }
                    MsgBox.OK(string.Format("已更新{0}个容器。", 1));
                }
                waitForm.Close();
            }
            catch (Exception ex)
            {
                waitForm.Close();
                MsgBox.Err(ex.Message);
            }
            return(success);
        }
Exemplo n.º 17
0
 public void showWaiting(String msg)
 {
     try
     {
         if (Dlg != null)
         {
             Dlg.Close();
             Dlg = null;
         }
         Dlg = new DevExpress.Utils.WaitDialogForm("Vui lòng chờ, hệ thống đang xử lý...", "PHẦN MỀM QUẢN LÝ KHO");
         Dlg.Show();
     }
     catch (Exception ex) { }
 }
Exemplo n.º 18
0
        private void btnReGenPass_Click(object sender, EventArgs e)
        {
            if (txtUserName.EditValue == null)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show("<Нэвтрэх нэр> талбарт утга оруулах шаардлагатай!");
                return;
            }
            try
            {
                string userid        = Convert.ToString(txtUserName.EditValue);
                string your_id       = ConfigurationSettings.AppSettings["SystemEmail"];
                string your_password = ConfigurationSettings.AppSettings["SystemEmailPassword"];

                DevExpress.Utils.WaitDialogForm dlg = new DevExpress.Utils.WaitDialogForm("Имэйл илгээж байна....", "Түр хүлээнэ үү.");
                dlg.Show();

                SmtpClient client = new SmtpClient
                {
                    Host           = "smtp.gmail.com",
                    Port           = 587,
                    EnableSsl      = true,
                    DeliveryMethod = SmtpDeliveryMethod.Network,
                    Credentials    = new System.Net.NetworkCredential(your_id, your_password),
                    Timeout        = 10000,
                };
                string[] retMessage = getLoginPassword(userid);
                if (retMessage[0] == "Бүртгэлгүй хэрэглэгч байна.")
                {
                    dlg.Close();
                    DevExpress.XtraEditors.XtraMessageBox.Show("Бүртгэлгүй хэрэглэгч байна.");
                    client.Dispose();
                    return;
                }
                if (txtUserName.Text.Equals("Administrator"))
                {
                    retMessage[1] = ConfigurationSettings.AppSettings["AdminEmail"];
                }
                MailMessage mm = new MailMessage(your_id, retMessage[1], "УБТЗ номын сангийн хэрэглэгчийн нууц үг", "Хэрэглэгч: " + userid + '\n' + "Нууц үг: " + retMessage[0]);
                mm.BodyEncoding = UTF8Encoding.UTF8;
                client.Send(mm);
                dlg.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show(retMessage[1] + " имэйл рүү амжилттай илгээлээ.");
                client.Dispose();
            }
            catch (Exception ex)
            {
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 19
0
        public void rptNX_Thongkeguichanh(DataTable otblPhieuChon, String mNgaydau = "", String mNgaycuoi = "")
        {
            try{
                DevExpress.Utils.WaitDialogForm Dlg = new DevExpress.Utils.WaitDialogForm("Vui lòng chờ, hệ thống đang xử lý...", "Thống kê gửi chành");

                DataTable otblChon = new DataTable();
                otblChon.Columns.Add(new DataColumn("Sophieu", typeof(System.String)));
                foreach (DataRow vsR in otblPhieuChon.Rows)
                {
                    DataRow vR = otblChon.NewRow();
                    vR["Sophieu"] = vsR["Sophieu"];
                    otblChon.Rows.Add(vR);
                }

                rptCX_Thongkeguichanh oReport = new rptCX_Thongkeguichanh();

                SqlParameter[] arrPara = new SqlParameter[4];
                arrPara[0]       = new SqlParameter("@tblSophieu", SqlDbType.Structured);
                arrPara[0].Value = otblChon;
                arrPara[1]       = new SqlParameter("@Ngaydau", SqlDbType.NVarChar, 15);
                arrPara[1].Value = mNgaydau;
                arrPara[2]       = new SqlParameter("@Ngaycuoi", SqlDbType.NVarChar, 15);
                arrPara[2].Value = mNgaycuoi;
                arrPara[3]       = new SqlParameter("@Nguoidung", SqlDbType.NVarChar, 50);
                arrPara[3].Value = MTGlobal.MT_USER_LOGIN;
                DataTable otblRpt = new MTSQLServer().wRead("rptNX_Thongkeguichanh", arrPara);

                Dlg.Close();
                if (otblRpt != null)
                {
                    oReport.DataSource = otblRpt;
                    oReport.BindData();

                    setParameterInfo(oReport);

                    setFormatReport(oReport);
                    SetMarginReport(oReport, true, 30, 30, 30, 25);

                    PrintPreview oPreview = new PrintPreview();
                    oPreview.report = oReport;

                    oPreview.ShowDialog();
                }

                Dlg.Close();
            }
            catch (Exception ex) { }
        }
Exemplo n.º 20
0
        private void PermitView_Load(object sender, EventArgs e)
        {
            this.btnClose.Left = this.Width - this.btnClose.Width - 30;
            this.btnOK.Left    = this.btnClose.Left - this.btnOK.Width - 10;
            roleGridEdit1.LoadData();
            treeCtl1.AfterCheckNode += treeCtl1_AfterCheckNode; treeCtl1.Enabled = false;
            t_menu mnu;

            using (var db = new Database())
            {
                mnu = db.FirstOrDefault <t_menu>("select * from t_menu");
                //解析菜单XML
                treeCtl1.ClearNodes();
                ExtractMenu(mnu.MenuXml);
            }
            dlg = new DevExpress.Utils.WaitDialogForm("正在加载权限设置信息 ...",
                                                      "数据加载中");


            var t = new Thread(() =>
            {
                //加载菜单
                this.Invoke(new Action(() =>
                {
                    BuildlRoleTree(); Visible = true;
                }));
                this.Invoke(new Action(() => dlg.Close()));
            });

            t.SetApartmentState(ApartmentState.STA);
            t.IsBackground = true;
            t.Start();
        }
Exemplo n.º 21
0
        private void btnImp_Click(object sender, EventArgs e)
        {
            if (MsgBox.ShowYesNoMessage("", "确定要导入吗?") == System.Windows.Forms.DialogResult.No)
                return;
            var dlg = new DevExpress.Utils.WaitDialogForm("正在导入,请稍候...", "导入");
            try {
                var ds = GridControl.GetDataSource<t_item>();
                if (null == ds || ds.Count < 1)
                    return;
                //var gid = Guid.NewGuid();
                ds.ForEach(j => {
                    j.Guid = Guid.NewGuid();
                });

                //插入临时表

                //同步到正式表

            } catch (Exception) {

                throw;
            } finally {
                dlg.Close();
            }
            MsgBox.ShowMessage("", "导入已完成!");
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }
Exemplo n.º 22
0
        public IEnumerable <Object> getAllEmployeeNotChecked(Int64 id)
        {
            var dlg = new DevExpress.Utils.WaitDialogForm("Đang tải dữ liệu ...", "Thông báo");

            try
            {
                db.Dispose( );
                db = new DTO.DataClasses1DataContext( );
                db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues);
                var datasource = from emp in db.ST_employees
                                 join dep in db.ST_departments on emp.department_id equals dep.department_id
                                 where !(from citem in db.ST_detail_employee_constructions
                                         select citem.employee_id).Contains(emp.employee_id)
                                 select new {
                    emp.employee_id, emp.employee_id_custom, emp.employee_name, emp.employee_address, emp.employee_date_of_birth, emp.employee_phone, dep.department_name, dep.department_price, emp.employee_status
                };

                return(datasource);
            }
            catch (Exception)
            {
                return(null);
            }
            finally
            {
                dlg.Close( );
            }
        }
Exemplo n.º 23
0
 private void PermitView_Load(object sender, EventArgs e) {
     this.btnClose.Left = this.Width - this.btnClose.Width - 30;
     this.btnOK.Left = this.btnClose.Left - this.btnOK.Width - 10;
     roleGridEdit1.LoadData();
     treeCtl1.AfterCheckNode += treeCtl1_AfterCheckNode;
     treeCtl1.Enabled = false;
     var menu = Db.FirstOrDefault<t_menu>(" where version='1.0'");
     //解析菜单Json
     var menus = ObjectHelper.DeSerialize<List<MenuData>>(menu.MenuJson);
     treeCtl1.ClearNodes();
     ExtractMenu(menus);
     dlg = new DevExpress.Utils.WaitDialogForm("正在加载权限设置信息 ...",
         "数据加载中");
     var t = new Thread(() => {
         //加载菜单
         this.Invoke(new Action(() => {
             BuildlRoleTree();
             Visible = true;
         }));
         this.Invoke(new Action(() => dlg.Close()));
     });
     t.SetApartmentState(ApartmentState.STA);
     t.IsBackground = true;
     t.Start();
 }
Exemplo n.º 24
0
 public static void CloseWaitDialog()
 {
     if (Dlg != null)
     {
         Dlg.Close();
     }
 }
Exemplo n.º 25
0
 public static void Loaded()
 {
     if (dlg != null)
     {
         dlg.Close();
     }
 }
Exemplo n.º 26
0
        public void ExecuteScript( )
        {
            if (ScriptTabControl.SelectedTabPage == null)
            {
                return;
            }

            Scintilla rtbScript = (Scintilla)ScriptTabControl.SelectedTabPage.Controls[0];
            String    stQuery   = rtbScript.Selection.Text.Trim();

            if (String.IsNullOrEmpty(stQuery))
            {
                stQuery = rtbScript.Text;
            }

            if (String.IsNullOrEmpty(stQuery))
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;
            DevExpress.Utils.WaitDialogForm waiting = new DevExpress.Utils.WaitDialogForm();
            waiting.SetCaption("Executing . . .!");
            waiting.Show();

            DataSet ds = DataQueryProvider.RunQuery(stQuery);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count == 1)
            {
                ResultRichText.Text = ds.Tables[0].Rows[0][0].ToString();
            }

            waiting.Close();
            Cursor.Current = Cursors.Default;
        }
Exemplo n.º 27
0
        private void btnImp_Click(object sender, EventArgs e)
        {
            if (MsgBox.ShowYesNoMessage("确定要导入吗?") == System.Windows.Forms.DialogResult.No) return;
            var dlg = new DevExpress.Utils.WaitDialogForm("正在导入,请稍候...","导入");
            try {
                var ds = GridControl.GetDataSource<UltraDbEntity.T_ERP_ItemPrice_Impt>();
                if (null == ds || ds.Count < 1) return;
                //var gid = Guid.NewGuid();
                ds.ForEach(j => {
                    j.Guid = Guid.NewGuid();
                    j.Updator = j.Creator = CurUser;

                    j.Reserved1 = 0; j.Reserved2 = string.Empty; j.Remark = string.Empty; j.Reserved3 = false;
                });
                var rd = SerNoCaller.Calr_ItemPrice_Impt.Add(ds);
                if (!rd.IsOK) {
                    MsgBox.ShowErrMsg(rd.ErrMsg); return;
                }

                //执行同步
                SerNoCaller.Calr_ItemPrice_Impt.ExecSql("exec P_FAS_SyncItemPriceImpt");

            } catch (Exception) {

                throw;
            } finally {
                dlg.Close();
            }
            MsgBox.ShowMessage("导入已完成!");
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }
Exemplo n.º 28
0
        private void btnImp_Click(object sender, EventArgs e)
        {
            if (MsgBox.ShowYesNoMessage("", "确定要导入吗?") == System.Windows.Forms.DialogResult.No)
            {
                return;
            }
            var dlg = new DevExpress.Utils.WaitDialogForm("正在导入,请稍候...", "导入");

            try {
                var ds = GridControl.GetDataSource <t_item>();
                if (null == ds || ds.Count < 1)
                {
                    return;
                }
                //var gid = Guid.NewGuid();
                ds.ForEach(j => {
                    j.Guid = Guid.NewGuid();
                });

                //插入临时表

                //同步到正式表
            } catch (Exception) {
                throw;
            } finally {
                dlg.Close();
            }
            MsgBox.ShowMessage("", "导入已完成!");
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }
Exemplo n.º 29
0
        private void PermitView_Load(object sender, EventArgs e)
        {
            this.btnClose.Left = this.Width - this.btnClose.Width - 30;
            this.btnOK.Left    = this.btnClose.Left - this.btnOK.Width - 10;
            roleGridEdit1.LoadData();
            treeCtl1.AfterCheckNode += treeCtl1_AfterCheckNode;
            treeCtl1.Enabled         = false;
            var menu = Db.FirstOrDefault <t_menu>(" where version='1.0'");
            //解析菜单Json
            var menus = ObjectHelper.DeSerialize <List <MenuData> >(menu.MenuJson);

            treeCtl1.ClearNodes();
            ExtractMenu(menus);
            dlg = new DevExpress.Utils.WaitDialogForm("正在加载权限设置信息 ...",
                                                      "数据加载中");
            var t = new Thread(() => {
                //加载菜单
                this.Invoke(new Action(() => {
                    BuildlRoleTree();
                    Visible = true;
                }));
                this.Invoke(new Action(() => dlg.Close()));
            });

            t.SetApartmentState(ApartmentState.STA);
            t.IsBackground = true;
            t.Start();
        }
Exemplo n.º 30
0
 private void AddLargedataAnalysis_Load(object sender, EventArgs e)
 {
     DevExpress.Utils.WaitDialogForm wdf = new DevExpress.Utils.WaitDialogForm("正在打开大数据分析模型编辑窗体...", "请等待...");
     // 初始化窗体
     LoadForm(largedataAnalysisId);
     wdf.Close();
 }
Exemplo n.º 31
0
        private void btnQueryPrograms_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string CreatorName = this.bItemUserName.EditValue.ToString().Trim();

            if (CreatorName == null || CreatorName.Length <= 0)
            {
                XtraMessageBox.Show("请输入用户名!", "提示!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            gcPrograms.DataSource = null;
            UserInfo _UserInfo = GetUserInfoByLoginName(CreatorName);

            if (_UserInfo != null)
            {
                DevExpress.Utils.WaitDialogForm dlg = new DevExpress.Utils.WaitDialogForm("用户:" + CreatorName + " 的节目", "正在查询", new Size(150, 50), this);
                DataTable dt = GetProgramsByCreatorUserID(_UserInfo.UserID);
                gcPrograms.DataSource = dt;
                dlg.Close();
                if (dt != null && dt.Rows.Count > 0)
                {
                    lblQueryInfo.Visibility = BarItemVisibility.Always;
                    lblQueryInfo.Caption    = "用户:" + _UserInfo.UserName + "(" + _UserInfo.FullName + ") 的节目数量为" + dt.Rows.Count;
                }
                else
                {
                    lblQueryInfo.Visibility = BarItemVisibility.Never;
                }
            }
            else
            {
                lblQueryInfo.Visibility = BarItemVisibility.Never;
                XtraMessageBox.Show("未找到用户:" + this.bItemUserName.EditValue.ToString().Trim(), "提示!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemplo n.º 32
0
        public void BarManager_ItemClick(object sender, EventArgs e)
        {
            DevExpress.Utils.WaitDialogForm WaitDialogForm = new DevExpress.Utils.WaitDialogForm();

            string formName = "";
            string formText = "";

            if (e.GetType() == typeof(DevExpress.XtraNavBar.NavBarLinkEventArgs))
            {
                formName = ((DevExpress.XtraNavBar.NavBarItem)sender).Name;
                formText = ((DevExpress.XtraNavBar.NavBarItem)sender).Caption;
            }
            else if (e.GetType() == typeof(DevExpress.XtraBars.ItemClickEventArgs))
            {
                formName = ((DevExpress.XtraBars.ItemClickEventArgs)e).Item.Name;
                formText = ((DevExpress.XtraBars.ItemClickEventArgs)e).Item.Caption;
            }

            switch (formName)
            {
            case "FrmControlPanel":
                FrmControlPanel = (Forms.FrmControlPanel)itvs.Windows.MdiUtils.MdiChecker.GetMdiChilden(mdiParent, "FrmControlPanel");

                if (FrmControlPanel == null || FrmControlPanel.IsDisposed)
                {
                    FrmControlPanel = new Forms.FrmControlPanel();
                }
                FrmControlPanel.Text      = formText;
                FrmControlPanel.MdiParent = mdiParent;
                FrmControlPanel.Show();
                FrmControlPanel.Activate();
                break;
            }
            WaitDialogForm.Close();
        }
Exemplo n.º 33
0
        public void BarManager_ItemClick(object sender, EventArgs e)
        {
            DevExpress.Utils.WaitDialogForm WaitDialogForm = new DevExpress.Utils.WaitDialogForm();

            string formName = "";
            string formText = "";

            if (e.GetType() == typeof(DevExpress.XtraNavBar.NavBarLinkEventArgs))
            {
                formName = ((DevExpress.XtraNavBar.NavBarLinkEventArgs)e).Link.ItemName;
                formText = ((DevExpress.XtraNavBar.NavBarLinkEventArgs)e).Link.Caption;
            }
            else
            if (e.GetType() == typeof(DevExpress.XtraBars.ItemClickEventArgs))
            {
                formName = ((DevExpress.XtraBars.ItemClickEventArgs)e).Item.Name;
                formText = ((DevExpress.XtraBars.ItemClickEventArgs)e).Item.Caption;
            }
            else
            {
                formName = ((System.Windows.Forms.Control)sender).Name;
                formText = ((System.Windows.Forms.Control)sender).Text;
            }
            //switch (formName)
            //{

            //}
            WaitDialogForm.Close();
        }
Exemplo n.º 34
0
        public IEnumerable <Object> getAllUserByDepartment(Int64 id)
        {
            var dlg = new DevExpress.Utils.WaitDialogForm("Đang tải dữ liệu ...", "Thông báo");

            try{
                db.Dispose( );
                db = new DataClasses1DataContext( );
                db.Refresh(System.Data.Linq.RefreshMode.OverwriteCurrentValues);

                var data = from b in db.ST_employees
                           where b.department_id == id
                           select b;

                if (data != null)
                {
                    return(data);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                return(null);
            }
            finally{
                dlg.Close( );
            }
        }
Exemplo n.º 35
0
        private void EdtView_Load(object sender, EventArgs e)
        {
            treeCtl1.Enabled = false;
            gtRole.Properties.DataSource = SerNoCaller_WL.Calr_Role.Get("where IsDel=0");

            dlg = new DevExpress.Utils.WaitDialogForm("正在加载权限设置信息 ...",
              "数据加载中");

            if (IsNewMenu) {
                var t = new Thread(() => {
                    this.Invoke(new Action(() => {
                        ExtractMenuNew();
                        BuildlRoleTree();
                        Visible = true;
                    }));
                });
                this.Invoke(new Action(() => dlg.Close()));
                t.SetApartmentState(ApartmentState.STA);
                t.IsBackground = true;
                t.Start();
            } else {
                var t = new Thread(() => {
                _redo:
                    var mnu = this.Cacher.Get<string>("SYS.Menu");
                    var rolexml = Lanucher.Cache.Get<string>("Ultra.KY.RS");
                    bool donerolexml = !string.IsNullOrEmpty(rolexml);
                    if (!donerolexml) {
                        Thread.Sleep(800);
                        goto _redo;
                    }

                    //加载菜单
                    this.Invoke(new Action(() => {
                        ExtractMenu(mnu);
                        BuildlRoleTree();
                        //treeCtl1.ImportFromXml(rolexml);
                        Visible = true;
                    }));
                    this.Invoke(new Action(() => dlg.Close()));
                });
                t.SetApartmentState(ApartmentState.STA);
                t.IsBackground = true;
                t.Start();
            }
        }
Exemplo n.º 36
0
        private void btnImp_Click(object sender, EventArgs e)
        {
            if (MsgBox.ShowYesNoMessage("确定要导入吗?") == System.Windows.Forms.DialogResult.No) return;
            var dlg = new DevExpress.Utils.WaitDialogForm("正在导入,请稍候...","导入");
            try {
                var ds = GridControl.GetDataSource<T_ERP_ProduceDosageIpt>();
                if (null == ds || ds.Count < 1) return;
                var session = Guid.NewGuid();
                List<T_ERP_ProduceDosageIptTemp> ipts = new List<T_ERP_ProduceDosageIptTemp>();
                ds.ForEach(j => {
                    var ipt = new T_ERP_ProduceDosageIptTemp
                    {
                        Session = session,
                        OuterIid = j.OuterIid,
                        OuterSkuId = j.OuterSkuId,
                        ProcedureName = j.ProcedureName,
                        MaterialNo = j.MaterialNo,
                        MaterialName = j.MaterialName,
                        Dosage = j.Dosage,
                        Unit = j.Unit
                    };
                    ipts.Add(ipt);
                });

                using (SqlConnection destinationConnection = new SqlConnection(this.ConnString))
                {
                    destinationConnection.Open();
                    using (SqlBulkCopy bulkCopy =
                               new SqlBulkCopy(destinationConnection))
                    {
                        bulkCopy.DestinationTableName = "T_ERP_ProduceDosageIpt";
                        try
                        {
                            bulkCopy.WriteToServerAdv(ipts);
                        }
                        catch (Exception ex)
                        {
                            MsgBox.ShowErrMsg("导入失败;错误信息:" + ex.Message);
                            return;
                        }
                    }
                }

                //导入成功,调用迁移过程
                var prms = new SqlParameter[]{
                            new SqlParameter("@session", session),
                            new SqlParameter("@user", this.CurUser)
                        };
                SqlHelper.ExecuteNonQuery(this.ConnString, CommandType.StoredProcedure, "P_FAS_ProduceDosageImpt", prms);
            } catch (Exception) {
                throw;
            } finally {
                dlg.Close();
            }
            MsgBox.ShowMessage("导入已完成!");
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }
Exemplo n.º 37
0
        private void fileBrowser1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var dc = DicKF;
            if (null == DicKF) return;
            //读取文件数据
            var dlg = new DevExpress.Utils.WaitDialogForm("正在加载数据,请稍候...", "导入");
            try {
                var ipitm = XlsCommon.Read<T_ERP_ProduceDosageIpt>(fileBrowser1.Text, DicKF);
                this.GridControl.DataSource = ipitm;
            } catch (Exception) {

                throw;
            } finally {
                dlg.Close();
            }
        }
Exemplo n.º 38
0
        private void fileBrowser1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (null == FieldsMapper)
                return;

            var filedlg = new OpenFileDialog();
            filedlg.Filter = this.FileFilter;
            if (filedlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
                fileBrowser1.Text = filedlg.FileName;
                //读取文件数据
                var dlg = new DevExpress.Utils.WaitDialogForm("正在加载数据,请稍候...", "导入");
                try {
                    var ipitm = ExcelCommon.ReadXls<t_item>(fileBrowser1.Text, FieldsMapper);
                    this.GridControl.DataSource = ipitm;
                } catch (Exception) {

                    throw;
                } finally {
                    dlg.Close();
                }
            }
        }
Exemplo n.º 39
0
        private void PermitView_Load(object sender, EventArgs e)
        {
            this.btnClose.Left = this.Width - this.btnClose.Width - 30;
            this.btnOK.Left = this.btnClose.Left - this.btnOK.Width - 10;
            roleGridEdit1.LoadData();
            treeCtl1.AfterCheckNode += treeCtl1_AfterCheckNode; treeCtl1.Enabled = false;
            t_menu mnu;
            using (var db = new Database())
            {
                mnu = db.FirstOrDefault<t_menu>("select * from t_menu");
                //解析菜单XML
                treeCtl1.ClearNodes();
                ExtractMenu(mnu.MenuXml);
            }
            dlg = new DevExpress.Utils.WaitDialogForm("正在加载权限设置信息 ...",
                "数据加载中");

            var t = new Thread(() =>
            {
                //加载菜单
                this.Invoke(new Action(() =>
                {
                    BuildlRoleTree(); Visible = true;
                }));
                this.Invoke(new Action(() => dlg.Close()));
            });
            t.SetApartmentState(ApartmentState.STA);
            t.IsBackground = true;
            t.Start();
        }
Exemplo n.º 40
0
        private void btnThucHien_Click(object sender, EventArgs e)
        {
            if (checkAllowUpdate() == false) return;

            DevExpress.Utils.WaitDialogForm wait = null;
            try
            {
                this.btnThoat.Enabled = false;
                #region Lấy thông tin local version
                int localVersion = -1;
                if (FrameworkParams.IsUpdateVersionAtLocalServer)
                {
                    localVersion = LiveUpdateHelper.getVersionFromCustomerServer();
                    if (localVersion == -1)
                    {
                        LiveUpdateHelper.initDataStructure();
                        localVersion = 0;
                    }
                }
                else
                {
                    localVersion = LiveUpdateHelper.getLocalhostVersion();
                }
                #endregion

                #region Lấy thông tin newVersion
                int newVersion = -1;
                if (!rdoURL.Checked)
                    newVersion = LiveUpdateHelper.getVersionFromZipFile(btnEditFileDuLieu.EditValue.ToString());
                else
                    newVersion = LiveUpdateHelper.getVersionFromProtocolServer();

                if (newVersion == -1)
                {
                    HelpMsgBox.ShowNotificationMessage("Có lỗi trong quá trình cập nhật. \n Vui lòng thử lại sau.");
                    return;
                }
                #endregion

                #region Kiểm tra nếu có phiên bản mới hay ko
                if (localVersion < newVersion)
                {
                    if (FrameworkParams.IsUpdateVersionAtLocalServer == false)
                    {
                        if (PLMessageBox.ShowConfirmMessage(this.thongBaoHoiCoCapNhatMoi) != DialogResult.Yes)
                        {
                            return;
                        }
                    }
                    else
                    {
                        //Cập nhật thẳng không hỏi ???
                    }
                }
                else if (localVersion == newVersion)
                {
                    HelpMsgBox.ShowNotificationMessage("Phiên bản phần mềm đang sử dụng là mới nhất.");
                    return;
                }
                else
                {
                    if(PLMessageBox.ShowConfirmMessage(this.thongBaoHoiCoCapNhatCu) != DialogResult.Yes)
                    {
                        return;
                    }
                    return;
                }
                #endregion

                #region Lấy dữ liệu cập nhật (từ HTTP SERVER || Từ localfile)
                wait = new DevExpress.Utils.WaitDialogForm("Đang xử lý ...", "");
                //Nếu URL != null thì sẽ lấy dữ liệu từ URL về máy cục bộ thông qua giao thức HTTP
                if (this.rdoURL.Checked)
                {
                    String URL = LiveUpdateHelper.getVersionURLFromProtocolServer();
                    //Quá trình download tập tin từ mạng
                    if (!downloadFileFromURL(URL))
                    {
                        //wait.Close();
                        HelpMsgBox.ShowNotificationMessage("Có lỗi trong quá trình cập nhật. \n Vui lòng thử lại sau.");
                        return;
                    }
                }
                else
                {
                    //Quá trình download tập tin từ cục bộ
                }

                #endregion

                #region Cập nhật phiên bản mới vào máy chủ Nội bộ
                if (FrameworkParams.IsUpdateVersionAtLocalServer)
                {
                    FileStream fileReader = null;
                    if (!rdoURL.Checked)
                        fileReader = new FileStream(btnEditFileDuLieu.EditValue.ToString(), FileMode.Open, FileAccess.Read);
                    else
                        fileReader = new FileStream(zipFilePath, FileMode.Open, FileAccess.Read);

                    byte[] fileByte = new byte[(int)fileReader.Length];
                    fileReader.Read(fileByte, 0, System.Convert.ToInt32(fileReader.Length));
                    fileReader.Flush();
                    fileReader.Close();

                    DatabaseFB db = DABase.getDatabase();
                    DbCommand command = DABase.getDatabase().GetSQLStringCommand("UPDATE FW_LIVE_UPDATE SET FILECONTENT = @file, VERSION = @newversion WHERE ID=1");
                    db.AddInParameter(command, "@newversion", DbType.Int16, newVersion);
                    db.AddInParameter(command, "@file", DbType.Binary, fileByte);

                    if (db.ExecuteNonQuery(command) == 0)
                    {
                        db = DABase.getDatabase();
                        command = DABase.getDatabase().GetSQLStringCommand("INSERT INTO FW_LIVE_UPDATE VALUES(1, @file, @newversion)");
                        db.AddInParameter(command, "@newversion", DbType.Int16, newVersion);
                        db.AddInParameter(command, "@file", DbType.Binary, fileByte);
                        db.ExecuteNonQuery(command);
                    }
                }
                #endregion

                #region Cập nhật vào Localhost
                else
                {
                    if (!rdoURL.Checked)
                    {
                        if (File.Exists(LiveUpdateHelper.UPDATE_DOWNLOAD_VERSION_ZIP_FILE))
                        {
                            File.Delete(LiveUpdateHelper.UPDATE_DOWNLOAD_VERSION_ZIP_FILE);
                        }

                        if (Directory.Exists(LiveUpdateHelper.UPDATE_DOWNLOAD_FOLDER) == false)
                            Directory.CreateDirectory(LiveUpdateHelper.UPDATE_DOWNLOAD_FOLDER);

                        File.Copy(btnEditFileDuLieu.EditValue.ToString(),
                            LiveUpdateHelper.UPDATE_DOWNLOAD_VERSION_ZIP_FILE);
                    }
                }
                #endregion
                if (FrameworkParams.IsUpdateVersionAtLocalServer == true)
                {
                    HelpMsgBox.ShowNotificationMessage("Đã cập nhật thành công. \nVui lòng cập nhật phiên bản mới từ máy chủ nội bộ.");
                }
                else
                {
                    LiveUpdateHelper.updateNewVersionHelper(FrameworkParams.IsUpdateVersionAtLocalServer, "" + newVersion);
                }
            }
            catch (Exception ex)
            {
                HelpMsgBox.ShowNotificationMessage("Có lỗi trong quá trình cập nhật. \nVui lòng thử lại sau.");
            }
            finally
            {
                if(wait != null ) wait.Close();
                btnCapNhat.Enabled = false;
                btnThoat.Enabled = true;
            }
        }
        public void LoadDuLieu()
        {
            DataSet temp = new DataSet();
                DevExpress.Utils.WaitDialogForm frmWailt = new DevExpress.Utils.WaitDialogForm("...","Đang Load Dử liệu ");
                frmWailt.LookAndFeel.SetSkinStyle("Seven Classic");
                frmWailt.Show();
                temp = busNguyenLieu.SelectNguyenLieu_NCC(mode, dtoNCC.MaNCC, maNH);
                frmWailt.Close();
                dtNguyenLieuChon_Source = temp.Tables[0];
                DtNguyenLieu = temp.Tables[1];

                Load_lvNguyenLieuChon();
                Load_lvNguyenLieu();
        }
Exemplo n.º 42
0
 public void CapNhatNhaCungCap()
 {
     frmNhaCungCap_Them_CapNhat _frm = new frmNhaCungCap_Them_CapNhat();
         _frm.Flag = 2;
         _frm.MaNH = maNH;
         _frm.DtoNCC = lsNCC[indexNCC];
         _frm.Mode = mode;
         if (_frm.ShowDialog() == DialogResult.OK)
         {
             DataTable dtNguyenLieu = _frm.DtNguyenLieuChon;
             VNhaCungCap_DTO dtoNCC = _frm.DtoNCC;
             DevExpress.Utils.WaitDialogForm frmWailt = new DevExpress.Utils.WaitDialogForm(""," Đang Cập Nhật Thông Tin Nhà Cung Cấp ");
             frmWailt.LookAndFeel.SetSkinStyle("Seven Classic");
             try
             {
                 frmWailt.Show();
                 int result = busNhaCungCap.UpdatetNhaCungCap(mode, _frm.DtoNCC, _frm.DtChiTietNCC);
                 if (result == 0)
                 {
                     DevExpress.XtraEditors.XtraMessageBox.Show("Cập nhật nhà cung cấp không thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
                 else
                 {
                     frmWailt.Close();
                     LoadNhaCungCap();
                     LoadNguyenLieu(lsNCC[sttNCC - 1].MaNCC);
                     DevExpress.XtraEditors.XtraMessageBox.Show("Cập nhật nhà cung cấp thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 }
             }
             catch (Exception)
             {
                 frmWailt.Close();
                 DevExpress.XtraEditors.XtraMessageBox.Show("Cập nhật nhà cung cấp không thành công", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
 }
Exemplo n.º 43
0
        public void XoaNhaCungCap()
        {
            if (DevExpress.XtraEditors.XtraMessageBox.Show("Bạn có chắc là xóa nhà cung cấp này không", "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    //try
                    //{
                        DevExpress.Utils.WaitDialogForm frmWailt = new DevExpress.Utils.WaitDialogForm();
                        frmWailt.Caption = " Đang cập nhật dữ liệu ! ";
                        frmWailt.Show();
                        int result = busNhaCungCap.DeleteNhaCungCap(mode, lsNCC[indexNCC].MaNCC);
                        frmWailt.Close();
                        if (result == 1)
                        {
                            LoadNhaCungCap();

                            DevExpress.XtraEditors.XtraMessageBox.Show("Đã xóa nhà cung cấp", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        else
                            if (result == -1)
                                DevExpress.XtraEditors.XtraMessageBox.Show("Không thể xóa nhà cung cấp này \n Ghi chú :không thể xóa nhà cung cấp khi thông tin nhà cung cấp được sử dụng trong đơn đặt hàng", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            else
                                DevExpress.XtraEditors.XtraMessageBox.Show("Xóa  nhà cung cấp thất bại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //}
                    //catch (Exception)
                    //{
                    //    DevExpress.XtraEditors.XtraMessageBox.Show("Xóa nhà cung cấp thất bại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    //}
                }
        }
Exemplo n.º 44
0
        private void btnNhapHang_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            DevExpress.Utils.WaitDialogForm frmWailt = new DevExpress.Utils.WaitDialogForm("...", "Đang thêm phiếu nhập kho mới ");
            frmWailt.LookAndFeel.SetSkinStyle("Seven Classic");

            try
            {
                frmWailt.Show();
                if (busDatHang.UpdateTinhTrangDatHang(mode, lsDatHang[sttDH - 1].MaHoaDon, "Đã Giao") == 1)
                {
                    frmWailt.Close();
                    DevExpress.XtraEditors.XtraMessageBox.Show("Thêm phiếu nhập kho thành công!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    frmWailt.Close();
                    DevExpress.XtraEditors.XtraMessageBox.Show("Thêm phiếu nhập khothất bại!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                frmWailt.Close();
                DevExpress.XtraEditors.XtraMessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Information);

            }
        }
Exemplo n.º 45
0
 private void btnPrt_Click(object sender, EventArgs e)
 {
     PrtPreView = false;
     PrintSession = Guid.NewGuid();
     var dlg = new DevExpress.Utils.WaitDialogForm("正在处理打印数据 ...",
      "正在打印");
     //打印单据
     var errflag = false;
     try {               //生成打印的数据
         if (errflag = GenData()) {
             if (cmbPrtTemp.SelectedItem.ToString().Equals("标准模板")) {
                 //打印单据
                 DoStdPrint(PrtPreView);
             } else if (cmbPrtTemp.SelectedItem.ToString().Equals("床垫模板")) {
                 DoCDPrint(PrtPreView);
             }
         }
     } catch (Exception) {
         RefreashPrintOrder();
         throw;
     } finally {
         dlg.Close();
     }
     if (errflag) {
         RefreashPrintOrder();
         MsgBox.ShowMessage("打印完成!");
     }
 }
Exemplo n.º 46
0
        private void btnPrtPreView_Click(object sender, EventArgs e)
        {
            PrtPreView = true;
            PrintSession = Guid.NewGuid();
            var dlg = new DevExpress.Utils.WaitDialogForm("正在处理打印数据 ...",
             "正在打印");
            //打印单据
            var errflag = false;
            try {               //生成打印的数据
                if (errflag = GenData()) {
                    if (cmbPrtTemp.SelectedItem.ToString().Equals("标准模板")) {
                        //打印单据
                        DoStdPrint(PrtPreView);
                    } else if (cmbPrtTemp.SelectedItem.ToString().Equals("床垫模板")) {
                        DoCDPrint(PrtPreView);
                    }
                    SerNoCaller.Calr_OrderProced.ExecSql(" delete T_ERP_OrderProced where PrintSession=@0", PrintSession);

                }

            } catch (Exception) {
                RefreashPrintOrder();
                throw;
            } finally {
                dlg.Close();
            }
        }