Ejemplo n.º 1
0
        private void FrmGoodsType_List_Shown(object sender, EventArgs e)
        {
            InitTree();

            //01查看 02增加 03修改 04删除
            btnAdd.Visible    = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "02", GlobalVars.LoginUser);
            btnUpdate.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "03", GlobalVars.LoginUser);
            btnDelete.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "04", GlobalVars.LoginUser);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 保存运输记录
        /// </summary>
        /// <returns></returns>
        bool SaveBuyFuelTransport()
        {
            CmcsAutotruck autoTruck = commonDAO.SelfDber.Entity <CmcsAutotruck>("where CarNumber=:CarNumber", new { CarNumber = this.txt_CarNumber.Text });

            if (autoTruck == null)
            {
                autoTruck = new CmcsAutotruck()
                {
                    CarNumber = this.txt_CarNumber.Text
                };
                commonDAO.SelfDber.Insert(autoTruck);
            }
            this.CurrentAutotruck = autoTruck;
            try
            {
                if (this.CurrentBuyFuelTransport == null)
                {
                    // 查找该车未完成的运输记录
                    CmcsUnFinishTransport unFinishTransport = carTransportDAO.GetUnFinishTransportByAutotruckId(this.CurrentAutotruck.Id, eCarType.入场煤.ToString());

                    if (unFinishTransport != null)
                    {
                        this.CurrentBuyFuelTransport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(unFinishTransport.TransportId);
                    }
                    else
                    {
                        CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport();
                        QueuerDAO.GetInstance().JoinQueueBuyFuelTransport(autoTruck, this.SelectedMine_BuyFuel, this.SelectedFuelKind_BuyFuel, Convert.ToDecimal(this.txtTicketWeight_BuyFuel.Value), DateTime.Now, "", ref transport);
                        this.CurrentBuyFuelTransport = transport;
                    }
                }
                this.CurrentBuyFuelTransport.KgWeight     = (decimal)this.txtKgWeight_BuyFuel.Value;
                this.CurrentBuyFuelTransport.KsWeight     = (decimal)this.txtKsWeight_BuyFuel.Value;
                this.CurrentBuyFuelTransport.DeductWeight = (decimal)this.txtKgWeight_BuyFuel.Value + (decimal)this.txtKsWeight_BuyFuel.Value;
                if (weighterDAO.SaveBuyFuelTransportHand(this.CurrentBuyFuelTransport, (decimal)Hardwarer.Wber.Weight, DateTime.Now, CommonAppConfig.GetInstance().AppIdentifier))
                {
                    this.CurrentBuyFuelTransport = commonDAO.SelfDber.Get <CmcsBuyFuelTransport>(this.CurrentBuyFuelTransport.Id);

                    LoadTodayUnFinishBuyFuelTransport();
                    LoadTodayFinishBuyFuelTransport();

                    return(true);
                }
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show("保存失败\r\n" + ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);

                Log4Neter.Error("保存运输记录", ex);
            }

            return(false);
        }
Ejemplo n.º 3
0
        private void FrmTransportCompany_List_Load(object sender, EventArgs e)
        {
            superGridControl1.PrimaryGrid.AutoGenerateColumns = false;

            //01查看 02增加 03修改 04删除
            btnAdd.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "02", GlobalVars.LoginUser);
            GridColumn clmEdit = superGridControl1.PrimaryGrid.Columns["clmEdit"];

            clmEdit.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "03", GlobalVars.LoginUser);
            GridColumn clmDelete = superGridControl1.PrimaryGrid.Columns["clmDelete"];

            clmDelete.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "04", GlobalVars.LoginUser);

            btnSearch_Click(null, null);
        }
        private void FrmGoodsTransport_List_Load(object sender, EventArgs e)
        {
            //01查看 02增加 03修改 04删除
            GridColumn clmEdit = superGridControl1.PrimaryGrid.Columns["clmEdit"];

            clmEdit.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "01", SelfVars.LoginUser);
            GridColumn clmDelete = superGridControl1.PrimaryGrid.Columns["clmDelete"];

            clmDelete.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "02", SelfVars.LoginUser);


            superGridControl1.PrimaryGrid.AutoGenerateColumns = false;

            dtpStartTime.Value = DateTime.Now;
            dtpEndTime.Value   = DateTime.Now;
            btnSearch_Click(null, null);
        }
Ejemplo n.º 5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            lblRegisDate.Visible = false;
            lblVersion.Text      = new AU.Updater().Version;
            this.Text            = CommonAppConfig.GetInstance().AppIdentifier;

            #region 初始化菜单查看权限
            if (GlobalVars.LoginUser.UserName != "admin")
            {
                foreach (var item in this.panelEx2.Controls)
                {
                    if (item.GetType() == typeof(ButtonX))
                    {
                        ButtonX btnFirst = item as ButtonX;
                        if (btnFirst.SubItems.Count == 0)
                        {
                            if (btnFirst.Tag != null)
                            {
                                //01 查看权限
                                if (!QueuerDAO.GetInstance().CheckPower(btnFirst.Tag.ToString(), "01", GlobalVars.LoginUser))
                                {
                                    btnFirst.Enabled = false;
                                }
                                else
                                {
                                    btnFirst.Enabled = true;
                                }
                            }
                        }
                        else
                        {
                            InitMenuPower(btnFirst.SubItems);
                        }
                    }
                }
            }
            #endregion

            this.superTabControl1.Tabs.Clear();
            FrmMainFrame.superTabControlManager = new SuperTabControlManager(this.superTabControl1);

            OpenQueuer();
            safeUtil.CheckRegister();
            lblRegisDate.ForeColor = System.Drawing.Color.Red;
        }
        private void FrmBuyFuelTransport_List_Load(object sender, EventArgs e)
        {
            //01查看 02增加 03修改 04删除
            GridColumn clmEdit = superGridControl1.PrimaryGrid.Columns["clmEdit"];

            clmEdit.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "01", SelfVars.LoginUser);
            GridColumn clmDelete = superGridControl1.PrimaryGrid.Columns["clmDelete"];

            clmDelete.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "02", SelfVars.LoginUser);
            HasShowSupplier   = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "03", SelfVars.LoginUser);

            //HasManagePower = CommonDAO.GetInstance().HasResourcePowerByResCode(SelfVars.LoginUser.UserAccount, eUserRoleCodes.汽车智能化信息维护.ToString());
            LoadFuelkind(cmbFuelName_BuyFuel);
            superGridControl1.PrimaryGrid.AutoGenerateColumns = false;
            dtpStartTime.Value = DateTime.Now;
            dtpEndTime.Value   = DateTime.Now;
            btnSearch_Click(null, null);
        }
