Esempio n. 1
0
        /// <summary>
        /// 删除数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelData_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定要删除当前数据库吗?(不可恢复,请慎重操作)", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            WaitDialogForm frm = new WaitDialogForm("", "正在删除数据库,请稍后...");

            frm.Show();
            string connstr1 = " Connection Timeout=2; server=" + txtServerAddress.Text.Trim() + ";database=Master;uid=" + txtServerUser.Text.Trim() + ";pwd=" + txtServerPwd.Text.Trim() + ";";

            if (!CheckConn(connstr1))
            {
                frm.Hide();
                SQLDMOHelper.MesShow("无法连接到服务器,请确认服务器信息!");
                return;
            }
            SQLDMOHelper smh      = new SQLDMOHelper(txtServerAddress.Text.Trim(), txtServerUser.Text.Trim(), txtServerPwd.Text.Trim());
            ArrayList    datalist = smh.GetDbList();

            if (datalist.Contains(txtServerName.Text.Trim()))
            {
                if (smh.KillDB(txtServerName.Text.Trim()))
                {
                    frm.Hide();
                    SQLDMOHelper.MesShow("已成功删除 " + txtServerName.Text.Trim() + " 数据库");
                }
            }
            else
            {
                frm.Hide();
                SQLDMOHelper.MesShow("该服务器中不存在名为 " + txtServerName.Text.Trim() + " 的数据库");
            }
            frm.Hide();
        }
Esempio n. 2
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        private void InitForm()
        {
            WaitDialogForm waitDialog = new WaitDialogForm("正在获取数据……", "请稍等。");

            try
            {
                if (inCommonNoteBiz == null)
                {
                    inCommonNoteBiz = new InCommonNoteBiz(m_app);
                }
                inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
                waitDialog.Hide();
                waitDialog.Close();
                foreach (var item in m_inCommonNote.InCommonNoteTabList)
                {
                    CommonNote_TabEntity commonNote_TabEntity = null;
                    foreach (var itemTab in m_commonNoteEntity.CommonNote_TabList)
                    {
                        if (itemTab.CommonNote_Tab_Flow == item.CommonNote_Tab_Flow)
                        {
                            commonNote_TabEntity = itemTab;
                            break;
                        }
                    }
                    if (commonNote_TabEntity == null)
                    {
                        continue;
                    }
                    XtraTabPage tabPage = new XtraTabPage();
                    tabPage.Tag  = item;
                    tabPage.Text = item.CommonNoteTabName;
                    if (item.ShowType == "表格")
                    {
                        UCIncommonNoteTab UCIncommonNoteTab = new UCIncommonNoteTab(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(UCIncommonNoteTab);
                        UCIncommonNoteTab.Dock = DockStyle.Fill;
                    }
                    else
                    {
                        UCInCommonTabSingle ucInCommonTabSingle = new UCInCommonTabSingle(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(ucInCommonTabSingle);
                        ucInCommonTabSingle.Dock = DockStyle.Fill;
                    }
                    tabcontrol.TabPages.Add(tabPage);
                }
                tabcontrol.SelectedTabPageIndex = 1;
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                throw ex;
            }
        }
Esempio n. 3
0
        public DataTable GetSBtable(string bdzid)
        {
            string sql = "where svguid='" + bdzid + "' and projectid='" + Itop.Client.MIS.ProgUID + "' and Type='01' ORDER BY Number";

            if (string.IsNullOrEmpty(bdzid))
            {
                sql      = "where  projectid='" + Itop.Client.MIS.ProgUID + "' and Type='01' ORDER BY Number";
                showdeep = false;
            }
            IList <PSPDEV> list = UCDeviceBase.DataService.GetList <PSPDEV>("SelectPSPDEVByCondition", sql);

            if (list.Count > 0)
            {
                msgbox.Show();
                int n = 0;
                try {
                    string strmx = "";
                    foreach (PSPDEV dev in list)
                    {
                        n++;
                        strmx = string.Format("({0}){1}__", n, dev.Name);
                        addrow(dev.SUID, dev.SUID, "root", dev.Type, dev.Number, dev.Name, dev.RateVolt);
                        msgbox.SetCaption(strmx + "线路");
                        initxl(dev.SUID, dev.Name, 0);
                        msgbox.SetCaption(strmx + "负荷");
                        initfh(dev.SUID, dev.Name);
                        msgbox.SetCaption(strmx + "变压器2");
                        initbyq2(dev.SUID, dev.Name);
                        msgbox.SetCaption(strmx + "变压器3");
                        initbyq3(dev.SUID, dev.Name);
                        //if (string.IsNullOrEmpty(bdzid)) break;
                    }
                } catch { }
                msgbox.Hide();
            }
            else if (pdev != null)
            {
                if (pdev.Type == "01")
                {
                    msgbox.Show();
                    initxl(pdev.SUID, pdev.Name, 0);
                    initfh(pdev.SUID, pdev.Name);
                    initbyq2(pdev.SUID, pdev.Name);
                    initbyq3(pdev.SUID, pdev.Name);
                    msgbox.Hide();
                }
                else if (pdev.Type == "05")
                {
                }
            }
            return(sbTable);
        }
 private void EndInvoke(object sender, EventArgs e)
 {
     if (_wform != null)
     {
         _wform.Hide();
     }
 }
Esempio n. 5
0
 public void HideWaitDialog()
 {
     if (m_WaitDialog != null)
     {
         m_WaitDialog.Hide();
     }
 }
Esempio n. 6
0
 public static void HideDialog()
 {
     if (_mDlg != null)
     {
         _mDlg.Hide();
     }
 }
Esempio n. 7
0
 public UCMainForm()
 {
     InitializeComponent();
     waitDialogForm = new WaitDialogForm("请稍等...", "请稍后...");
     waitDialogForm.Hide();
     this.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(105)))), ((int)(((byte)(141)))), ((int)(((byte)(189)))));
 }
 private void HideWaitDialog()
 {
     if (m_WaitDialog != null)
     {
         m_WaitDialog.Hide();
     }
 }
