Ejemplo n.º 1
0
 /// <summary>
 /// 显示提示信息
 /// </summary>
 /// <param name="caption">提示信息</param>
 /// <param name="title">标题</param>
 public static void Show(string caption, string title)
 {
     if (_WaitFrm == null || _WaitFrm.IsDisposed)
     {
         _WaitFrm = new WaitDialogForm(caption, title);
     }
     else
     {
         _WaitFrm.SetCaption(caption);
         _WaitFrm.Show();
     }
 }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
0
        private void btnSaveAndNew_Click(object sender, EventArgs e)
        {
            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            try
            {
                List <StockHouseProduct> shpList = new List <StockHouseProduct>();
                StockItem stockItem = new StockItem();
                List <Alading.Entity.StockProduct> stockProductList = new List <Alading.Entity.StockProduct>();
                List <StockDetail> sdList = new List <StockDetail>();
                if (productAddCtrl1.GetData(waitForm, stockItem, stockProductList, sdList, shpList))
                {
                    StockItemService.AddStockItemProducts(stockItem, stockProductList, sdList, shpList);
                    productAddCtrl1.AllClear();
                    waitForm.Close();
                    XtraMessageBox.Show("保存成功!", Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    productAddCtrl1.StockHouseFlag  = false;
                    productAddCtrl1.StockLayoutFlag = false;
                }
                else
                {
                    XtraMessageBox.Show("保存失败!", Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    waitForm.Close();
                    return;
                }
            }
            catch (Exception ex)
            {
                waitForm.Close();
                XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 确定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonConfirm_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(comboBoxGroup.Text))
            {
                XtraMessageBox.Show("请选择计量单位组!", Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (string.IsNullOrEmpty(textEditUnitName.Text))
            {
                XtraMessageBox.Show("请输入计量单位名称!", Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                textEditUnitName.Focus();
                return;
            }
            //验证比例为1-5位小数的正实数
            if (string.IsNullOrEmpty(textEditNum.Text) || textEditNum.Text == "0")
            {
                XtraMessageBox.Show("请输入正确的比例关系!", Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                textEditNum.Focus();
                return;
            }

            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            try
            {
                Alading.Entity.StockUnit stockUnit = new Alading.Entity.StockUnit();
                if (string.IsNullOrEmpty(textEditCode.Text) || string.IsNullOrEmpty(textEditCode.Text.Trim()))
                {
                    stockUnit.StockUnitCode = System.Guid.NewGuid().ToString();
                }
                else
                {
                    stockUnit.StockUnitCode = textEditCode.Text;
                }
                stockUnit.StockUnitName      = textEditUnitName.Text;
                stockUnit.StockUnitSource    = "手动新增";
                stockUnit.Conversion         = float.Parse(textEditNum.Text);
                stockUnit.IsBaseUnit         = false;
                stockUnit.StockUnitGroupCode = stockgroupUnitCode;
                stockUnit.Remark             = memoExEditRemark.Text;
                if (StockUnitService.AddStockUnit(stockUnit) == ReturnType.Success)
                {
                    waitForm.Close();
                    XtraMessageBox.Show("计量单位添加成功!", Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }
                else
                {
                    waitForm.Close();
                    XtraMessageBox.Show("计量单位添加失败!", Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                waitForm.Close();
                XtraMessageBox.Show(ex.Message, Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 7
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();
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 确定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonConfirm_Click(object sender, EventArgs e)
        {
            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            if (string.IsNullOrEmpty(textEditGroupName.Text) || string.IsNullOrEmpty(textEditGroupName.Text.Trim()))
            {
                waitForm.Close();
                XtraMessageBox.Show("请输入单位组名称!", Constants.SYSTEM_PROMPT);
                return;
            }
            stockUnitGroup.StockUnitGroupName = textEditGroupName.Text;
            stockUnitGroup.Remark             = memoRemark.Text;
            if (StockUnitGroupService.UpdateStockUnitGroup(stockUnitGroup) == ReturnType.Success)
            {
                waitForm.Close();
                XtraMessageBox.Show("更新成功!", "系统提示", MessageBoxButtons.OK);
            }
            else
            {
                waitForm.Close();
                XtraMessageBox.Show("更新失败!", "系统提示", MessageBoxButtons.OK);
            }
            this.Close();
            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 焦点行转变,刷新库位的选项
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gvProductSJ_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            try
            {
                DataRow row = gvProductSJ.GetFocusedDataRow();
                repositoryItemComboBoxStockLayout.Items.Clear();
                if (row != null && row["StockHouseCode"] != null)
                {
                    List <StockLayout> list        = StockLayoutService.GetStockLayout(c => c.StockHouseCode == row["StockHouseCode"].ToString());
                    Hashtable          layoutTable = new Hashtable();
                    int i = 0;
                    foreach (StockLayout sl in list)
                    {
                        repositoryItemComboBoxStockLayout.Items.Add(sl.LayoutName);
                        layoutTable.Add(i++, sl.StockHouseCode);
                    }
                    repositoryItemComboBoxStockLayout.Tag = layoutTable;
                }
                waitForm.Close();
            }
            catch (Exception ex)
            {
                waitForm.Close();
                XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 10
0
        private void simpleConfirm_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textCatName.Text))
            {
                XtraMessageBox.Show("请输入类目名称!", Constants.SYSTEM_PROMPT);
                textCatName.Focus();
                return;
            }
            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            try
            {
                stockCatName = textCatName.Text;
                if (StockCatService.UpdateStockCat(stockCatCid, stockCatName) == ReturnType.Success)
                {
                    waitForm.Close();
                    XtraMessageBox.Show("修改类目成功!", Constants.SYSTEM_PROMPT);
                    this.Close();
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    waitForm.Close();
                    XtraMessageBox.Show("修改类目失败!", Constants.SYSTEM_PROMPT);
                }
            }
            catch (Exception ex)
            {
                waitForm.Close();
                XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT);
            }
        }
Ejemplo n.º 11
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void bbtnDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (gridViewStockInOut.RowCount > 0)
     {
         DialogResult   result   = XtraMessageBox.Show("您确定删除该记录?删除后将无法恢复!", "确定删除", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
         WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
         waitForm.Show();
         try
         {
             if (result == DialogResult.OK)
             {
                 productTable.Rows.Clear();
                 DataRow row = gridViewStockInOut.GetFocusedDataRow();
                 StockInOutService.RemoveInOutAndDetails(row[gcInOutCode.FieldName].ToString());
                 allVidpList.Remove(allVidpList.FirstOrDefault(c => c.Key == row[gcInOutCode.FieldName].ToString()));
                 currentVidpList.Remove(currentVidpList.FirstOrDefault(c => c.Key == row[gcInOutCode.FieldName].ToString()));
                 GetIntOutTableDataSource(GetDisplayGroup());
                 SetPageBtnEnable();
                 RowClick();
             }
             waitForm.Close();
         }
         catch (Exception ex)
         {
             waitForm.Close();
             XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
 }
Ejemplo n.º 12
0
        private void treeListStockCat_MouseDown(object sender, MouseEventArgs e)
        {
            TreeListHitInfo hitInfo = treeListStockCat.CalcHitInfo(new Point(e.X, e.Y));

            /*如果单击到单元格内*/
            if (hitInfo.HitInfoType == HitInfoType.Cell)
            {
                WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
                waitForm.Show();
                try
                {
                    TreeListNodeTag tag = hitInfo.Node.Tag as TreeListNodeTag;
                    textCatName.Text = hitInfo.Node.GetDisplayText(0);
                    textCatCode.Text = tag.Cid;
                    if (!hitInfo.Node.HasChildren)
                    {
                        Init(hitInfo.Node);
                    }
                    waitForm.Close();
                }
                catch (Exception ex)
                {
                    waitForm.Close();
                }
            }
        }
        //属性表编辑
        private void btnAttributeEdit_Click(object sender, EventArgs e)
        {
            WaitDialogForm dlg = new WaitDialogForm("正在查询,请稍候......", "提示");

            try
            {
                dlg.Show();
                if (pCurrentLyr == null)
                {
                    MessageBox.Show("请选择编辑图层!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (formAttribute == null)
                {
                    formAttribute       = new Form_Attribute(pCurrentLyr, pMap, isEditing);
                    formAttribute.Owner = this;
                    formAttribute.Show();
                }
                else
                {
                    formAttribute.Activate();
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("打开属性表失败", ex, ex.Message);
            }
            finally
            {
                dlg.Close();
            }
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 修改库存自定义属性
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bbtnModifyProp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            StockProp sp = gridViewStockProp.GetFocusedRow() as StockProp;

            if (sp != null)
            {
                string cid         = textCatCode.Text;
                string catName     = textCatName.Text;
                string fParentPid  = sp.ParentPid;
                string fParentName = string.Empty;
                if (fParentPid != "0")
                {
                    fParentName = StockPropService.GetStockProp(sp.ParentPid).Name;
                }
                string fParentVid       = sp.ParentVid;
                string fParentValueName = string.Empty;
                if (fParentVid != "0")
                {
                    fParentValueName = StockPropValueService.GetStockPropValue(sp.ParentVid).Name;
                }
                StockPropAdd spa = new StockPropAdd(cid, catName, fParentName, fParentPid, fParentValueName, fParentVid, sp.StockPid, sp.Name);
                spa.ShowDialog();
                WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
                waitForm.Show();
                gridCtrlStockProp.DataSource = StockPropService.GetStockProp(c => c.StockCid == cid);
                waitForm.Close();
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 确定
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void simpleButtonConfirm_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textEditUnitName.Text))
            {
                XtraMessageBox.Show("请输入计量单位名称!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textEditUnitName.Focus();
                return;
            }
            //验证比例为1-5位小数的正实数
            if (string.IsNullOrEmpty(textEditNum.Text) || textEditNum.Text == "0")
            {
                XtraMessageBox.Show("请输入正确的比例关系!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                textEditNum.Focus();
                return;
            }

            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            Alading.Entity.StockUnit stockUnit = new Alading.Entity.StockUnit();
            stockUnit.StockUnitName = textEditUnitName.Text;
            stockUnit.Conversion    = double.Parse(textEditNum.Text);
            stockUnit.Remark        = memoExEditRemark.Text;
            if (StockUnitService.UpdateStockUnit(stockunitCode, stockUnit) == ReturnType.Success)
            {
                waitForm.Close();
                XtraMessageBox.Show("计量单位修改成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Close();
            }
            else
            {
                waitForm.Close();
                XtraMessageBox.Show("计量单位修改失败!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void bbtnProductDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DataRow row = gvProductSJ.GetFocusedDataRow();

            if (row != null)
            {
                DialogResult result = XtraMessageBox.Show("您确定要从列表中删除该商品?", Constants.SYSTEM_PROMPT, MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                if (result == DialogResult.OK)
                {
                    WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
                    waitForm.Show();
                    try
                    {
                        string skuouterID = row[gcSkuOutID.FieldName].ToString();
                        if (skuOutIdList.Contains(skuouterID))
                        {
                            skuOutIdList.Remove(skuouterID);
                        }
                        gvProductSJ.DeleteRow(gvProductSJ.FocusedRowHandle);
                        waitForm.Close();
                    }
                    catch (Exception ex)
                    {
                        waitForm.Close();
                        XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            gvProductSJ.BestFitColumns();
        }
Ejemplo n.º 17
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);
            }
        }
Ejemplo n.º 18
0
 public static void Start(string caption, string title, Size size)
 {
     if (_waitFrm != null)
     {
         _waitFrm.Close();
     }
     _waitFrm = new WaitDialogForm(caption, title, size);
     _waitFrm.Show();
 }
Ejemplo n.º 19
0
        private void btImport_Click_1(object sender, EventArgs e)
        {
            //导入
            if (checkedListBox1.SelectedItem == null)
            {
                return;
            }
            IEnumerator ie = null;

            switch (checkedListBox1.SelectedItem.ToString())
            {
            case "母线":
                ie = importMX();
                break;

            case "线路":
                ie = importXL();
                break;

            case "两绕组变压器":
                ie = importBYQ2();
                break;

            case "三绕组变压器":
                ie = importBYQ3();
                break;

            case "发电机":
                ie = importFDJ();
                break;

            case "负荷":
                ie = importFH();
                break;

            case "并联电容器":
                ie = importBLDR();
                break;
            }
            if (gridControl1.DataSource != null)
            {
                ncount   = (gridControl1.DataSource as DataTable).Rows.Count;
                ncurrent = 0;
                if (ie != null)
                {
                    WaitDialogForm msgbox = new WaitDialogForm("", "导入数据,请稍候。。。");
                    msgbox.Show();

                    while (ie.MoveNext())
                    {
                        msgbox.SetCaption(string.Format("已完成{0}/{1}", ncurrent, ncount));
                    }
                    Thread.Sleep(1000);
                    msgbox.Close();
                }
            }
        }
Ejemplo n.º 20
0
 public static void Start(string caption)
 {
     if (_waitFrm != null)
     {
         _waitFrm.Close();
     }
     _waitFrm = new WaitDialogForm(caption);
     _waitFrm.Show();
 }
Ejemplo n.º 21
0
 public static void Start(string caption, string title, Size size, System.Windows.Forms.Form parent)
 {
     if (_waitFrm != null)
     {
         _waitFrm.Close();
     }
     _waitFrm = new WaitDialogForm(caption, title, size, parent);
     _waitFrm.Show();
 }
Ejemplo n.º 22
0
 public static void Start()
 {
     if (_waitFrm != null)
     {
         _waitFrm.Close();
     }
     _waitFrm = new WaitDialogForm();
     _waitFrm.Show();
 }
 private void BeginInvoke(object sender, EventArgs e)
 {
     if (_wform == null)
     {
         _wform = new WaitDialogForm("正在加载,请稍候...");
     }
     _wform.Show();
     Application.DoEvents();
 }
Ejemplo n.º 24
0
        private void simpleConfirm_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textEditCid.Text))
            {
                XtraMessageBox.Show("请输入类目编码!", Constants.SYSTEM_PROMPT);
                textEditCid.Focus();
                return;
            }
            if (string.IsNullOrEmpty(textCatName.Text))
            {
                XtraMessageBox.Show("请输入类目名称!", Constants.SYSTEM_PROMPT);
                textCatName.Focus();
                return;
            }

            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            string cid = textEditCid.Text;
            List <Alading.Entity.StockCat> stockCatList = StockCatService.GetStockCat(c => c.StockCid == cid);

            if (stockCatList != null && stockCatList.Count > 0)
            {
                waitForm.Close();
                XtraMessageBox.Show("类目编码与数据库中已有类目编码重复,请重输!", Constants.SYSTEM_PROMPT);
                return;
            }
            else
            {
                try
                {
                    Alading.Entity.StockCat stockCat = new Alading.Entity.StockCat();
                    stockCat.IsParent     = false;
                    stockCat.ParentCid    = textEditFatherCode.Text;
                    stockCat.StockCatName = textCatName.Text;
                    stockCat.StockCid     = textEditCid.Text;
                    if (StockCatService.AddStockCat(stockCat) == ReturnType.Success)
                    {
                        waitForm.Close();
                        XtraMessageBox.Show("添加类目成功!", Constants.SYSTEM_PROMPT);
                        this.Close();
                        this.DialogResult = DialogResult.OK;
                    }
                    else
                    {
                        waitForm.Close();
                        XtraMessageBox.Show("添加类目失败!", Constants.SYSTEM_PROMPT);
                    }
                }
                catch (Exception ex)
                {
                    waitForm.Close();
                    XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT);
                }
            }
        }
Ejemplo n.º 25
0
 void WcfSearchLookUpEdit_QueryPopUp(object sender, CancelEventArgs e)
 {
     if (Properties.DataSource == null)
     {
         e.Cancel = true;
         LoadData();
         _waitForm = new WaitDialogForm();
         _waitForm.Show();
     }
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 响应条形码回车事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void repositoryItemTextEdit1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         TextEdit textEdit = (TextEdit)sender;
         if (!string.IsNullOrEmpty(textEdit.Text))
         {
             WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
             waitForm.Show();
             try
             {
                 string skuOuterID = textEdit.Text;
                 List <View_StockItemProduct> vsipList = View_StockItemProductService.GetView_StockItemProduct(v => v.SkuOuterID == skuOuterID);
                 if (vsipList.Count > 0)
                 {
                     View_StockItemProduct vsip = vsipList.First();
                     DataRow dRow     = dTable.NewRow();
                     int     rowCount = gvProductSJ.RowCount;
                     for (int i = 0; i < rowCount; i++)
                     {
                         DataRow row = gvProductSJ.GetDataRow(i);
                         if (row["SkuOuterID"].ToString() == vsip.SkuOuterID)
                         {
                             return;
                         }
                     }
                     dRow["CatName"]      = vsip.CatName;
                     dRow["ProductName"]  = vsip.Name;
                     dRow["SkuOuterID"]   = vsip.SkuOuterID;
                     dRow["StockCatName"] = vsip.StockCatName;
                     dRow["OuterID"]      = vsip.OuterID;
                     dRow["SaleProps"]    = vsip.SkuProps_Str;
                     dRow["TotalMoney"]   = vsip.SkuPrice;
                     dTable.Rows.Add(dRow);
                     waitForm.Close();
                     gvProductSJ.BestFitColumns();
                 }
                 else
                 {
                     waitForm.Close();
                     XtraMessageBox.Show("找不到相应的商品", Constants.SYSTEM_PROMPT);
                 }
             }
             catch (Exception ex)
             {
                 waitForm.Close();
                 XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
         else
         {
             XtraMessageBox.Show("请输入条形码", Constants.SYSTEM_PROMPT);
         }
     }
 }
Ejemplo n.º 27
0
 public bool showLoading(string message)
 {
     try
     {
         dlg = new DevExpress.Utils.WaitDialogForm(message, "โปรแกรมกำลังทำงาน");
         dlg.Show();
         return true;
     }
     catch
     {
         return false;
     }
 }
Ejemplo n.º 28
0
 public static void Start(string caption, string title, bool flag)
 {
     if (_waitFrm != null)
     {
         _waitFrm.Close();
     }
     if (flag && (ShowOperateInfo != null))
     {
         ShowOperateInfo();
     }
     _waitFrm = new WaitDialogForm(caption, title);
     _waitFrm.Show();
 }
Ejemplo n.º 29
0
 void Get()
 {
     if (bEditBarCode.EditValue != null && !string.IsNullOrEmpty(bEditBarCode.EditValue.ToString()))
     {
         WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
         waitForm.Show();
         try
         {
             string skuOuterID = bEditBarCode.EditValue.ToString();
             List <View_StockItemProduct> vsipList = View_StockItemProductService.GetView_StockItemProduct(v => v.SkuOuterID == skuOuterID);
             if (vsipList.Count > 0)
             {
                 View_StockItemProduct vsip = vsipList.First();
                 DataRow dRow     = dTable.NewRow();
                 int     rowCount = gvProductSJ.RowCount;
                 for (int i = 0; i < rowCount; i++)
                 {
                     DataRow row = gvProductSJ.GetDataRow(i);
                     if (row["SkuOuterID"].ToString() == vsip.SkuOuterID)
                     {
                         return;
                     }
                 }
                 dRow["CatName"]      = vsip.CatName;
                 dRow["ProductName"]  = vsip.Name;
                 dRow["SkuOuterID"]   = vsip.SkuOuterID;
                 dRow["StockCatName"] = vsip.StockCatName;
                 dRow["OuterID"]      = vsip.OuterID;
                 dRow["SaleProps"]    = vsip.SkuProps_Str;
                 dRow["TotalMoney"]   = vsip.SkuPrice;
                 dTable.Rows.Add(dRow);
                 waitForm.Close();
                 gvProductSJ.BestFitColumns();
             }
             else
             {
                 waitForm.Close();
                 XtraMessageBox.Show("找不到相应的商品", Constants.SYSTEM_PROMPT);
             }
         }
         catch (Exception ex)
         {
             waitForm.Close();
             XtraMessageBox.Show(ex.ToString(), Constants.SYSTEM_PROMPT, MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     else
     {
         XtraMessageBox.Show("请输入条形码", Constants.SYSTEM_PROMPT);
     }
 }
Ejemplo n.º 30
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddStockProp_Click(object sender, EventArgs e)
 {
     if (flag)
     {
         if (AddNewStockProp())
         {
             this.Close();
             this.DialogResult = DialogResult.OK;
         }
         else
         {
         }
     }
     else
     {
         WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);
         waitForm.Show();
         try
         {
             List <StockProp> list = StockPropService.GetStockProp(s => s.StockPid == pid);
             if (list.Count > 0)
             {
                 StockProp sp = list.First();
                 sp.Name = textEditPropName.Text;
                 if (StockPropService.UpdateStockProp(sp) == ReturnType.Success)
                 {
                     waitForm.Close();
                     XtraMessageBox.Show("修改成功!", Constants.SYSTEM_PROMPT);
                     this.Close();
                     this.DialogResult = DialogResult.OK;
                 }
                 else
                 {
                     waitForm.Close();
                     XtraMessageBox.Show("修改失败!", Constants.SYSTEM_PROMPT);
                 }
             }
             else
             {
                 waitForm.Close();
                 XtraMessageBox.Show("找不到该属性信息,修改失败!", Constants.SYSTEM_PROMPT);
             }
         }
         catch (Exception ex)
         {
             waitForm.Close();
             XtraMessageBox.Show("修改失败!", Constants.SYSTEM_PROMPT);
         }
     }
 }
Ejemplo n.º 31
0
        /// <summary>
        /// 增加新的PropValue
        /// </summary>
        /// <returns></returns>
        bool AddNewStockProp()
        {
            if (textEditValueName.Text == null || string.IsNullOrEmpty(textEditValueName.Text.Trim()))
            {
                XtraMessageBox.Show("请输入属性值名!", Constants.SYSTEM_PROMPT);
                textEditValueName.Focus();
                return(false);
            }
            WaitDialogForm waitForm = new WaitDialogForm(Constants.OPERATE_DB_DATA);

            waitForm.Show();
            try
            {
                string stockVid = textEditVid.Text;
                if (StockPropService.GetStockProp(s => s.StockPid == stockVid).Count > 0)
                {
                    waitForm.Close();
                    XtraMessageBox.Show("属性值编码与数据库中已有属性值编码相同,请重输!", Constants.SYSTEM_PROMPT);
                    textEditVid.Focus();
                    return(false);
                }
                StockPropValue spv = new StockPropValue();
                spv.IsParent  = false;
                spv.Name      = textEditValueName.Text;
                spv.StockPid  = PropPid;
                spv.PropName  = PropName;
                spv.SortOrder = 0;
                spv.Status    = string.Empty;
                spv.StockCid  = stockCid;//
                spv.StockVid  = stockVid;
                if (StockPropValueService.AddStockPropValue(spv) == ReturnType.Success)
                {
                    waitForm.Close();
                    XtraMessageBox.Show("添加属性值成功!", Constants.SYSTEM_PROMPT);
                    return(true);
                }
                else
                {
                    waitForm.Close();
                    XtraMessageBox.Show("添加属性值失败!", Constants.SYSTEM_PROMPT);
                    return(false);
                }
            }
            catch (Exception ex)
            {
                waitForm.Close();
                XtraMessageBox.Show("添加属性值失败!", Constants.SYSTEM_PROMPT);
                return(false);
            }
        }
Ejemplo n.º 32
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();
        }
Ejemplo n.º 33
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();
        }
Ejemplo n.º 34
0
        private void btImport_Click_1(object sender, EventArgs e)
        {
            //����
            if (checkedListBox1.SelectedItem == null) return;
            IEnumerator ie = null;
            switch (checkedListBox1.SelectedItem.ToString()) {
                case "ĸ��":
                    ie = importMX();
                    break;
                case "��·":
                    ie = importXL();
                    break;
                case "�������ѹ��":
                    ie = importBYQ2();
                    break;
                case "�������ѹ��":
                    ie = importBYQ3();
                    break;
                case "�����":
                    ie = importFDJ();
                    break;
                case "����":
                    ie = importFH();
                    break;
                case "����������":
                    ie = importBLDR();
                    break;
            }
            if (gridControl1.DataSource!=null)
            {
                ncount = (gridControl1.DataSource as DataTable).Rows.Count;
                ncurrent = 0;
                if (ie != null)
                {
                    WaitDialogForm msgbox = new WaitDialogForm("", "�������ݣ����Ժ򡣡���");
                    msgbox.Show();

                    while (ie.MoveNext())
                    {
                        msgbox.SetCaption(string.Format("�����{0}/{1}", ncurrent, ncount));
                    }
                    Thread.Sleep(1000);
                    msgbox.Close();
                }
            }
        }