コード例 #1
0
ファイル: LineStoreController.cs プロジェクト: 88886/jnmmes
        public async Task <ActionResult> Save(LineStoreViewModel model)
        {
            using (LineStoreServiceClient client = new LineStoreServiceClient())
            {
                LineStore obj = new LineStore()
                {
                    Key = model.Name,
                    RouteOperationName = model.RouteOperationName,
                    Type         = model.Type,
                    LocationName = model.LocationName,
                    Description  = model.Description,
                    Editor       = User.Identity.Name,
                    EditTime     = DateTime.Now,
                    CreateTime   = DateTime.Now,
                    Creator      = User.Identity.Name
                };
                MethodReturnResult rst = await client.AddAsync(obj);

                if (rst.Code == 0)
                {
                    rst.Message = string.Format(FMMResources.StringResource.LineStore_Save_Success
                                                , model.Name);
                }
                return(Json(rst));
            }
        }
コード例 #2
0
ファイル: LabelDefControl.cs プロジェクト: renyh1013/dp2
        void menu_newFormat_Click(object sender, EventArgs e)
        {
            LabelLineFormatDialog dlg = new LabelLineFormatDialog();
            MainForm.SetControlFont(dlg, this.Font, false);
            dlg.CurrentUnit = this._currentUnit;
            dlg.DecimalPlaces = this.DecimalPlaces;
            dlg.Align = "left";
            dlg.StartPosition = FormStartPosition.CenterParent;
            dlg.ShowDialog(this);

            if (dlg.DialogResult == System.Windows.Forms.DialogResult.Cancel)
                return;

            ListViewItem item = new ListViewItem();
            ListViewUtil.ChangeItemText(item, COLUMN_FONT, dlg.FontString);
            ListViewUtil.ChangeItemText(item, COLUMN_ALIGN, dlg.Align);
            ListViewUtil.ChangeItemText(item, COLUMN_START, dlg.Start);
            ListViewUtil.ChangeItemText(item, COLUMN_OFFSET, dlg.Offset);

            LineStore store = new LineStore();
            store.UniversalStart = dlg.UniversalStart;
            store.UniversalOffset = dlg.UniversalOffset;
            item.Tag = store;

            ListViewUtil.ChangeItemText(item, COLUMN_FORECOLOR, dlg.ForeColorString);
            ListViewUtil.ChangeItemText(item, COLUMN_BACKCOLOR, dlg.BackColorString);

            this.listView_lineFormats.Items.Add(item);
            ListViewUtil.SelectLine(item, true);
            this.labelDesignControl1.LabelParam = this.GetLabelParam();
            _panelVersion++;
            SetChanged();
        }
コード例 #3
0
ファイル: LabelDefControl.cs プロジェクト: renyh1013/dp2
        void SetLabelParam(LabelParam param)
        {
            this.numericUpDown_pageWidth.UniverseValue = (decimal)param.PageWidth;
            this.numericUpDown_pageHeight.UniverseValue = (decimal)param.PageHeight;
            // this.checkBox_landscape.Checked = param.Landscape;
            this.rotateControl1.RotateDegree = param.RotateDegree;

            this.textBox_pagePadding.UniverseText = param.PageMargins.Left.ToString() + ","
        + param.PageMargins.Top.ToString() + ","
        + param.PageMargins.Right.ToString() + ","
        + param.PageMargins.Bottom.ToString();

            this.numericUpDown_labelWidth.UniverseValue = (decimal)param.LabelWidth;
            this.numericUpDown_labelHeight.UniverseValue = (decimal)param.LabelHeight;

            this.textBox_labelPadding.UniverseText = param.LabelPaddings.Left.ToString() + ","
                    + param.LabelPaddings.Top.ToString() + ","
                    + param.LabelPaddings.Right.ToString() + ","
                    + param.LabelPaddings.Bottom.ToString();

            if (param.IsBarcodeFont == true)
                this.textBox_labelFont.Text = Global.GetBarcodeFontString(param.Font);
            else
                this.textBox_labelFont.Text = FontUtil.GetFontString(param.Font);

            this.listView_lineFormats.Items.Clear();
            foreach (LineFormat line in param.LineFormats)
            {
                ListViewItem item = new ListViewItem();

                string strFontString = "";

                if (line.Font != null)
                {
                    if (line.IsBarcodeFont == true)
                        strFontString = Global.GetBarcodeFontString(line.Font);
                    else
                        strFontString = FontUtil.GetFontString(line.Font);
                }

                ListViewUtil.ChangeItemText(item, COLUMN_FONT, strFontString);
                ListViewUtil.ChangeItemText(item, COLUMN_ALIGN, line.Align);

                string strStart = GetStartString(this._currentUnit, line.StartX, line.StartY);
                ListViewUtil.ChangeItemText(item, COLUMN_START, strStart);
                string strOffset = GetOffsetString(this._currentUnit, line.OffsetX, line.OffsetY);
                ListViewUtil.ChangeItemText(item, COLUMN_OFFSET, strOffset);

                LineStore store = new LineStore();
                store.UniversalStart = GetStartString(GraphicsUnit.Display, line.StartX, line.StartY);
                store.UniversalOffset = GetOffsetString(GraphicsUnit.Display, line.OffsetX, line.OffsetY);
                item.Tag = store;

                ListViewUtil.ChangeItemText(item, COLUMN_FORECOLOR, line.ForeColor);
                ListViewUtil.ChangeItemText(item, COLUMN_BACKCOLOR, line.BackColor);
                this.listView_lineFormats.Items.Add(item);
            }

            this.numericUpDown_lineSep.UniverseValue = (decimal)param.LineSep;

            this.textBox_printerInfo.Text = param.DefaultPrinter;
        }