Esempio n. 9
0
        private void createGraph()
        {
            UCBDZsbtopo sbtopo = new UCBDZsbtopo();

            sbtopo.Showdeep = showdeep;
            string p = pid;

            if (pid.StartsWith("jxt"))
            {
                p = "";
            }
            DataTable sbtable = sbtopo.GetSBtable(p);

            shapdic.Clear();
            if (msgbox == null)
            {
                msgbox = new WaitDialogForm("", "绘制图元,请稍候。。。");
            }
            msgbox.Show();
            graphControl1.BeginInitData();
            createGraph(sbtable, "root");
            graphControl1.EndInitData();
            msgbox.Hide();
            sbtopo.Dispose();
            sbtopo = null;
        }
Esempio n. 10
0
 public UCMainForm(string noofinpat)
     : this()
 {
     CurrentNoofinpat = noofinpat;
     waitDialogForm   = new WaitDialogForm("正在加载窗体", "请稍后...");
     waitDialogForm.Hide();
 }
Esempio n. 11
0
        /// <summary>
        /// 最新版三测单界面
        /// Modify by xlb 2013-05-03
        /// </summary>
        /// <param name="drInpatient"></param>
        private void LoadDCNurseDocument(DataRow drInpatient)
        {
            try
            {
                //修改调用方式,防止项目互相调用
                WaitDialogForm waitDialog = new WaitDialogForm("正在绘制三测单", "请您稍后!");
                //加载dll文件
                Assembly AmainNursingMeasure = Assembly.Load("DrectSoft.Core.NurseDocument");
                //获取类
                Type TypeM = AmainNursingMeasure.GetType("DrectSoft.Core.NurseDocument.LoadNurseDocument");
                //实例化一个类
                object obj = Activator.CreateInstance(TypeM);
                //创建方法
                MethodInfo m = TypeM.GetMethod("MyLoadNurseDocument");
                //参数对象
                object[] p = new object[] { this, m_app, drInpatient, null };
                m.Invoke(obj, p);

                if (p[3] != null)
                {
                    XtraUserControl XtraUc = p[3] as XtraUserControl;
                    scrolThreeRecord.Controls.Clear();
                    scrolThreeRecord.Controls.Add(XtraUc);
                    XtraUc.Dock = DockStyle.Fill;
                }
                waitDialog.Hide();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 12
0
        public RecordManageCenter()
        {
            InitializeComponent();

            try
            {
                m_WaitDialog = new WaitDialogForm("正在创建用户界面...", "请稍等");
                m_WaitDialog.Show();
                UCRecordNoOnFile ucRecordNoOnFile = new UCRecordNoOnFile();
                ucRecordNoOnFile.Dock = DockStyle.Fill;
                tabPageRecordNoOnFile.Controls.Add(ucRecordNoOnFile);

                UCRecordOnFile ucRecordOnFile = new UCRecordOnFile();
                ucRecordOnFile.Dock = DockStyle.Fill;
                tabPageRecordOnFile.Controls.Add(ucRecordOnFile);

                UCApplyRecord ucApplyRecord = new UCApplyRecord();
                ucApplyRecord.Dock = DockStyle.Fill;
                tabPageApplyRecord.Controls.Add(ucApplyRecord);

                UCSingInRecord ucSingInRecord = new UCSingInRecord();
                ucSingInRecord.Dock = DockStyle.Fill;
                tabPageSignInRecord.Controls.Add(ucSingInRecord);

                //UCOperRecordLog ucOperRecordLog = new UCOperRecordLog();
                //ucOperRecordLog.Dock = DockStyle.Fill;
                //tabPageOperRecordLog.Controls.Add(ucOperRecordLog);
                m_WaitDialog.Hide();
            }
            catch (Exception ex)
            {
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
Esempio n. 13
0
 /// <summary>
 /// 隐藏
 /// </summary>
 public static void Hide()
 {
     if (_WaitFrm != null)
     {
         _WaitFrm.Hide();
     }
 }
Esempio n. 14
0
        /// <summary>
        /// 检索当前科室(用户科室)的所有病人
        /// </summary>
        public void BindGridRecordData(string hour, string date)
        {
            WaitDialogForm m_WaitDialog = new WaitDialogForm("正在初始化数据...", "请稍后");

            try
            {
                SearchInpatentDataZheHe(hour, date);

                //string departcode = CommonObjects.CurrentUser.CurrentDeptId;
                //string wardcode = CommonObjects.CurrentUser.CurrentWardId;
                //SqlParameter[] sqlParams = new SqlParameter[]
                //{
                //    new SqlParameter("@departCode",SqlDbType.VarChar,50),
                //    new SqlParameter("@wardcode",SqlDbType.VarChar,50),
                //    new SqlParameter("@Timelot",SqlDbType.VarChar,50),
                //    new SqlParameter("@TimelotSave",SqlDbType.VarChar,50),
                //    new SqlParameter("@date",SqlDbType.NVarChar,50),
                //    new SqlParameter("@result",SqlDbType.Structured,int.MaxValue)
                //};
                //sqlParams[0].Value = departcode;
                //sqlParams[1].Value = wardcode;
                //sqlParams[2].Value = hour;
                //sqlParams[3].Value = timelotSave;//天数据存为2时段
                //string surveyDate = dateEdit.DateTime.ToString("yyyy-MM-dd");//dateEdit.Text.Replace('/','-');
                //sqlParams[4].Value = surveyDate;
                //sqlParams[5].Direction = ParameterDirection.Output;
                //DataTable dtInpatient = DS_SqlHelper.ExecuteDataTable("EMR_NURSE_STATION.usp_GetPatientsOfDept", sqlParams, CommandType.StoredProcedure);
                //gridControlVitalSigns.DataSource = null;
                //dtInpatient.DefaultView.Sort = "BED asc ";
                //gridControlVitalSigns.DataSource = dtInpatient;
                DataTable dtInpatient = SearchInpatentDataZheHe(hour, date);
                dtInpatient.DefaultView.Sort     = "BED asc ";
                gridControlVitalSigns.DataSource = dtInpatient;
                m_WaitDialog.Hide();
                m_WaitDialog.Close();
            }
            catch (Exception ex)
            {
                m_WaitDialog.Hide();
                m_WaitDialog.Close();
                MyMessageBox.Show(1, ex);
            }
        }
Esempio n. 15
0
        private void tabcontrol_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
        {
            if (tabcontrol.SelectedTabPage != tabPagePrint)
            {
                return;
            }
            WaitDialogForm waitDialog = new WaitDialogForm("正在组织打印数据……", "请稍等。");

            try
            {
                PrintInCommonView printInCommonView = ConvertPrintEntity();
                iPrintNurse = AbstractorFactry.GetNurseRecord(printInCommonView.PrintFileName);
                SetWaitDialogCaption("正在绘制预览界面……", waitDialog);
                if (iPrintNurse != null && iPrintNurse.IsCustomPrint == true)
                {
                    tabPagePrint.Controls.Clear();
                    PrintForm1 printForm1 = new PrintForm1(printInCommonView);
                    printForm1.Dock            = DockStyle.Fill;
                    printForm1.TopLevel        = false;
                    printForm1.FormBorderStyle = FormBorderStyle.None;
                    printForm1.Show();
                    tabPagePrint.Controls.Add(printForm1);
                }
                else
                {
                    if (ucPrintRecord == null)
                    {
                        ucPrintRecord = new UCPrintRecord();
                        tabPagePrint.Controls.Add(ucPrintRecord);
                        ucPrintRecord.Dock = DockStyle.Fill;
                    }
                    ucPrintRecord.LoadPrint(printInCommonView);
                }
                waitDialog.Hide();
                waitDialog.Close();
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                YiDanCommon.Ctrs.DLG.YiDanMessageBox.Show(ex.Message);
            }
        }
Esempio n. 16
0
 /// <summary>
 /// 刷新事件
 /// xlb 2013-02-01
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnReset_Click(object sender, EventArgs e)
 {
     try
     {
         m_WaitDialog = new WaitDialogForm("正在刷新数据", "请稍后...");
         GetData();
         m_WaitDialog.Hide();
     }
     catch (Exception ex)
     {
         DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(ex.Message + ex.StackTrace);
     }
 }
Esempio n. 17
0
 private void HideWaitDialog()
 {
     try
     {
         if (m_WaitDialog != null)
         {
             m_WaitDialog.Hide();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 18
0
 public void HideWaitDialog()
 {
     try
     {
         if (m_WaitDialog != null)
         {
             m_WaitDialog.Hide();
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Esempio n. 19
0
 public void HideWaitDialog()
 {
     try
     {
         if (m_WaitDialog != null)
         {
             m_WaitDialog.Hide();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 20
0
 public UCEmrInputPreView(string changeID, string recordDetailID)
 {
     try
     {
         m_waitForm = new WaitDialogForm("正在加载病历预览区...", "请稍候");
         InitializeComponent();
         Init(changeID, recordDetailID);
         InitSize();
         this.LocatedDailyEmrForEditEvent += new Action <string, string>(UCEmrInputPreView_LocatedDailyEmrForEditEvent);
         m_waitForm.Hide();
     }
     catch (Exception ex)
     {
         DS_Common.HideWaitDialog(m_waitForm);
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 21
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barBtnRemove_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            try
            {
                int rowCount = gvProductCheck.RowCount;
                if (rowCount > 0)
                {
                    waitForm.Hide();
                    if (XtraMessageBox.Show("是否删除所有选中项", Constants.SYSTEM_PROMPT, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                    {
                        waitForm.Show();
                        gridCtrlDetail.DataSource = null;
                        for (int i = 0; i < rowCount;)
                        {
                            DataRow dRow = gvProductCheck.GetDataRow(i);
                            if (Convert.ToBoolean(dRow[gcIsSelected.FieldName].ToString()))
                            {
                                if (dRow["SkuOuterID"] != null && skuOuterIDList.Contains(dRow["SkuOuterID"].ToString()))
                                {
                                    skuOuterIDList.Remove(dRow["SkuOuterID"].ToString());
                                }
                                dTable.Rows.Remove(dRow);
                                rowCount = gvProductCheck.RowCount;
                            }
                            else
                            {
                                i++;
                            }
                        }
                    }
                }
                gvProductCheck.BestFitColumns();
                gridViewDetail.BestFitColumns();
                GetDetails();
                waitForm.Close();
            }
            catch (Exception ex)
            {
                waitForm.Close();
                XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 22
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Query_Click(object sender, EventArgs e)
        {
            try
            {
                string errorStr = CheckItem();
                if (!string.IsNullOrEmpty(errorStr))
                {
                    MyMessageBox.Show(errorStr, "提示", MyMessageBoxButtons.Ok, DrectSoft.Common.Ctrs.DLG.MessageBoxIcon.WarningIcon);
                    return;
                }
                WaitDialogForm m_WaitDialog = new WaitDialogForm("正在查询数据...", "请稍后");
                //InitOptions();
                if (radio_CardType.SelectedIndex == 0)//姓名索引卡
                {
                    RefreshNameCardData();
                }
                else if (radio_CardType.SelectedIndex == 1)//死亡索引卡
                {
                    RefreshDeathCardData();
                }
                else if (radio_CardType.SelectedIndex == 2)//手术索引卡
                {
                    RefreshOperationCardData();
                }
                else if (radio_CardType.SelectedIndex == 3)//疾病索引卡
                {
                    RefreshDiseaseCardData();
                }
                Selection.SelectAll();

                m_WaitDialog.Hide();
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
Esempio n. 23
0
        /// <summary>
        ///  创建数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCreateData_Click(object sender, EventArgs e)
        {
            if (!CheckForm())
            {
                return;
            }

            string connstr1 = " Connection Timeout=2; Pooling=False ;server=" + txtServerAddress.Text.Trim() + ";database=Master;uid=" + txtServerUser.Text.Trim() + ";pwd=" + txtServerPwd.Text.Trim() + ";";

            if (!CheckConn(connstr1))
            {
                SQLDMOHelper.MesShow("无法连接到服务器,请确认服务器信息!");
                return;
            }
            SQLDMOHelper smh = new SQLDMOHelper(txtServerAddress.Text.Trim(), txtServerUser.Text.Trim(), txtServerPwd.Text.Trim());

            ArrayList datalist = smh.GetDbList();

            if (datalist.Contains(txtServerName.Text.Trim()))
            {
                SQLDMOHelper.MesShow("该服务器中已在名为 " + txtServerName.Text.Trim() + " 的数据库");
                return;
            }
            FrmDirTree frmd = new FrmDirTree();

            SQLDMO.SQLServer svr = new SQLDMO.SQLServerClass();
            svr.Connect(txtServerAddress.Text.Trim(), txtServerUser.Text.Trim(), txtServerPwd.Text.Trim());
            frmd.svr  = svr;
            frmd.Text = txtServerAddress.Text.Trim() + "选择路径";
            string FilePath = "";

            if (frmd.ShowDialog() == DialogResult.OK)
            {
                FilePath = frmd.SelectPaht;
            }
            else
            {
                return;
            }
            WaitDialogForm frm = new WaitDialogForm("正在创建数据库,请稍后...");

            frm.Show();

            if (smh.CreateDB(txtServerName.Text.Trim(), FilePath))
            {
                //读取配置数据表.sql文件

                IList <SysDataFiles> sdflist = ServicesSys.BaseService.GetList <SysDataFiles>("SelectSysDataFilesList", "");
                if (sdflist.Count == 0)
                {
                    frm.Hide();
                    SQLDMOHelper.MesShow("服务器中创建数据库文件不存在,请管管员先添加该文件! ");
                    return;
                }
                SysDataFiles file = sdflist[0];
                string       path = Application.StartupPath + "\\BlogData";
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                string filepath = path + "\\" + file.FileName;
                if (File.Exists(filepath))
                {
                    File.Delete(filepath);
                }
                getfile(file.Files, filepath);


                ArrayList alist = smh.GetSqlFile(filepath, txtServerName.Text.Trim());
                if (File.Exists(filepath))
                {
                    File.Delete(filepath);
                }
                string        connstr2 = "Pooling=False ; server=" + txtServerAddress.Text.Trim() + ";database=" + txtServerName.Text.Trim() + ";uid=" + txtServerUser.Text.Trim() + ";pwd=" + txtServerPwd.Text.Trim() + ";";
                SqlConnection conn     = new SqlConnection(connstr2);
                frm.Caption = "正在创建数据表,请稍后...";
                if (smh.ExecuteCommand(alist, conn))
                {
                    frm.Caption = "正在初始化数据,请稍后...";

                    //添加数据
                    if (CopyData(smh))
                    {
                        frm.Hide();
                        SQLDMOHelper.MesShow("数据库 " + txtServerName.Text.Trim() + " 已成功创建");
                    }
                    else
                    {
                        frm.Hide();
                        SQLDMOHelper.MesShow("数据库 " + txtServerName.Text.Trim() + " 已成功创建,初始化数据败");
                    }
                }
                else
                {
                    frm.Hide();
                    SQLDMOHelper.MesShow("创建数据库表失败,请检查服务器中创建数据库文件是否损坏");
                }
            }
            frm.Hide();
        }
Esempio n. 24
0
        private void btnNap_Click(object sender, EventArgs e)
        {
            WaitDialogForm _wait = new WaitDialogForm("Đang tải dữ liệu ...", "Vui lòng đợi giây lát");

            // Khởi tạo giá trị ban đầu.
            DataSet t;

            _ctyMa = string.Empty;
            clsParameter._isLoadHoSoDauThau = true;
            numRowTenderDetail = 0;

            #region Công ty


            t = new DataSet();
            t.ReadXml(txtPath.Text);
            if (t.Tables.Count != 3 || !t.Tables.Contains("Company") || !t.Tables.Contains("Tender") || !t.Tables.Contains("TenderDetail"))
            {
                _wait.Close();
                clsMessage.MessageWarning("Dữ liệu nạp không phù hợp. Vui lòng kiểm tra lại.");
                return;
            }

            if (t.Tables["Tender"].Columns.Contains("GIA_KEKHAI_BYT") || t.Tables["Tender"].Columns.Contains("GIA_CHAOTHAU"))
            {
                _wait.Close();
                clsMessage.MessageWarning("Dữ liệu không phù hợp với file kỹ thuật. Vui lòng kiểm tra lại.");
                return;
            }

            _wait.Caption = "Đang xử lý dữ liệu Company ...";
            if (t.Tables["Company"].Rows.Count > 0)
            {
                _ctyMa = t.Tables["Company"].Rows[0]["CTY_MA"] + string.Empty;
                //Không tồn tại mã công ty.
                if (!TonTaiMaCongTy(t.Tables["Company"].Rows[0]["CTY_MA"].ToString()))
                {
                    _wait.Close();
                    string str = string.Format("Công ty Mã : \"{0}\", Tên : \"{1}\" không tồn tại trong danh sách đợt đấu thầu này. Vui lòng nhập thông tin công ty này.", t.Tables[0].Rows[0]["CTY_MA"].ToString().ToUpper(), t.Tables[0].Rows[0]["TEN"].ToString().ToUpper());
                    clsMessage.MessageWarning(str);
                    return;
                }

                //InsertCompany(t.Tables[0]);

                if (DaNhapDuLieu(t.Tables["Company"].Rows[0]["CTY_MA"].ToString()))
                {
                    _wait.Hide();
                    // clsMessage.MessageWarning("Công ty : \"" + t.Tables["Company"].Rows[0]["TEN"].ToString().ToUpper() + "\" đã được nhập trong đợt đấu thầu này.\nVui lòng kiểm tra lại.");
                    if (clsMessage.MessageYesNo("Công ty đã được nạp dữ liệu! Bạn có muốn nạp tiếp dữ liệu không?") == DialogResult.No)
                    {
                        _wait.Close();
                        return;
                    }
                    _wait.Show();
                }
            }
            else
            {
                _wait.Close();
                clsMessage.MessageWarning("Không có dữ liệu nhập liệu.\nVui lòng kiểm tra lại.");
                return;
            }

            #endregion

            //Nếu nạp sản phẩm lần 2, kiểm tra từng sản phẩm có tồn tại trong lần nạp trước hay chưa
            for (int i = 0; i < t.Tables["Tender"].Rows.Count; i++)
            {
                string    _maSP = t.Tables["Tender"].Rows[i]["SP_MA"] + string.Empty;
                string    query = string.Format("select SP_MA from DAU_THAU where CTY_MA = '{0}' and SP_MA = '{1}'", _ctyMa, _maSP);
                DataTable dt    = FunctionHelper.LoadDM(query);
                if (dt.Rows.Count > 0)
                {
                    _wait.Close();
                    clsMessage.MessageWarning(string.Format("Dữ liệu sản phẩm ({0}) đã tồn tại. Vui lòng kiểm tra lại.", _maSP));
                    return;
                }
            }

            #region Thông tin đấu thầu

            _wait.Caption = "Đang xử lý dữ liệu Tender ...";
            //t = new DataSet();
            string TenGoiThau = string.Empty;
            //t.ReadXml(txtPath.Text + "\\Tender.xml");
            string _list = string.Empty;
            if (t.Tables["Tender"].Rows.Count > 0)
            {
                _wait.Close();


                DataTable dt = FunctionHelper.LoadDM("SELECT * FROM DM_CONGTY WHERE CTY_MA ='" + _ctyMa + "'");
                if (dt.Rows.Count > 0)
                {
                    DataTable dv = t.Tables["Tender"].DefaultView.ToTable(true, "GOITHAU_ID");
                    _list = (dt.Rows[0]["LIST_GOITHAU"] + string.Empty);//.Split(',');
                    for (int i = 0; i < dv.Rows.Count; i++)
                    {
                        if (!_list.Contains(dv.Rows[i][0] + string.Empty))
                        {
                            if (TenGoiThau == string.Empty)
                            {
                                TenGoiThau = "\n" + FunctionHelper.LoadDM("SELECT * FROM DM_GOITHAU WHERE GOITHAU_ID =" + dv.Rows[i][0] + string.Empty).Rows[0]["TEN"] + string.Empty;
                            }
                            else
                            {
                                TenGoiThau = TenGoiThau + "\n" + FunctionHelper.LoadDM("SELECT * FROM DM_GOITHAU WHERE GOITHAU_ID =" + dv.Rows[i][0] + string.Empty).Rows[0]["TEN"] + string.Empty;
                            }
                        }
                    }
                }

                if (TenGoiThau != string.Empty)
                {
                    if (clsMessage.MessageYesNo(string.Format("Công ty có dữ liệu của gói thầu : {0} \nNhưng không đăng ký mua.\nBạn có chắc muốn nạp dữ liệu (chỉ nạp những gói đã mua).", TenGoiThau)) == DialogResult.No)
                    {
                        return;
                    }
                }

                //DataSet dtDetail = new DataSet();
                //dtDetail.ReadXml(txtPath.Text + "\\TenderDetail.xml");

                if (!InsertTender(t.Tables["Tender"], _list, t.Tables["TenderDetail"]))
                {
                    return;
                }
            }

            //_wait.Caption = "Đang xử lý dữ liệu TenderDetail ...";
            //DataSet dtDetail = new DataSet();
            //dtDetail.ReadXml(txtPath.Text + "\\TenderDetail.xml");
            //if (t.Tables[0].Rows.Count > 0)
            //    InsertTenderDetail(t.Tables[0],_list);

            _wait.Close();

            clsMessage.MessageInfo("Nạp dữ liệu kỹ thuật thành công!");
            #endregion
        }
Esempio n. 25
0
        /// <summary>
        /// 初始化界面
        /// </summary>
        private void InitForm()
        {
            WaitDialogForm waitDialog = new WaitDialogForm("正在获取数据……", "请稍等。");

            try
            {
                if (inCommonNoteBiz == null)
                {
                    inCommonNoteBiz = new InCommonNoteBiz(m_app);
                }
                //xll 在初始化列表界面的时候获取值
                //inCommonNoteBiz.GetDetaliInCommonNote(ref m_inCommonNote);
                inCommonNoteBiz.GetIncommTab(ref m_inCommonNote);
                waitDialog.Hide();
                waitDialog.Close();
                //判断选择节点是否被删除,删除则给出提示
                if (m_inCommonNote == null || m_inCommonNote.InCommonNoteFlow == null)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show("该单据已被他人删除");
                    return;
                }
                //int countItem=  inCommonNoteBiz.GetCommonItemCount(m_inCommonNote.InCommonNoteFlow);
                foreach (var item in m_inCommonNote.InCommonNoteTabList)
                {
                    CommonNote_TabEntity commonNote_TabEntity = null;
                    foreach (var itemTab in m_commonNoteEntity.CommonNote_TabList)
                    {
                        if (itemTab.CommonNote_Tab_Flow == item.CommonNote_Tab_Flow)
                        {
                            commonNote_TabEntity = itemTab;
                            break;
                        }
                    }
                    if (commonNote_TabEntity == null)
                    {
                        continue;
                    }
                    XtraTabPage tabPage = new XtraTabPage();
                    tabPage.Tag  = item;
                    tabPage.Text = item.CommonNoteTabName;
                    if (item.ShowType == "表格")
                    {
                        UCIncommonNoteTab UCIncommonNoteTab = new UCIncommonNoteTab(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(UCIncommonNoteTab);
                        UCIncommonNoteTab.Dock = DockStyle.Fill;
                    }
                    else
                    {
                        UCInCommonTabSingle ucInCommonTabSingle = new UCInCommonTabSingle(item, commonNote_TabEntity, m_inCommonNote, m_app, m_canEdit);
                        tabPage.Controls.Add(ucInCommonTabSingle);
                        ucInCommonTabSingle.Dock = DockStyle.Fill;
                    }
                    tabcontrol.TabPages.Add(tabPage);
                }
                tabcontrol.SelectedTabPageIndex = 1;
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                throw ex;
            }
        }
Esempio n. 26
0
        /// <summary>
        /// 切换tab触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tabcontrol_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
        {
            if (tabcontrol.SelectedTabPage != tabPagePrint)
            {
                return;
            }
            WaitDialogForm waitDialog = new WaitDialogForm("正在组织打印数据……", "请稍等。");

            try
            {
                //xll 2013-03-26 获取全部数据 点击全部了 就无需再次查找 点击其他的 需要查找
                foreach (XtraTabPage item in tabcontrol.TabPages)
                {
                    if (item.Controls.Count > 0)
                    {
                        UCIncommonNoteTab uCIncommonNoteTab = item.Controls[0] as UCIncommonNoteTab;
                        if (uCIncommonNoteTab != null)
                        {
                            m_inCommonNote = uCIncommonNoteTab.GetAllDetailDate();
                            break;
                        }
                    }
                }
                PrintInCommonView printInCommonView = ConvertPrintEntity();

                iPrintNurse = AbstractorFactry.GetNurseRecord(printInCommonView.PrintFileName);
                SetWaitDialogCaption("正在绘制预览界面……", waitDialog);
                if (iPrintNurse != null && iPrintNurse.IsCustomPrint == true)
                {
                    if (tabPagePrint.Controls == null || tabPagePrint.Controls.Count <= 0)
                    {
                        PrintForm1 printForm1 = new PrintForm1(printInCommonView);
                        printForm1.Dock            = DockStyle.Fill;
                        printForm1.TopLevel        = false;
                        printForm1.FormBorderStyle = FormBorderStyle.None;
                        printForm1.Show();
                        tabPagePrint.Controls.Add(printForm1);
                    }
                    else
                    {
                        PrintForm1 printForm1 = tabPagePrint.Controls[0] as PrintForm1;
                        if (printForm1 != null)
                        {
                            printForm1.m_printInCommonView = printInCommonView;
                            printForm1.RefreshView();
                        }
                    }
                }
                else
                {
                    if (ucPrintRecord == null)
                    {
                        ucPrintRecord = new UCPrintRecord();
                        tabPagePrint.Controls.Add(ucPrintRecord);
                        ucPrintRecord.Dock = DockStyle.Fill;
                    }
                    ucPrintRecord.LoadPrint(printInCommonView);
                }
                waitDialog.Hide();
                waitDialog.Close();
            }
            catch (Exception ex)
            {
                waitDialog.Hide();
                waitDialog.Close();
                DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
            }
        }
Esempio n. 27
0
 public ProductAdd(WaitDialogForm waitForm)
 {
     InitializeComponent();
     waitForm.Hide();
 }
Esempio n. 28
0
        /// <summary>
        /// 删除数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelData_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确定要删除当前数据库吗?(不可恢复,请慎重操作)", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            WaitDialogForm frm = new WaitDialogForm("", "正在删除数据库,请稍后...");
            frm.Show();
            string connstr1 = " Connection Timeout=2; server=" + txtServerAddress.Text.Trim() + ";database=Master;uid=" + txtServerUser.Text.Trim() + ";pwd=" + txtServerPwd.Text.Trim() + ";";
            if (!CheckConn(connstr1))
            {
                frm.Hide();
                SQLDMOHelper.MesShow("无法连接到服务器,请确认服务器信息!");
                return;
            }
            SQLDMOHelper smh = new SQLDMOHelper(txtServerAddress.Text.Trim(), txtServerUser.Text.Trim(), txtServerPwd.Text.Trim());
            ArrayList datalist = smh.GetDbList();
            if (datalist.Contains(txtServerName.Text.Trim()))
            {
                if (smh.KillDB(txtServerName.Text.Trim()))
                {
                    frm.Hide();
                    SQLDMOHelper.MesShow("已成功删除 " + txtServerName.Text.Trim() + " 数据库");
                }

            }
            else
            {
                frm.Hide();
                SQLDMOHelper.MesShow("该服务器中不存在名为 " + txtServerName.Text.Trim() + " 的数据库");
            }
            frm.Hide();
        }
Esempio n. 29
0
        /// <summary>
        ///  创建数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCreateData_Click(object sender, EventArgs e)
        {
            if (!CheckForm())
            {
                return;
            }

            string connstr1 = " Connection Timeout=2; Pooling=False ;server=" + txtServerAddress.Text.Trim() + ";database=Master;uid=" + txtServerUser.Text.Trim() + ";pwd=" + txtServerPwd.Text.Trim() + ";";
            if (!CheckConn(connstr1))
            {
                SQLDMOHelper.MesShow("无法连接到服务器,请确认服务器信息!");
                return;
            }
            SQLDMOHelper smh = new SQLDMOHelper(txtServerAddress.Text.Trim(),txtServerUser.Text.Trim(),txtServerPwd.Text.Trim());

            ArrayList datalist = smh.GetDbList();
            if (datalist.Contains(txtServerName.Text.Trim()))
            {
                SQLDMOHelper.MesShow("该服务器中已在名为 " + txtServerName.Text.Trim() + " 的数据库");
                return;
            }
            FrmDirTree frmd = new FrmDirTree();
             SQLDMO.SQLServer svr = new SQLDMO.SQLServerClass();
             svr.Connect(txtServerAddress.Text.Trim(), txtServerUser.Text.Trim(), txtServerPwd.Text.Trim());
            frmd.svr=svr;
            frmd.Text = txtServerAddress.Text.Trim() + "选择路径";
            string FilePath="";
            if (frmd.ShowDialog()==DialogResult.OK)
            {
                FilePath = frmd.SelectPaht;
            }
            else
            {
                return;
            }
            WaitDialogForm frm = new WaitDialogForm("正在创建数据库,请稍后...");
            frm.Show();

            if (smh.CreateDB(txtServerName.Text.Trim(), FilePath))
            {
                //读取配置数据表.sql文件

                IList<SysDataFiles> sdflist = ServicesSys.BaseService.GetList<SysDataFiles>("SelectSysDataFilesList", "");
                if (sdflist.Count==0)
                {
                    frm.Hide();
                    SQLDMOHelper.MesShow("服务器中创建数据库文件不存在,请管管员先添加该文件! ");
                    return;
                }
                SysDataFiles file = sdflist[0];
                string path = Application.StartupPath + "\\BlogData";
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                string filepath = path + "\\" + file.FileName;
                if (File.Exists(filepath))
                {
                    File.Delete(filepath);
                }
                getfile(file.Files, filepath);

                ArrayList alist = smh.GetSqlFile(filepath, txtServerName.Text.Trim());
                if (File.Exists(filepath))
                {
                    File.Delete(filepath);
                }
                string connstr2 = "Pooling=False ; server=" + txtServerAddress.Text.Trim() + ";database=" + txtServerName.Text.Trim() + ";uid=" + txtServerUser.Text.Trim() + ";pwd=" + txtServerPwd.Text.Trim() + ";";
                SqlConnection conn = new SqlConnection(connstr2);
                frm.Caption = "正在创建数据表,请稍后...";
                if (smh.ExecuteCommand(alist,conn))
                {
                    frm.Caption = "正在初始化数据,请稍后...";

                    //添加数据
                    if (CopyData(smh))
                    {
                        frm.Hide();
                        SQLDMOHelper.MesShow("数据库 " + txtServerName.Text.Trim() + " 已成功创建");
                    }
                    else
                    {
                        frm.Hide();
                        SQLDMOHelper.MesShow("数据库 " + txtServerName.Text.Trim() + " 已成功创建,初始化数据败");
                    }

                }
                else
                {
                    frm.Hide();
                    SQLDMOHelper.MesShow("创建数据库表失败,请检查服务器中创建数据库文件是否损坏");
                }
            }
            frm.Hide();
        }
Esempio n. 30
0
        /// <summary>
        /// 获取对应的盘点单及其
        /// </summary>
        /// <returns></returns>
        //private SortedList<StockCheck, List<StockCheckDetail>> GetStockCheckAndDetails()
        //{
        //    SortedList<StockCheck, List<StockCheckDetail>> stockCheckAndDetails = new SortedList<StockCheck, List<StockCheckDetail>>();
        //    StockCheck stockCheck = new StockCheck();
        //    //时间
        //    stockCheck.Created = DateTime.Parse(textEditDate.Text);
        //    if (textOperator.Tag != null)
        //    {
        //        stockCheck.OperatorCode = textOperator.Tag.ToString();/////////////// ///////////////
        //    }
        //    else
        //    {
        //        stockCheck.OperatorCode = string.Empty;
        //    }
        //    //stockCheck.StockCheckCode = textCheckCode.Text;
        //    if (comboBoxStockHouse.Tag != null)
        //    {
        //        string[] codeList = comboBoxStockHouse.Tag.ToString().Split(',');
        //        if (codeList.Length > comboBoxStockHouse.SelectedIndex)
        //        {
        //            stockCheck.StockHouseCode = codeList[comboBoxStockHouse.SelectedIndex];
        //        }
        //    }

        //    List<StockCheckDetail> checkDetails = new List<StockCheckDetail>();
        //    for (int i = 0; i < gvProductCheck.RowCount; i++)
        //    {
        //        StockCheckDetail detail = new StockCheckDetail();
        //        DataRow dRow = gvProductCheck.GetDataRow(i);

        //        if (dRow["CheckQuantity"] != null && dRow["CheckQuantity"].ToString() != string.Empty)
        //        {
        //            detail.CheckQuantity = int.Parse(dRow["CheckQuantity"].ToString());
        //        }
        //        if (dRow["ProfitType"] != null && dRow["ProfitType"].ToString() != string.Empty)
        //        {
        //            detail.ProfitType = int.Parse(dRow["ProfitType"].ToString());
        //        }
        //        if (dRow["Quantity"] != null && dRow["Quantity"].ToString() != string.Empty)
        //        {
        //            detail.Quantity = int.Parse(dRow["Quantity"].ToString());
        //        }
        //        if (dRow["SkuOuterID"] != null && dRow["SkuOuterID"].ToString() != string.Empty)
        //        {
        //            detail.SkuOuterID = dRow["SkuOuterID"].ToString();
        //        }
        //        if (dRow["SkuQuantity"] != null && dRow["SkuQuantity"].ToString() != string.Empty)
        //        {
        //            detail.SkuQuantity = int.Parse(dRow["SkuQuantity"].ToString());
        //        }

        //        detail.LayoutCode = "";

        //        if (gvProductCheck.GetRowCellValue(i, "LayoutCode") != null && gvProductCheck.GetRowCellValue(i, "LayoutCode").ToString() != string.Empty)
        //        {
        //            if (rICBLayout.Tag != null)
        //            {
        //                detail.LayoutCode = gvProductCheck.GetRowCellValue(i, "LayoutCode").ToString();
        //            }
        //        }

        //        detail.StockCheckCode = textCheckCode.Text;
        //        checkDetails.Add(detail);
        //    }

        //    stockCheckAndDetails.Add(stockCheck, checkDetails);
        //    return stockCheckAndDetails;
        //}

        #endregion

        #region  择,删除商品
        /// <summary>
        /// 选择商品
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barBtnSelect_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            try
            {
                string stockHouseCode = string.Empty;
                if (comboBoxStockHouse.Text == string.Empty)
                {
                    waitForm.Hide();
                    XtraMessageBox.Show("请选择要盘点的仓库!", Constants.SYSTEM_PROMPT);
                    return;
                }
                if (comboBoxStockHouse.Tag != null)
                {
                    Hashtable tagTable = comboBoxStockHouse.Tag as Hashtable;
                    stockHouseCode = tagTable[comboBoxStockHouse.SelectedIndex].ToString();
                }
                DataTable       table = new DataTable();
                ProductSelected ps    = new ProductSelected(table, stockHouseCode);
                waitForm.Hide();
                ps.ShowDialog();
                waitForm.Show();
                foreach (DataRow row in table.Rows)
                {
                    if (row["SkuOuterID"] != null)
                    {
                        //如果包含则表明已经有该product
                        if (skuOuterIDList.Contains(row["SkuOuterID"].ToString()))
                        {
                            continue;
                        }
                    }
                    DataRow dRow = dTable.NewRow();
                    dRow["Name"]            = row["Name"];
                    dRow["SkuOuterID"]      = row["SkuOuterID"];//条形码
                    dRow["Specification"]   = row["Specification"];
                    dRow["Model"]           = row["Model"];
                    dRow[gcPrice.FieldName] = row["SkuPrice"];
                    //dRow["LayoutCode"];
                    //dRow["LayoutName"];
                    //dRow["StockUnitName"];
                    //dRow["StockUnitCode"];

                    dRow["SkuQuantity"] = row["Num"];
                    dRow["SaleProps"]   = row["SaleProps"];
                    dRow["IsSelected"]  = false;
                    dTable.Rows.Add(dRow);

                    skuOuterIDList.Add(row["SkuOuterID"].ToString());
                }
                gridProductCheck.DataSource = dTable;
                gvProductCheck.BestFitColumns();
                gridViewDetail.BestFitColumns();
                waitForm.Close();
            }
            catch (Exception ex)
            {
                waitForm.Close();
                XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Esempio n. 31
0
        //更新区域
        private void barButtonItem5_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string conn = "ProjectID='" + GetProjectID + "' and ParentID='0'";
            IList<Ps_Table_220Result> list = Common.Services.BaseService.GetList<Ps_Table_220Result>("SelectPs_Table_220ResultByConn", conn);
            Hashtable AreaTable = new Hashtable();
            for (int i = 0; i < list.Count; i++)
            {
                AreaTable.Add(list[i].Title, list[i].Title);
            }
            string connarea = "ProjectID='" + Itop.Client.MIS.ProgUID + "'order by Sort";
            IList<PS_Table_AreaWH> listarea = Common.Services.BaseService.GetList<PS_Table_AreaWH>("SelectPS_Table_AreaWHByConn", connarea);
            int m = 0;
            WaitDialogForm frm = new WaitDialogForm("","正在更新区域,请稍后...");
            foreach (PS_Table_AreaWH area in listarea)
            {
                m++;
                if (!AreaTable.Contains(area.Title))
                {

                    AddArea(area.Title);
                }
                double complete = m * 100 / listarea.Count ;
                frm.Caption = "已完成" + Math.Round(complete, 0) + "%";
            }
            frm.Hide();
            LoadData1();
        }
Esempio n. 32
0
        //更新变电站
        private void barButtonItem15_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //更新第2 5,8,11项

            string conn = "ProjectID='" + GetProjectID + "' and ParentID='0'";
            IList<Ps_Table_220Result> list = Common.Services.BaseService.GetList<Ps_Table_220Result>("SelectPs_Table_220ResultByConn", conn);
            int m = 0;
            WaitDialogForm frm = new WaitDialogForm("", "正在更新电源及变电站,请稍后...");
            foreach (Ps_Table_220Result pt in list)
            {
                m++;
                UpdataDY(pt.ID);
                UpDataRL(pt.ID);
                UpDataBDZ(pt.ID);
                UpData(pt.ID);
                double complete = m * 100 / list.Count;
                frm.Caption = "已完成" + Math.Round(complete, 0) + "%";
            }
            frm.Hide();
            LoadData1();
        }
Esempio n. 33
0
 public PurchaseIn(WaitDialogForm waitForm)
 {
     InitializeComponent();
     waitForm.Hide();
 }