Exemplo n.º 1
0
        public bool JoinQueueSaleFuelTransport(CmcsAutotruck autotruck, CmcsSupplier supplier, CmcsTransportCompany transportCompany, CmcsFuelKind fuelKind, DateTime inFactoryTime, string remark, string place, string loadarea)
        {
            CmcsSaleFuelTransport transport = new CmcsSaleFuelTransport
            {
                SerialNumber         = carTransportDAO.CreateNewTransportSerialNumber(eCarType.销售煤, inFactoryTime),
                AutotruckId          = autotruck.Id,
                CarNumber            = autotruck.CarNumber,
                TransportCompanyName = transportCompany.Name,
                TransportCompanyId   = transportCompany.Id,
                SupplierName         = supplier.Name,
                SupplierId           = supplier.Id,
                FuelKindName         = fuelKind.Name,
                FuelKindId           = fuelKind.Id,
                InFactoryTime        = inFactoryTime,
                IsFinish             = 0,
                IsUse    = 1,
                StepName = eTruckInFactoryStep.入厂.ToString(),
                LoadArea = loadarea,
                Remark   = remark
            };

            if (SelfDber.Insert(transport) > 0)
            {
                // 插入未完成运输记录
                return(SelfDber.Insert(new CmcsUnFinishTransport
                {
                    TransportId = transport.Id,
                    CarType = eCarType.销售煤.ToString(),
                    AutotruckId = autotruck.Id,
                    PrevPlace = place,
                }) > 0);
            }
            return(false);
        }