Ejemplo n.º 7
0
        private void FrmGoodsTransport_List_Load(object sender, EventArgs e)
        {
            superGridControl1.PrimaryGrid.AutoGenerateColumns = false;

            //01查看 02增加 03修改 04删除
            GridColumn clmEdit = superGridControl1.PrimaryGrid.Columns["clmEdit"];

            clmEdit.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "03", GlobalVars.LoginUser);
            GridColumn clmDelete = superGridControl1.PrimaryGrid.Columns["clmDelete"];

            clmDelete.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "04", GlobalVars.LoginUser);

            dtInputStart.Value        = DateTime.Now.Date;
            dtInputEnd.Value          = dtInputStart.Value.AddDays(1);
            cmbTimeType.SelectedIndex = 0;

            BindStepName();

            btnSearch_Click(null, null);
        }
Ejemplo n.º 8
0
        private void InitMenuPower(SubItemsCollection btnItems)
        {
            foreach (ButtonItem btnItem in btnItems)
            {
                if (!string.IsNullOrEmpty(btnItem.Tag.ToString()))
                {
                    //01 查看权限
                    if (!QueuerDAO.GetInstance().CheckPower(btnItem.Tag.ToString(), "01", GlobalVars.LoginUser))
                    {
                        btnItem.Enabled = false;
                    }
                    else
                    {
                        btnItem.Enabled = true;
                    }
                }

                InitMenuPower(btnItem.SubItems);
            }
        }
Ejemplo n.º 9
0
        private void FrmMine_List_Shown(object sender, EventArgs e)
        {
            advTree1.Nodes.Clear();

            CmcsMine rootEntity = Dbers.GetInstance().SelfDber.Entity <CmcsMine>("where ParentId is null");

            DevComponents.AdvTree.Node rootNode = CreateNode(rootEntity);

            LoadData(rootEntity, rootNode);

            advTree1.Nodes.Add(rootNode);
            addCmcsMine(rootEntity);
            CMCS.CarTransport.Queue.Utilities.Helper.ControlReadOnly(this);


            //01查看 02增加 03修改 04删除
            BtnAdd.Visible    = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "02", SelfVars.LoginUser);
            BtnUpdate.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "03", SelfVars.LoginUser);
            BtnDelete.Visible = QueuerDAO.GetInstance().CheckPower(this.GetType().ToString(), "04", SelfVars.LoginUser);
        }
        private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e)
        {
            CmcsBuyFuelTransport entity = Dbers.GetInstance().SelfDber.Get <CmcsBuyFuelTransport>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

            switch (superGridControl1.PrimaryGrid.Columns[e.GridCell.ColumnIndex].Name)
            {
            case "clmShow":
                FrmBuyFuelTransport_Oper frmShow = new FrmBuyFuelTransport_Oper(entity.Id, false);
                if (frmShow.ShowDialog() == DialogResult.OK)
                {
                    BindData();
                }
                break;

            case "clmEdit":
                FrmBuyFuelTransport_Oper frmEdit = new FrmBuyFuelTransport_Oper(entity.Id, true);
                if (frmEdit.ShowDialog() == DialogResult.OK)
                {
                    BindData();
                }
                break;

            case "clmDelete":
                if (entity.GrossWeight > 0 || entity.TareWeight > 0)
                {
                    MessageBoxEx.Show("该记录已有重量,禁止删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                if (MessageBoxEx.Show("确定要删除该记录?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        CommonDAO.GetInstance().SaveAppletLog(eAppletLogLevel.Warn, "删除入场煤运输记录:", string.Format("车号:{0};毛重:{1};皮重:{2};矿点:{3};操作人:{4}", entity.CarNumber, entity.GrossWeight, entity.TareWeight, entity.MineName, SelfVars.LoginUser.UserName));

                        if (QueuerDAO.GetInstance().DeleteTransport(entity.Id))
                        {
                            CommonDAO.GetInstance().InsertWaitForHandleEvent("汽车智能化_删除入厂煤运输记录", entity.Id);
                        }
                    }
                    catch (Exception)
                    {
                        MessageBoxEx.Show("该记录正在使用中,禁止删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    BindData();
                }
                break;

            case "clmPic":

                if (Dbers.GetInstance().SelfDber.Entities <CmcsTransportPicture>(String.Format(" where TransportId='{0}'", entity.Id)).Count > 0)
                {
                    FrmTransportPicture frmPic = new FrmTransportPicture(entity.Id, entity.CarNumber);
                    if (frmPic.ShowDialog() == DialogResult.OK)
                    {
                        BindData();
                    }
                }
                else
                {
                    MessageBoxEx.Show("暂无抓拍图片!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                break;
            }
        }