Exemplo n.º 2
0
        private void dataGridViewX1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == -1 || e.RowIndex == -1)
            {
                return;
            }

            CmcsSupplier entity = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(superGridControl1.PrimaryGrid.GetCell(e.ColumnIndex, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

            if (entity == null)
            {
                return;
            }

            switch (superGridControl1.PrimaryGrid.Columns[e.ColumnIndex].Name)
            {
            case "clmDelete":
                // 查询正在使用该供应商的车数
                if (MessageBoxEx.Show("确定要删除该供应商?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Dbers.GetInstance().SelfDber.Delete <CmcsSupplier>(entity.Id);

                    BindData();
                }
                else
                {
                    MessageBoxEx.Show("该供应商正在使用中,禁止删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                break;
            }
        }
        private void superGridControl1_DataBindingComplete(object sender, GridDataBindingCompleteEventArgs e)
        {
            foreach (GridRow item in e.GridPanel.Rows)
            {
                try
                {
                    CmcsSaleFuelTransport cmcsBuyFuelTransport = item.DataItem as CmcsSaleFuelTransport;

                    CmcsFuelKind fk = Dbers.GetInstance().SelfDber.Get <CmcsFuelKind>(cmcsBuyFuelTransport.FuelKindId);
                    item.Cells["FuelKindName"].Value = fk != null ? fk.FuelName : "";

                    CmcsSupplier sp = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(cmcsBuyFuelTransport.SupplierId);
                    item.Cells["SupplierName"].Value = sp != null ? sp.Name : "";

                    CmcsTransportCompany tc = Dbers.GetInstance().SelfDber.Get <CmcsTransportCompany>(cmcsBuyFuelTransport.TransportCompanyId);
                    item.Cells["TransportCompanyName"].Value = tc != null ? tc.Name : "";

                    item.Cells["cellGrossWeight"].Value  = cmcsBuyFuelTransport.GrossWeight.ToString("f2");
                    item.Cells["cellTareWeight"].Value   = cmcsBuyFuelTransport.TareWeight.ToString("f2");
                    item.Cells["cellSuttleWeight"].Value = cmcsBuyFuelTransport.SuttleWeight.ToString("f2");

                    if (cmcsBuyFuelTransport.CarNumber != "总计")
                    {
                        item.Cells["cellInFactoryTime"].Value = cmcsBuyFuelTransport.InFactoryTime.ToShortDateString();
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 窗体加载绑定数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmSupplier_Oper_Load(object sender, EventArgs e)
        {
            cmb_CreditRank.SelectedIndex = 0;
            cmb_Type.SelectedIndex       = 0;

            this.CmcsSupplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(this.PId);
            if (this.CmcsSupplier != null)
            {
                txt_Code.Text = CmcsSupplier.Code;
                txt_Name.Text = CmcsSupplier.Name;
                HelperUtil.SelectedComboBoxItem(cmb_CreditRank, CmcsSupplier.CreditRank);
                txt_ShortName.Text = CmcsSupplier.ShortName;
                HelperUtil.SelectedComboBoxItem(cmb_Type, CmcsSupplier.Type);
                txt_RepIdentity.Text      = CmcsSupplier.RepIdentity;
                txt_OrganizationCode.Text = CmcsSupplier.OrganizationCode;
                db_RegisterFund.Value     = CmcsSupplier.RegisterFund;
                txt_LicenceNum.Text       = CmcsSupplier.LicenceNum;
                txt_Operallver.Text       = CmcsSupplier.Operallver;
                txt_TaxregCode.Text       = CmcsSupplier.TaxregCode;
                txt_LinkMan.Text          = CmcsSupplier.LinkMan;
                txt_LinkTel.Text          = CmcsSupplier.LinkTel;
                txt_Facsimile.Text        = CmcsSupplier.Facsimile;
                txt_Email.Text            = CmcsSupplier.Email;
                txt_PostalCode.Text       = CmcsSupplier.PostalCode;
                txt_Address.Text          = CmcsSupplier.Address;
                txt_Remark.Text           = CmcsSupplier.Remark;
                chb_IsUse.Checked         = (CmcsSupplier.IsStop == 0);
            }

            if (this.EditMode == eEditMode.查看)
            {
                btnSubmit.Enabled = false;
                HelperUtil.ControlReadOnly(panelEx2, true);
            }
        }
Exemplo n.º 5
0
        private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
        {
            foreach (GridRow gridRow in e.GridPanel.Rows)
            {
                CmcsSaleFuelTransport entity = gridRow.DataItem as CmcsSaleFuelTransport;
                if (entity == null)
                {
                    return;
                }
                CmcsSupplier supplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(entity.SupplierId);
                if (supplier != null)
                {
                    gridRow.Cells["clmSupplier"].Value = supplier.Name;
                }
                CmcsFuelKind fuelkind = Dbers.GetInstance().SelfDber.Get <CmcsFuelKind>(entity.FuelKindId);
                if (fuelkind != null)
                {
                    gridRow.Cells["clmFuelKind"].Value = fuelkind.FuelName;
                }
                CmcsTransportCompany company = Dbers.GetInstance().SelfDber.Get <CmcsTransportCompany>(entity.TransportCompanyId);
                if (company != null)
                {
                    gridRow.Cells["clmTransportCompany"].Value = company.Name;
                }

                if (entity.SupplierId == "合计")
                {
                    gridRow.Cells["clmSupplier"].Value           = "合计";
                    gridRow.Cells["clmFuelKind"].Visible         = false;
                    gridRow.Cells["clmTransportCompany"].Visible = false;
                    gridRow.Cells["clmGrossTime"].Visible        = false;
                    gridRow.Cells["clmTareTime"].Visible         = false;
                }
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 生成其他物资运输排队记录
        /// </summary>
        /// <param name="autotruck">车辆</param>
        /// <param name="supply">供货单位</param>
        /// <param name="receive">收货单位</param>
        /// <param name="goodsType">物资类型</param>
        /// <param name="inFactoryTime">入厂时间</param>
        /// <param name="remark">备注</param>
        /// <param name="place">地点</param>
        /// <returns></returns>
        public bool JoinQueueGoodsTransport(CmcsAutotruck autotruck, CmcsSupplier supply, CmcsSupplier receive, CmcsGoodsType goodsType, DateTime inFactoryTime, string remark, string place)
        {
            CmcsGoodsTransport transport = new CmcsGoodsTransport
            {
                SerialNumber    = carTransportDAO.CreateNewTransportSerialNumber(eCarType.其他物资, inFactoryTime),
                AutotruckId     = autotruck.Id,
                CarNumber       = autotruck.CarNumber,
                SupplyUnitId    = supply.Id,
                SupplyUnitName  = supply.Name,
                ReceiveUnitId   = receive.Id,
                ReceiveUnitName = receive.Name,
                GoodsTypeId     = goodsType.Id,
                GoodsTypeName   = goodsType.GoodsName,
                InFactoryTime   = inFactoryTime,
                IsFinish        = 0,
                IsUse           = 1,
                StepName        = eTruckInFactoryStep.入厂.ToString(),
                Remark          = remark
            };

            if (SelfDber.Insert(transport) > 0)
            {
                // 插入未完成运输记录
                return(SelfDber.Insert(new CmcsUnFinishTransport
                {
                    TransportId = transport.Id,
                    CarType = eCarType.其他物资.ToString(),
                    AutotruckId = autotruck.Id,
                    PrevPlace = place,
                }) > 0);
            }

            return(false);
        }
Exemplo n.º 7
0
        private void btnSelectSupplier_BuyFuel_Click(object sender, EventArgs e)
        {
            FrmSupplier_Select frm = new FrmSupplier_Select("where IsStop=0 order by Name asc");

            if (frm.ShowDialog() == DialogResult.OK)
            {
                this.SelectedSupplier_BuyFuel = frm.Output;
            }
        }
Exemplo n.º 8
0
 private void FrmSupplier_Select_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Escape)
     {
         this.Output       = null;
         this.DialogResult = DialogResult.Cancel;
         this.Close();
     }
 }
        private void btnSupplier_Click(object sender, EventArgs e)
        {
            FrmSupplier_Select Frm = new FrmSupplier_Select();

            Frm.ShowDialog();
            if (Frm.DialogResult == DialogResult.OK)
            {
                cmcsSupplier = Frm.Output;
                this.txt_SupplierName.Text = Frm.Output.Name;
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 同步全过程基础信息(公司信息)
        /// </summary>
        public void SyncBaseInfoForGS(Action <string, eOutputType> output, SqlServerDapperDber sqlDapperDber)
        {
            int res = 0;

            try
            {
                foreach (View_rlgl_dygl_gs qgc_gs in sqlDapperDber.Entities <View_rlgl_dygl_gs>())
                {
                    if (commonDAO.SelfDber.Get <View_rlgl_dygl_gs>(qgc_gs.Dbid.ToString()) != null)
                    {
                        commonDAO.SelfDber.Update <View_rlgl_dygl_gs>(qgc_gs);
                    }
                    else
                    {
                        commonDAO.SelfDber.Insert <View_rlgl_dygl_gs>(qgc_gs);
                    }

                    CmcsSupplier cmcsSupplier = commonDAO.SelfDber.Entity <CmcsSupplier>("where PkId=:PkId", new { PkId = qgc_gs.Dbid });
                    if (cmcsSupplier == null)
                    {
                        commonDAO.SelfDber.Insert(new CmcsSupplier()
                        {
                            PkId       = qgc_gs.Dbid,
                            TaxregCode = qgc_gs.Taxnumber,
                            Name       = qgc_gs.Corpname,
                            ShortName  = qgc_gs.Corpshortname,
                            Code       = qgc_gs.Gys,
                            Is_fhdw    = qgc_gs.Is_fhdw,
                            is_shhdw   = qgc_gs.Is_shhdw
                        });
                    }
                    else
                    {
                        cmcsSupplier.PkId       = qgc_gs.Dbid;
                        cmcsSupplier.TaxregCode = qgc_gs.Taxnumber;
                        cmcsSupplier.Name       = qgc_gs.Corpname;
                        cmcsSupplier.ShortName  = qgc_gs.Corpshortname;
                        cmcsSupplier.Code       = qgc_gs.Gys;
                        cmcsSupplier.Is_fhdw    = qgc_gs.Is_fhdw;
                        cmcsSupplier.is_shhdw   = qgc_gs.Is_shhdw;
                        commonDAO.SelfDber.Update(cmcsSupplier);
                    }

                    res++;
                }
            }
            catch (Exception ex)
            {
                output("同步公司信息报错," + ex.Message, eOutputType.Error);
            }
            output(string.Format("同步公司信息{0}条", res), eOutputType.Normal);
        }
Exemplo n.º 11
0
        void Return()
        {
            GridRow gridRow = superGridControl1.PrimaryGrid.ActiveRow as GridRow;

            if (gridRow == null)
            {
                return;
            }

            this.Output       = (gridRow.DataItem as CmcsSupplier);
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 12
0
        private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
        {
            foreach (GridRow gridRow in e.GridPanel.Rows)
            {
                CmcsSupplier entity = gridRow.DataItem as CmcsSupplier;
                if (entity == null)
                {
                    return;
                }

                // 填充有效状态
                gridRow.Cells["clmIsUse"].Value = entity.IsStop == "0"?"有效":"无效";
            }
        }
Exemplo n.º 13
0
        /// <summary>
        ///  生成入厂煤运输排队记录,同时生成批次信息以及采制化三级编码
        /// </summary>
        /// <param name="autotruck"></param>
        /// <param name="supplier"></param>
        /// <param name="mine"></param>
        /// <param name="transportCompany"></param>
        /// <param name="fuelKind"></param>
        /// <param name="ticketWeight"></param>
        /// <param name="inFactoryTime"></param>
        /// <param name="remark"></param>
        /// <param name="samplingType"></param>
        /// <param name="lmyb"></param>
        /// <param name="inFactoryType"></param>
        /// <returns></returns>
        public bool JoinQueueBuyFuelTransport(CmcsAutotruck autotruck, CmcsSupplier supplier, CmcsMine mine, CmcsTransportCompany transportCompany, CmcsFuelKind fuelKind, decimal ticketWeight, DateTime inFactoryTime, string remark, string samplingType, CmcsLMYB lmyb, string inFactoryType)
        {
            eTransportType TransportType;

            Enum.TryParse(inFactoryType, out TransportType);
            CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport
            {
                SerialNumber       = carTransportDAO.CreateNewTransportSerialNumber(TransportType, inFactoryTime),
                AutotruckId        = autotruck.Id,
                CarNumber          = autotruck.CarNumber,
                SupplierId         = supplier.Id,
                SupplierName       = supplier.Name,
                InFactoryPlace     = CommonAppConfig.GetInstance().AppIdentifier,
                MineId             = mine.Id,
                MineName           = mine.Name,
                TransportCompanyId = (transportCompany == null ? null : transportCompany.Id),
                FuelKindId         = fuelKind.Id,
                FuelKindName       = fuelKind.FuelName,
                TicketWeight       = ticketWeight,
                InFactoryTime      = inFactoryTime,
                IsFinish           = 0,
                IsUse         = 1,
                SamplingType  = samplingType,
                InFactoryType = inFactoryType.ToString(),
                StepName      = eTruckInFactoryStep.入厂.ToString(),
                Remark        = remark,
                LMYBId        = lmyb != null ? lmyb.Id : "",
                YbNum         = lmyb != null ? lmyb.YbNum : ""
            };

            // 生成批次以及采制化三级编码数据
            CmcsInFactoryBatch inFactoryBatch = carTransportDAO.GCQCInFactoryBatchByBuyFuelTransport(transport, lmyb);

            if (inFactoryBatch != null)
            {
                if (SelfDber.Insert(transport) > 0)
                {
                    // 插入未完成运输记录
                    return(SelfDber.Insert(new CmcsUnFinishTransport
                    {
                        TransportId = transport.Id,
                        CarType = inFactoryType.ToString(),
                        AutotruckId = autotruck.Id,
                        PrevPlace = CommonAppConfig.GetInstance().AppIdentifier,
                    }) > 0);
                }
            }

            return(false);
        }
Exemplo n.º 14
0
 private void FrmSupplier_Oper_Load(object sender, EventArgs e)
 {
     if (!String.IsNullOrEmpty(id))
     {
         this.cmcsSupplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(this.id);
         txt_Code.Text     = cmcsSupplier.Code;
         txt_Name.Text     = cmcsSupplier.Name;
         chb_IsUse.Checked = (cmcsSupplier.IsStop == "0");
     }
     if (!edit)
     {
         btnSubmit.Enabled = false;
         CMCS.CarTransport.Queue.Utilities.Helper.ControlReadOnly(panelEx2);
     }
 }
Exemplo n.º 15
0
        /// <summary>
        /// 窗体加载绑定数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmSupplier_Oper_Load(object sender, EventArgs e)
        {
            this.CmcsSupplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(this.PId);
            if (this.CmcsSupplier != null)
            {
                txt_Code.Text     = CmcsSupplier.Code;
                txt_Name.Text     = CmcsSupplier.Name;
                chb_IsUse.Checked = (CmcsSupplier.IsStop == 0);
            }

            if (this.EditMode == eEditMode.查看)
            {
                btnSubmit.Enabled = false;
                HelperUtil.ControlReadOnly(panelEx2, true);
            }
        }
Exemplo n.º 16
0
        private void FrmSaleFuelTransport_Oper_Load(object sender, EventArgs e)
        {
            LoadFuelkind(cmbFuelName_SaleFuel);

            if (!String.IsNullOrEmpty(id))
            {
                this.cmcsSaleFuelTransport = Dbers.GetInstance().SelfDber.Get <CmcsSaleFuelTransport>(this.id);
                if (!String.IsNullOrEmpty(this.cmcsSaleFuelTransport.TransportSalesId))
                {
                    cmcsTransportSales = Dbers.GetInstance().SelfDber.Get <CmcsLMYB>(this.cmcsSaleFuelTransport.TransportSalesId);
                }
                txt_SerialNumber.Text              = cmcsSaleFuelTransport.SerialNumber;
                txt_CarNumber.Text                 = cmcsSaleFuelTransport.CarNumber;
                txt_TransportSalesNum.Text         = cmcsSaleFuelTransport.TransportSalesNum;
                txt_TransportNo.Text               = cmcsSaleFuelTransport.TransportNo;
                txt_LoadArea.Text                  = cmcsSaleFuelTransport.LoadArea;
                cmbFuelName_SaleFuel.SelectedValue = cmcsSaleFuelTransport.FuelKindId;
                CmcsSupplier supplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(cmcsSaleFuelTransport.SupplierId);
                if (supplier != null)
                {
                    txt_SupplierName.Text = supplier.Name;
                }

                CmcsTransportCompany company = Dbers.GetInstance().SelfDber.Get <CmcsTransportCompany>(cmcsSaleFuelTransport.TransportCompanyId);
                if (company != null)
                {
                    txt_TransportCompanyName.Text = company.Name;
                }
                dbi_GrossWeight.Value   = (double)cmcsSaleFuelTransport.GrossWeight;
                dbi_TareWeight.Value    = (double)cmcsSaleFuelTransport.TareWeight;
                dbi_SuttleWeight.Value  = (double)cmcsSaleFuelTransport.SuttleWeight;
                txt_InFactoryTime.Text  = cmcsSaleFuelTransport.InFactoryTime.Year == 1 ? "" : cmcsSaleFuelTransport.InFactoryTime.ToString();
                txt_GrossTime.Text      = cmcsSaleFuelTransport.GrossTime.Year == 1 ? "" : cmcsSaleFuelTransport.GrossTime.ToString();
                txt_TareTime.Text       = cmcsSaleFuelTransport.TareTime.Year == 1 ? "" : cmcsSaleFuelTransport.TareTime.ToString();
                txt_OutFactoryTime.Text = cmcsSaleFuelTransport.OutFactoryTime.Year == 1 ? "" : cmcsSaleFuelTransport.OutFactoryTime.ToString();
                txt_LoadTime.Text       = cmcsSaleFuelTransport.LoadTime.Year == 1 ? "" : cmcsSaleFuelTransport.LoadTime.ToString();
                txt_Remark.Text         = cmcsSaleFuelTransport.Remark;
                chb_IsFinish.Checked    = (cmcsSaleFuelTransport.IsFinish == 1);
                chb_IsUse.Checked       = (cmcsSaleFuelTransport.IsUse == 1);
            }
            if (!edit)
            {
                btnSubmit.Enabled = false;
                CMCS.CarTransport.Queue.Utilities.Helper.ControlReadOnly(panelEx2);
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 生成入厂煤运输排队记录,同时生成批次信息以及采制化三级编码
        /// </summary>
        /// <param name="autotruck">车</param>
        /// <param name="supplier">供煤单位</param>
        /// <param name="mine">矿点</param>
        /// <param name="transportCompany">运输单位</param>
        /// <param name="fuelKind">煤种</param>
        /// <param name="ticketWeight">矿发量</param>
        /// <param name="inFactoryTime">入厂时间</param>
        /// <param name="remark">备注</param>
        /// <param name="place">地点</param>
        /// <param name="samplingType">采样方式</param>
        /// <param name="heavyweight">重车磅</param>
        /// <param name="samplingType">船号</param>
        /// <returns></returns>
        public bool JoinQueueBuyFuelTransport(CmcsAutotruck autotruck, CmcsSupplier supplier, CmcsMine mine, CmcsTransportCompany transportCompany, CmcsFuelKind fuelKind, decimal ticketWeight, DateTime inFactoryTime, string remark, string place, string heavyweight, string shipnumber)
        {
            CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport
            {
                SerialNumber         = carTransportDAO.CreateNewTransportSerialNumber(eCarType.入厂煤, inFactoryTime),
                AutotruckId          = autotruck.Id,
                CarNumber            = autotruck.CarNumber,
                SupplierId           = supplier.Id,
                SupplierName         = supplier.Name,
                MineId               = mine != null ? mine.Id:"",
                MineName             = mine != null ? mine.Name:"",
                TransportCompanyId   = transportCompany != null?transportCompany.Id:"",
                TransportCompanyName = transportCompany != null ? transportCompany.Name:"",
                FuelKindId           = fuelKind != null?fuelKind.Id:"",
                FuelKindName         = fuelKind != null ? fuelKind.Name:"",
                TicketWeight         = ticketWeight,
                InFactoryTime        = inFactoryTime,
                IsFinish             = 0,
                IsUse       = 1,
                StepName    = eTruckInFactoryStep.入厂.ToString(),
                Remark      = remark,
                HeavyWeight = heavyweight,
                ShipName    = shipnumber,
                Recorder    = GlobalVars.LoginUser.Name
            };

            // 生成批次以及采制化三级编码数据
            CmcsInFactoryBatch inFactoryBatch = carTransportDAO.GCQCInFactoryBatchByBuyFuelTransport(transport);

            if (inFactoryBatch != null)
            {
                if (SelfDber.Insert(transport) > 0)
                {
                    // 插入未完成运输记录
                    return(SelfDber.Insert(new CmcsUnFinishTransport
                    {
                        TransportId = transport.Id,
                        CarType = eCarType.入厂煤.ToString(),
                        AutotruckId = autotruck.Id,
                        PrevPlace = place,
                    }) > 0);
                }
            }

            return(false);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 生成入厂煤运输排队记录,同时生成批次信息以及采制化三级编码
        /// </summary>
        /// <param name="autotruck">车</param>
        /// <param name="supplier">供煤单位</param>
        /// <param name="mine">矿点</param>
        /// <param name="transportCompany">运输单位</param>
        /// <param name="fuelKind">煤种</param>
        /// <param name="ticketWeight">矿发量</param>
        /// <param name="inFactoryTime">入厂时间</param>
        /// <param name="Mpph">全过程煤批编号</param>
        /// <param name="sampler">指定采样机编号</param>
        /// <param name="remark">备注</param>
        /// <param name="place">地点</param>
        /// <returns></returns>
        public bool JoinQueueBuyFuelTransport(CmcsAutotruck autotruck, CmcsSupplier supplier, CmcsMine mine, CmcsTransportCompany transportCompany, CmcsFuelKind fuelKind, decimal ticketWeight, DateTime inFactoryTime, string Mpph, string sampler, string remark, string place)
        {
            CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport
            {
                SerialNumber         = carTransportDAO.CreateNewTransportSerialNumber(eCarType.入厂煤, inFactoryTime),
                AutotruckId          = autotruck.Id,
                CarNumber            = autotruck.CarNumber,
                SupplierId           = supplier.Id,
                SupplierName         = supplier.Name,
                MineId               = mine.Id,
                MineName             = mine.Name,
                TransportCompanyId   = transportCompany.Id,
                TransportCompanyName = transportCompany.Name,
                FuelKindId           = fuelKind.Id,
                FuelKindName         = fuelKind.Name,
                TicketWeight         = ticketWeight,
                InFactoryTime        = inFactoryTime,
                IsFinish             = 0,
                IsUse          = 1,
                Mpph           = Mpph,
                SamplePlace    = sampler,
                StepName       = eTruckInFactoryStep.入厂.ToString(),
                HistoryTareAvg = GetHistoryTareAvg(autotruck.CarNumber),
                Remark         = remark
            };

            // 生成批次以及采制化三级编码数据
            //CmcsInFactoryBatch inFactoryBatch = carTransportDAO.GCQCInFactoryBatchByBuyFuelTransport(transport);
            //if (inFactoryBatch != null)
            //{
            if (SelfDber.Insert(transport) > 0)
            {
                // 插入未完成运输记录
                return(SelfDber.Insert(new CmcsUnFinishTransport
                {
                    TransportId = transport.Id,
                    CarType = eCarType.入厂煤.ToString(),
                    AutotruckId = autotruck.Id,
                    PrevPlace = place,
                }) > 0);
            }
            //}

            return(false);
        }
Exemplo n.º 19
0
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (txt_Name.Text.Length == 0)
     {
         MessageBoxEx.Show("该供应商名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if ((cmcsSupplier == null || cmcsSupplier.Name != txt_Name.Text) && Dbers.GetInstance().SelfDber.Entities <CmcsSupplier>(" where Name=:Name", new { Name = txt_Name.Text }).Count > 0)
     {
         MessageBoxEx.Show("该供应商名称不可重复!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if (txt_Code.Text.Length == 0)
     {
         MessageBoxEx.Show("该供应商编号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if ((cmcsSupplier == null || cmcsSupplier.Code != txt_Code.Text) && Dbers.GetInstance().SelfDber.Entities <CmcsSupplier>(" where Code=:Code", new { Code = txt_Code.Text }).Count > 0)
     {
         MessageBoxEx.Show("该供应商编号不可重复!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if (cmcsSupplier != null)
     {
         cmcsSupplier.Name   = txt_Name.Text;
         cmcsSupplier.Code   = txt_Code.Text;
         cmcsSupplier.Valid  = (chb_IsUse.Checked ? "有效" : "无效");
         cmcsSupplier.IsStop = (chb_IsUse.Checked ? "0" : "1");
         Dbers.GetInstance().SelfDber.Update <CmcsSupplier>(cmcsSupplier);
     }
     else
     {
         cmcsSupplier         = new CmcsSupplier();
         cmcsSupplier.Name    = txt_Name.Text;
         cmcsSupplier.Code    = txt_Code.Text;
         cmcsSupplier.Valid   = (chb_IsUse.Checked ? "有效" : "无效");
         cmcsSupplier.IsStop  = (chb_IsUse.Checked ? "0" : "1");
         cmcsSupplier.IsSynch = "0";
         Dbers.GetInstance().SelfDber.Insert(cmcsSupplier);
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
        private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
        {
            foreach (GridRow gridRow in e.GridPanel.Rows)
            {
                CmcsBuyFuelTransport entity = gridRow.DataItem as CmcsBuyFuelTransport;
                if (entity == null)
                {
                    return;
                }

                // 填充有效状态
                gridRow.Cells["clmIsUse"].Value = (entity.IsUse == 1 ? "是" : "否");
                CmcsInFactoryBatch cmcsinfactorybatch = Dbers.GetInstance().SelfDber.Get <CmcsInFactoryBatch>(entity.InFactoryBatchId);
                if (cmcsinfactorybatch != null)
                {
                    gridRow.Cells["clmInFactoryBatchNumber"].Value = cmcsinfactorybatch.Batch;
                }
                CmcsSupplier cmcssupplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(entity.SupplierId);
                if (cmcssupplier != null)
                {
                    gridRow.Cells["SupplierName"].Value = cmcssupplier.Name;
                }

                //List<CmcsTransportPicture> cmcstrainwatchs = Dbers.GetInstance().SelfDber.Entities<CmcsTransportPicture>(String.Format(" where TransportId='{0}'", gridRow.Cells["clmId"].Value));
                //if (cmcstrainwatchs.Count == 0)
                //{
                //    //gridRow.Cells["clmPic"].Value = "";
                //}
                if (entity.GrossWeight > 0 || entity.TareWeight > 0)
                {
                    gridRow.Cells["clmDelete"].Value = "";
                }
                if (entity.GrossWeight > 0 && entity.TareWeight > 0)
                {
                    gridRow.CellStyles.Default.TextColor = Color.Green;
                }
                else if (entity.GrossWeight == 0 && entity.TareWeight == 0)
                {
                    gridRow.CellStyles.Default.TextColor = Color.Red;
                }
            }
        }
Exemplo n.º 21
0
        private void superGridControl1_CellMouseDown(object sender, DevComponents.DotNetBar.SuperGrid.GridCellMouseEventArgs e)
        {
            CmcsSupplier entity = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(superGridControl1.PrimaryGrid.GetCell(e.GridCell.GridRow.Index, superGridControl1.PrimaryGrid.Columns["clmId"].ColumnIndex).Value.ToString());

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

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

            case "clmDelete":
                // 查询正在使用该供应商的车数
                if (MessageBoxEx.Show("确定要删除该供应商?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    try
                    {
                        Dbers.GetInstance().SelfDber.Delete <CmcsSupplier>(entity.Id);
                    }
                    catch (Exception)
                    {
                        MessageBoxEx.Show("该供应商正在使用中,禁止删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }

                    BindData();
                }
                break;
            }
        }
Exemplo n.º 22
0
 /// <summary>
 /// 保存数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSubmit_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(txt_Name.Text))
     {
         MessageBoxEx.Show("该供应商名称不能为空!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if ((CmcsSupplier == null || CmcsSupplier.Name != txt_Name.Text) && Dbers.GetInstance().SelfDber.Entities <CmcsSupplier>(" where Name=:Name", new { Name = txt_Name.Text }).Count > 0)
     {
         MessageBoxEx.Show("该供应商名称不可重复!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if (string.IsNullOrWhiteSpace(txt_Code.Text))
     {
         MessageBoxEx.Show("该供应商编号不能为空!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if ((CmcsSupplier == null || CmcsSupplier.Code != txt_Code.Text) && Dbers.GetInstance().SelfDber.Entities <CmcsSupplier>(" where Code=:Code", new { Code = txt_Code.Text }).Count > 0)
     {
         MessageBoxEx.Show("该供应商编号不可重复!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     if (this.EditMode == eEditMode.修改)
     {
         CmcsSupplier.Name   = txt_Name.Text;
         CmcsSupplier.Code   = txt_Code.Text;
         CmcsSupplier.IsStop = (chb_IsUse.Checked ? 0 : 1);
         Dbers.GetInstance().SelfDber.Update(CmcsSupplier);
     }
     else if (this.EditMode == eEditMode.新增)
     {
         CmcsSupplier        = new CmcsSupplier();
         CmcsSupplier.Name   = txt_Name.Text;
         CmcsSupplier.Code   = txt_Code.Text;
         CmcsSupplier.IsStop = (chb_IsUse.Checked ? 0 : 1);
         Dbers.GetInstance().SelfDber.Insert(CmcsSupplier);
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
Exemplo n.º 23
0
        private void superGridControl1_DataBindingComplete(object sender, DevComponents.DotNetBar.SuperGrid.GridDataBindingCompleteEventArgs e)
        {
            foreach (GridRow item in e.GridPanel.Rows)
            {
                try
                {
                    CmcsLMYB CmcsLMYB = item.DataItem as CmcsLMYB;

                    CmcsSupplier fuelSupplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(CmcsLMYB.FuelSupplierId);
                    if (fuelSupplier != null)
                    {
                        item.Cells["cellFuelSupplierName"].Value = fuelSupplier != null ? fuelSupplier.Name : "";
                    }
                    item.Cells["cellInFactoryTime"].Value = CmcsLMYB.InFactoryTime.ToString("yyyy/MM/dd");

                    item.Cells["cellCoalNumber"].Value = CmcsLMYB.CoalNumber.ToString("f2");
                }
                catch (Exception)
                {
                }
            }
        }
Exemplo n.º 24
0
 private void btnDelSupplier_BuyFuel_Click(object sender, EventArgs e)
 {
     this.SelectedSupplier_BuyFuel = null;
 }
Exemplo n.º 25
0
        /// <summary>
        /// 生成入厂煤运输排队记录,同时生成批次信息以及采制化三级编码
        /// </summary>
        /// <param name="autotruck">车</param>
        /// <param name="supplier">供煤单位</param>
        /// <param name="mine">矿点</param>
        /// <param name="transportCompany">运输单位</param>
        /// <param name="fuelKind">煤种</param>
        /// <param name="ticketWeight">矿发量</param>
        /// <param name="inFactoryTime">入厂时间</param>
        /// <param name="remark">备注</param>
        /// <param name="place">地点</param>
        /// <param name="samplingType">采样方式</param>
        /// <returns></returns>
        public bool JoinQueueBuyFuelTransport(CmcsAutotruck autotruck, CmcsMine mine, CmcsTransportCompany transportCompany, CmcsFuelKind fuelKind, CmcsInNetTransport inNetTransport, decimal ticketWeight, string samplerCode, string weighterCode, DateTime inFactoryTime, string remark, string place, CmcsSupplier supplier = null)
        {
            CmcsBuyFuelTransport transport = new CmcsBuyFuelTransport
            {
                SerialNumber         = carTransportDAO.CreateNewTransportSerialNumber(eCarType.入厂煤, inFactoryTime),
                AutotruckId          = autotruck.Id,
                CarNumber            = autotruck.CarNumber,
                MineId               = mine.Id,
                MineName             = mine.Name,
                TransportCompanyId   = transportCompany.Id,
                TransportCompanyName = transportCompany.Name,
                FuelKindId           = fuelKind.Id,
                FuelKindName         = fuelKind.Name,
                TicketWeight         = ticketWeight,
                InFactoryTime        = inFactoryTime,
                IsFinish             = 0,
                IsUse             = 1,
                StepName          = eTruckInFactoryStep.入厂.ToString(),
                OutNetTransportId = inNetTransport == null ? "" : inNetTransport.Id,
                SamplePlace       = samplerCode,
                GrossPlace        = weighterCode,
                Remark            = remark,
                SamplingType      = eSamplingType.机械采样.ToString()
            };

            if (supplier != null)
            {
                transport.SupplierId   = supplier.Id;
                transport.SupplierName = supplier.Name;
            }
            // 生成批次以及采制化三级编码数据
            CmcsInFactoryBatch inFactoryBatch = carTransportDAO.GCQCInFactoryBatchByBuyFuelTransport(transport);

            if (inFactoryBatch != null)
            {
                if (SelfDber.Insert(transport) > 0)
                {
                    if (inNetTransport != null)
                    {
                        //更新内网矿发运输记录节点状态
                        inNetTransport.StepName      = eTruckInFactoryStep.入厂.ToString();
                        inNetTransport.Infactorytime = inFactoryTime;
                        SelfDber.Update(inNetTransport);
                    }

                    // 插入未完成运输记录
                    return(SelfDber.Insert(new CmcsUnFinishTransport
                    {
                        TransportId = transport.Id,
                        CarType = eCarType.入厂煤.ToString(),
                        AutotruckId = autotruck.Id,
                        PrevPlace = place,
                    }) > 0);
                }
            }

            return(false);
        }
Exemplo n.º 26
0
        /// <summary>
        /// 同步全过程基础信息(供应商信息)
        /// </summary>
        public void SyncBaseInfoForGYS(Action <string, eOutputType> output, SqlServerDapperDber sqlDapperDber)
        {
            int res = 0;

            try
            {
                foreach (View_gys qgc_gys in sqlDapperDber.Entities <View_gys>())
                {
                    if (commonDAO.SelfDber.Get <View_gys>(qgc_gys.Dbid.ToString()) != null)
                    {
                        commonDAO.SelfDber.Update <View_gys>(qgc_gys);
                    }
                    else
                    {
                        commonDAO.SelfDber.Insert <View_gys>(qgc_gys);
                    }

                    CmcsSupplier cmcsSupplier = commonDAO.SelfDber.Entity <CmcsSupplier>("where PkId=:PkId", new { PkId = qgc_gys.Dbid });
                    if (cmcsSupplier == null)
                    {
                        commonDAO.SelfDber.Insert(new CmcsSupplier()
                        {
                            PkId      = qgc_gys.Dbid,
                            Name      = qgc_gys.Gysqc,
                            ShortName = qgc_gys.Gysjc,
                            Code      = qgc_gys.Gysbm,
                            IsStop    = int.Parse(qgc_gys.Is_valid)
                        });
                    }
                    else
                    {
                        cmcsSupplier.PkId      = qgc_gys.Dbid;
                        cmcsSupplier.Name      = qgc_gys.Gysqc;
                        cmcsSupplier.ShortName = qgc_gys.Gysjc;
                        cmcsSupplier.Code      = qgc_gys.Gysbm;
                        cmcsSupplier.IsStop    = int.Parse(qgc_gys.Is_valid);
                        commonDAO.SelfDber.Update(cmcsSupplier);
                    }

                    CmcsTransportCompany cmcsTransportCompany = commonDAO.SelfDber.Entity <CmcsTransportCompany>("where PkId=:PkId", new { PkId = qgc_gys.Dbid });
                    if (cmcsTransportCompany == null)
                    {
                        commonDAO.SelfDber.Insert(new CmcsTransportCompany()
                        {
                            PkId   = qgc_gys.Dbid,
                            Name   = qgc_gys.Gysqc,
                            IsStop = int.Parse(qgc_gys.Is_valid),
                            Code   = qgc_gys.Gysbm
                        });
                    }
                    else
                    {
                        cmcsTransportCompany.PkId   = qgc_gys.Dbid;
                        cmcsTransportCompany.Name   = qgc_gys.Gysqc;
                        cmcsTransportCompany.IsStop = int.Parse(qgc_gys.Is_valid);
                        cmcsTransportCompany.Code   = qgc_gys.Gysbm;
                        commonDAO.SelfDber.Update(cmcsTransportCompany);
                    }

                    res++;
                }
            }
            catch (Exception ex)
            {
                output("同步供应商信息报错," + ex.Message, eOutputType.Error);
            }
            output(string.Format("同步供应商信息{0}条", res), eOutputType.Normal);
        }
 private void FrmBuyFuelTransport_Oper_Load(object sender, EventArgs e)
 {
     LoadSampleType(cmb_SampingType);
     cmbFuelName_BuyFuel.DisplayMember = "FuelName";
     cmbFuelName_BuyFuel.ValueMember   = "Id";
     cmbFuelName_BuyFuel.DataSource    = Dbers.GetInstance().SelfDber.Entities <CmcsFuelKind>("where Valid='有效' and ParentId is not null");
     cmbFuelName_BuyFuel.SelectedIndex = 0;
     if (!String.IsNullOrEmpty(id))
     {
         this.cmcsBuyFuelTransport = Dbers.GetInstance().SelfDber.Get <CmcsBuyFuelTransport>(this.id);
         txt_SerialNumber.Text     = cmcsBuyFuelTransport.SerialNumber;
         txt_CarNumber.Text        = cmcsBuyFuelTransport.CarNumber;
         CmcsInFactoryBatch cmcsinfactorybatch = Dbers.GetInstance().SelfDber.Get <CmcsInFactoryBatch>(cmcsBuyFuelTransport.InFactoryBatchId);
         if (cmcsinfactorybatch != null)
         {
             txt_InFactoryBatchNumber.Text = cmcsinfactorybatch.Batch;
         }
         if (cmcsBuyFuelTransport.SupplierId != null)
         {
             CmcsSupplier supplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(cmcsBuyFuelTransport.SupplierId);
             if (supplier != null)
             {
                 txt_SupplierName.Text = supplier.Name;
             }
         }
         if (cmcsBuyFuelTransport.TransportCompanyId != null)
         {
             CmcsTransportCompany company = Dbers.GetInstance().SelfDber.Get <CmcsTransportCompany>(cmcsBuyFuelTransport.TransportCompanyId);
             if (company != null)
             {
                 txt_TransportCompanyName.Text = company.Name;
             }
         }
         if (cmcsBuyFuelTransport.MineId != null)
         {
             CmcsMine mine = Dbers.GetInstance().SelfDber.Get <CmcsMine>(cmcsBuyFuelTransport.MineId);
             if (mine != null)
             {
                 txt_MineName.Text = mine.Name;
             }
         }
         if (cmcsBuyFuelTransport.FuelKindId != null)
         {
             CmcsFuelKind fuelkind = Dbers.GetInstance().SelfDber.Get <CmcsFuelKind>(cmcsBuyFuelTransport.FuelKindId);
             if (fuelkind != null)
             {
                 cmbFuelName_BuyFuel.Text = fuelkind.FuelName;
             }
         }
         cmb_SampingType.SelectedItem = cmcsBuyFuelTransport.SamplingType;
         dbi_TicketWeight.Value       = (double)cmcsBuyFuelTransport.TicketWeight;
         dbi_GrossWeight.Value        = (double)cmcsBuyFuelTransport.GrossWeight;
         dbi_TareWeight.Value         = (double)cmcsBuyFuelTransport.TareWeight;
         dbi_DeductWeight.Value       = (double)cmcsBuyFuelTransport.DeductWeight;
         dbi_SuttleWeight.Value       = (double)cmcsBuyFuelTransport.SuttleWeight;
         dbi_CheckWeight.Value        = (double)cmcsBuyFuelTransport.CheckWeight;
         dbi_ProfitWeight.Value       = (double)cmcsBuyFuelTransport.ProfitAndLossWeight;
         dbi_KgWeight.Value           = (double)cmcsBuyFuelTransport.KgWeight;
         dbi_KsWeight.Value           = (double)cmcsBuyFuelTransport.KsWeight;
         dbi_AutoKsWeight.Value       = (double)cmcsBuyFuelTransport.AutoKsWeight;
         txt_UnloadArea.Text          = cmcsBuyFuelTransport.UnLoadArea;
         txt_InFactoryTime.Text       = cmcsBuyFuelTransport.InFactoryTime.Year == 1 ? "" : cmcsBuyFuelTransport.InFactoryTime.ToString();
         txt_SamplingTime.Text        = cmcsBuyFuelTransport.SamplingTime.Year == 1 ? "" : cmcsBuyFuelTransport.SamplingTime.ToString();
         txt_GrossTime.Text           = cmcsBuyFuelTransport.GrossTime.Year == 1 ? "" : cmcsBuyFuelTransport.GrossTime.ToString();
         txt_UploadTime.Text          = cmcsBuyFuelTransport.UploadTime.Year == 1 ? "" : cmcsBuyFuelTransport.UploadTime.ToString();
         txt_TareTime.Text            = cmcsBuyFuelTransport.TareTime.Year == 1 ? "" : cmcsBuyFuelTransport.TareTime.ToString();
         txt_OutFactoryTime.Text      = cmcsBuyFuelTransport.OutFactoryTime.Year == 1 ? "" : cmcsBuyFuelTransport.OutFactoryTime.ToString();
         txt_Remark.Text      = cmcsBuyFuelTransport.Remark;
         chb_IsFinish.Checked = (cmcsBuyFuelTransport.IsFinish == 1);
         chb_IsUse.Checked    = (cmcsBuyFuelTransport.IsUse == 1);
         cmb_SampingType.Text = cmcsBuyFuelTransport.SamplingType;
         ShowDeduct(this.cmcsBuyFuelTransport.Id);
     }
     if (!edit)
     {
         btnSubmit.Enabled = false;
         CMCS.CarTransport.Queue.Utilities.Helper.ControlReadOnly(panelEx2);
     }
 }
Exemplo n.º 28
0
        private void _PrintDocument_PrintPage(object sender, PrintPageEventArgs e)
        {
            Graphics g = e.Graphics;

            if (this.gs != null)
            {
                g = this.gs;
            }

            string SerialNumber        = string.Empty,
                   CarNumber           = string.Empty,
                   MineName            = string.Empty,
                   SupplierName        = string.Empty,
                   GrossTime           = string.Empty,
                   TareTime            = string.Empty,
                   TicketWeight        = string.Empty,
                   GrossWeight         = string.Empty,
                   TareWeight          = string.Empty,
                   ProfitAndLossWeight = string.Empty,
                   SuttleWeight        = string.Empty,
                   DeductWeight        = string.Empty,
                   UserName            = string.Empty,
                   TransportCompany    = string.Empty,
                   FuelKindName        = string.Empty,
                   PoundsWorse         = string.Empty,
                   JingZhongChaoCha    = string.Empty;

            if (this._BuyFuelTransport != null)
            {
                if (_BuyFuelTransport.SupplierId != null)
                {
                    CmcsSupplier supplier = Dbers.GetInstance().SelfDber.Get <CmcsSupplier>(_BuyFuelTransport.SupplierId);
                    if (supplier != null)
                    {
                        SupplierName = supplier.Name;
                    }
                }
                if (_BuyFuelTransport.MineId != null)
                {
                    CmcsMine mine = Dbers.GetInstance().SelfDber.Get <CmcsMine>(_BuyFuelTransport.MineId);
                    if (mine != null)
                    {
                        MineName = mine.Name;
                    }
                }
                if (_BuyFuelTransport.FuelKindId != null)
                {
                    CmcsFuelKind fuelkind = Dbers.GetInstance().SelfDber.Get <CmcsFuelKind>(_BuyFuelTransport.FuelKindId);
                    if (fuelkind != null)
                    {
                        FuelKindName = fuelkind.Name;
                    }
                }
                SerialNumber = this._BuyFuelTransport.SerialNumber;
                CarNumber    = this._BuyFuelTransport.CarNumber;
                GrossTime    = DisposeTime(this._BuyFuelTransport.GrossTime.ToString(), "yyyy-MM-dd HH:mm");
                TareTime     = DisposeTime(this._BuyFuelTransport.TareTime.ToString(), "yyyy-MM-dd HH:mm");
                TicketWeight = this._BuyFuelTransport.TicketWeight.ToString("F2").PadLeft(6, ' ');
                GrossWeight  = this._BuyFuelTransport.GrossWeight.ToString("F2").PadLeft(6, ' ');
                TareWeight   = this._BuyFuelTransport.TareWeight.ToString("F2").PadLeft(6, ' ');
                SuttleWeight = this._BuyFuelTransport.SuttleWeight.ToString("F2").PadLeft(6, ' ');
                DeductWeight = this._BuyFuelTransport.DeductWeight.ToString("F2").PadLeft(6, ' ');
                TicketWeight = this._BuyFuelTransport.TicketWeight.ToString("F2").PadLeft(6, ' ');

                #region 入厂煤
                // 行间距 24
                float  TopValue   = 20;
                string printValue = "";
                g.DrawString("华能渭南汽车过磅单", new Font("黑体", 18, FontStyle.Bold, GraphicsUnit.Pixel), Brushes.Black, 15, TopValue);
                TopValue += 34;

                g.DrawString("打印时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm"), ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawLine(new Pen(Color.Black, 2), 0, TopValue, 300 - 10, TopValue);
                TopValue += 15;

                g.DrawString("单    号:" + SerialNumber, ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString("车 牌 号:" + CarNumber, ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString("矿    点:" + MineName, ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString("供货单位:", ContentFont, Brushes.Black, 30, TopValue);
                printValue = SupplierName != null ? SupplierName : string.Empty;

                if (printValue.Length > 11)
                {
                    g.DrawString(printValue.Substring(0, 11), ContentFont, Brushes.Black, 105, TopValue);
                    TopValue += 24;
                    g.DrawString(printValue.Substring(11, printValue.Length - 11), ContentFont, Brushes.Black, 105, TopValue);
                    TopValue += 24;
                }
                else
                {
                    g.DrawString(printValue, ContentFont, Brushes.Black, 102, TopValue);
                    TopValue += 24;
                }

                g.DrawString("货物名称:" + FuelKindName, ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString("毛重时间:" + GrossTime, ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString("皮重时间:" + TareTime, ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("矿发净重:{0} 吨", TicketWeight), ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("毛    重:{0} 吨", GrossWeight), ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("皮    重:{0} 吨", TareWeight), ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("净    量:{0} 吨", SuttleWeight), ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("扣    吨:{0} 吨", DeductWeight), ContentFont, Brushes.Black, 30, TopValue);
                TopValue += 24;

                //g.DrawString(string.Format("验 收 量:{0} 吨", CheckWeight), ContentFont, Brushes.Black, 30, TopValue);
                //TopValue += 24;

                TopValue += 24;

                #endregion
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            if (txt_Name.Text.Length == 0)
            {
                MessageBoxEx.Show("该供应商名称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if ((CmcsSupplier == null || CmcsSupplier.Name != txt_Name.Text) && Dbers.GetInstance().SelfDber.Entities <CmcsSupplier>(" where Name=:Name", new { Name = txt_Name.Text }).Count > 0)
            {
                MessageBoxEx.Show("该供应商名称不可重复!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (txt_Code.Text.Length == 0)
            {
                MessageBoxEx.Show("该供应商编号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if ((CmcsSupplier == null || CmcsSupplier.Code != txt_Code.Text) && Dbers.GetInstance().SelfDber.Entities <CmcsSupplier>(" where Code=:Code", new { Code = txt_Code.Text }).Count > 0)
            {
                MessageBoxEx.Show("该供应商编号不可重复!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (txt_OrganizationCode.Text.Length == 0)
            {
                MessageBoxEx.Show("组织机构代码不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if ((CmcsSupplier == null || CmcsSupplier.OrganizationCode != txt_OrganizationCode.Text) && Dbers.GetInstance().SelfDber.Entities <CmcsSupplier>(" where OrganizationCode=:OrganizationCode", new { OrganizationCode = txt_OrganizationCode.Text }).Count > 0)
            {
                MessageBoxEx.Show("组织机构代码不可重复!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            if (txt_ShortName.Text.Length == 0)
            {
                MessageBoxEx.Show("供应商简称不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (this.EditMode == eEditMode.修改)
            {
                CmcsSupplier.OperUser    = CmcsSupplier.CreateUser;
                CmcsSupplier.Name        = txt_Name.Text;
                CmcsSupplier.Code        = txt_Code.Text;
                CmcsSupplier.ShortName   = txt_ShortName.Text;
                CmcsSupplier.CreditRank  = (cmb_CreditRank.SelectedItem as ComboItem).Text;
                CmcsSupplier.Type        = (cmb_Type.SelectedItem as ComboItem).Text;
                CmcsSupplier.RepIdentity = txt_RepIdentity.Text;
                //CmcsSupplier.OrganizationCode = txt_OrganizationCode.Text;
                CmcsSupplier.RegisterFund = db_RegisterFund.Value;
                CmcsSupplier.LicenceNum   = txt_LicenceNum.Text;
                CmcsSupplier.Operallver   = txt_Operallver.Text;
                CmcsSupplier.TaxregCode   = txt_TaxregCode.Text;
                CmcsSupplier.LinkMan      = txt_LinkMan.Text;
                CmcsSupplier.LinkTel      = txt_LinkTel.Text;
                CmcsSupplier.Facsimile    = txt_Facsimile.Text;
                CmcsSupplier.Email        = txt_Email.Text;
                CmcsSupplier.PostalCode   = txt_PostalCode.Text;
                CmcsSupplier.Address      = txt_Address.Text;
                CmcsSupplier.Remark       = txt_Remark.Text;
                CmcsSupplier.IsStop       = (chb_IsUse.Checked ? 0 : 1);
                CmcsSupplier.IsCheck      = 1;
                CmcsSupplier.IsSynch      = 0;
                Dbers.GetInstance().SelfDber.Update(CmcsSupplier);
            }
            else if (this.EditMode == eEditMode.新增)
            {
                CmcsSupplier                  = new CmcsSupplier();
                CmcsSupplier.CreateUser       = SelfVars.LoginUser.UserAccount;
                CmcsSupplier.OperUser         = CmcsSupplier.CreateUser;
                CmcsSupplier.Name             = txt_Name.Text;
                CmcsSupplier.Code             = txt_Code.Text;
                CmcsSupplier.ShortName        = txt_ShortName.Text;
                CmcsSupplier.CreditRank       = (cmb_CreditRank.SelectedItem as ComboItem).Text;
                CmcsSupplier.Type             = (cmb_Type.SelectedItem as ComboItem).Text;
                CmcsSupplier.RepIdentity      = txt_RepIdentity.Text;
                CmcsSupplier.OrganizationCode = txt_OrganizationCode.Text;
                CmcsSupplier.RegisterFund     = db_RegisterFund.Value;
                CmcsSupplier.LicenceNum       = txt_LicenceNum.Text;
                CmcsSupplier.Operallver       = txt_Operallver.Text;
                CmcsSupplier.TaxregCode       = txt_TaxregCode.Text;
                CmcsSupplier.LinkMan          = txt_LinkMan.Text;
                CmcsSupplier.LinkTel          = txt_LinkTel.Text;
                CmcsSupplier.Facsimile        = txt_Facsimile.Text;
                CmcsSupplier.Email            = txt_Email.Text;
                CmcsSupplier.PostalCode       = txt_PostalCode.Text;
                CmcsSupplier.Address          = txt_Address.Text;
                CmcsSupplier.Remark           = txt_Remark.Text;
                CmcsSupplier.IsStop           = (chb_IsUse.Checked ? 0 : 1);
                CmcsSupplier.IsCheck          = 1;
                CmcsSupplier.DataFrom         = "智能化排队程序录入";
                Dbers.GetInstance().SelfDber.Insert(CmcsSupplier);
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
Exemplo n.º 30
0
        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            string SerialNumber = string.Empty,
                   CarNumber    = string.Empty,
                   CustomerName = string.Empty,
                   CompanyName  = string.Empty,
                   FuelKindName = string.Empty,
                   GrossTime    = string.Empty,
                   TareTime     = string.Empty,
                   TicketWeight = string.Empty,
                   GrossWeight  = string.Empty,
                   TareWeight   = string.Empty,
                   SuttleWeight = string.Empty,
                   UserName     = string.Empty;

            if (this._BuyFuelTransport != null)
            {
                SerialNumber = this._BuyFuelTransport.SerialNumber;
                CarNumber    = this._BuyFuelTransport.CarNumber;
                CmcsFuelKind fuelkind = Dbers.GetInstance().SelfDber.Get <CmcsFuelKind>(this._BuyFuelTransport.FuelKindId);
                if (fuelkind != null)
                {
                    FuelKindName = fuelkind.FuelName;
                }
                CmcsSupplier customer = this._BuyFuelTransport.TheSupplier;
                if (customer != null)
                {
                    CustomerName = customer.Name;
                }
                CmcsTransportCompany company = Dbers.GetInstance().SelfDber.Get <CmcsTransportCompany>(this._BuyFuelTransport.TransportCompanyId);
                if (company != null)
                {
                    CompanyName = company.Name;
                }
                GrossTime    = DisposeTime(this._BuyFuelTransport.GrossTime.ToString(), "yyyy-MM-dd HH:mm");
                TareTime     = DisposeTime(this._BuyFuelTransport.TareTime.ToString(), "yyyy-MM-dd HH:mm");
                GrossWeight  = this._BuyFuelTransport.GrossWeight.ToString("F2").PadLeft(6, ' ');
                TareWeight   = this._BuyFuelTransport.TareWeight.ToString("F2").PadLeft(6, ' ');
                SuttleWeight = this._BuyFuelTransport.SuttleWeight.ToString("F2").PadLeft(6, ' ');

                #region 销售煤
                // 行间距 24
                float  TopValue   = 53;
                string printValue = "";
                g.DrawString("河南煤炭储配交易中心有限公司", new Font("黑体", 16, FontStyle.Bold, GraphicsUnit.Pixel), Brushes.White, 30, TopValue);
                TopValue += 34;

                g.DrawString("打印时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm"), ContentFont, Brushes.White, 30, TopValue);
                TopValue += 24;

                g.DrawLine(new Pen(Color.White, 2), 0, TopValue, 300 - 10, TopValue);
                TopValue += 15;

                g.DrawString("车 牌 号:" + CarNumber, ContentFont, Brushes.White, 30, TopValue);
                TopValue += 24;

                printValue = printValue = "发 货 方:鹤壁园区";
                if (printValue.Length > 19)
                {
                    g.DrawString(printValue.Substring(0, 19), ContentFont, Brushes.White, 30, TopValue);
                    TopValue += 24;
                    g.DrawString(printValue.Substring(19, printValue.Length - 19), ContentFont, Brushes.White, 105, TopValue);
                    TopValue += 24;
                }
                else
                {
                    g.DrawString(printValue, ContentFont, Brushes.White, 30, TopValue);
                    TopValue += 24;
                }

                printValue = printValue = "收货单位:" + CustomerName;
                if (printValue.Length > 19)
                {
                    g.DrawString(printValue.Substring(0, 19), ContentFont, Brushes.White, 30, TopValue);
                    TopValue += 24;
                    g.DrawString(printValue.Substring(19, printValue.Length - 19), ContentFont, Brushes.White, 105, TopValue);
                    TopValue += 24;
                }
                else
                {
                    g.DrawString(printValue, ContentFont, Brushes.White, 30, TopValue);
                    TopValue += 24;
                }

                printValue = printValue = "运输单位:" + CompanyName;
                if (printValue.Length > 18)
                {
                    g.DrawString(printValue.Substring(0, 18), ContentFont, Brushes.White, 30, TopValue);
                    TopValue += 24;
                    g.DrawString(printValue.Substring(18, printValue.Length - 18), ContentFont, Brushes.White, 105, TopValue);
                    TopValue += 24;
                }
                else
                {
                    g.DrawString(printValue, ContentFont, Brushes.White, 30, TopValue);
                    TopValue += 24;
                }

                g.DrawString("煤    种:" + FuelKindName, ContentFont, Brushes.White, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("毛    重:{0} 吨", GrossWeight), ContentFont, Brushes.White, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("皮    重:{0} 吨", TareWeight), ContentFont, Brushes.White, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("净    重:{0} 吨", SuttleWeight), ContentFont, Brushes.White, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("操 作 员:{0}", SelfVars.LoginUser.UserName), ContentFont, Brushes.White, 30, TopValue);
                TopValue += 24;

                g.DrawString(string.Format("签    字:"), ContentFont, Brushes.White, 30, TopValue);
                TopValue += 34;

                // g.DrawString(PageIndex.ToString() + "联", ContentFont, Brushes.White, 110, TopValue);
                TopValue += 24;
                #endregion
            }
        }