コード例 #1
0
 /// <summary>
 /// 页面加载业务处理
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MyEnterBillControl_Load(object sender, EventArgs e)
 {
     try
     {
         // 一定要注册,否则发布后会有水印
         _report.Title = BaseSystemInfo.SoftFullName;
         _report.Register(BillPrintHelper.GridReportKey);
         _report.Initialize  += ReportInitialize;
         _report.FetchRecord += ReportFetchRecord;
         _report.PrintBegin  += ReportPrintBegin;
         _report.PrintEnd    += ReportPrintEnd;
         // 最大寄件选择日期
         txtSendDate.Properties.MaxValue = DateTime.Now;
         // 最小寄件选择日期
         //txtSendDate.Properties.MinValue = DateTime.Now.AddDays(-6);
         txtSendDate.Text = DateTime.Now.ToString(BaseSystemInfo.DateFormat);
         var result1 = BillPrintHelper.GetLoadDefaultSendMan();
         if (string.IsNullOrEmpty(result1))
         {
             ckGetDefaultSendMan.Checked = false;
         }
         else
         {
             ckGetDefaultSendMan.Checked = result1 == "1";
         }
         BindArea();
     }
     catch (Exception ex)
     {
         LogUtil.WriteException(ex);
     }
 }
コード例 #2
0
ファイル: FrmAddZtoBill.cs プロジェクト: zanderzhg/STO.Print
        /// <summary>
        /// 加载默认的复选框状态值
        /// </summary>
        void LoadDefaultData()
        {
            var result = BillPrintHelper.GetLoadDefaultSendMan();

            if (string.IsNullOrEmpty(result))
            {
                ckTodaySend.Checked = false;
                txtSendDate.Text    = "";
            }
            else
            {
                ckTodaySend.Checked = result == "1";
                txtSendDate.Text    = DateTime.Now.ToString(BaseSystemInfo.DateFormat);
            }

            var result1 = BillPrintHelper.GetLoadDefaultSendMan();

            if (string.IsNullOrEmpty(result1))
            {
                ckGetDefaultSendMan.Checked = false;
            }
            else
            {
                ckGetDefaultSendMan.Checked = result1 == "1";
            }
        }
コード例 #3
0
        /// <summary>
        /// 窗体加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmAddZto180ElecBill_Load(object sender, EventArgs e)
        {
            // 到付和代收不可以编辑的还有单号也不能自己填写的
            myEnterBillControl1.txtToPayMent.Enabled    = false;
            myEnterBillControl1.txtGoodsPayment.Enabled = false;
            myEnterBillControl1.txtBillCode.Enabled     = false;

            var result = BillPrintHelper.GetLoadDefaultSendMan();

            if (!string.IsNullOrEmpty(result))
            {
                if (result == "1")
                {
                    myEnterBillControl1.txtReceiveMan.Focus();
                    myEnterBillControl1.txtReceiveMan.Select();
                }
            }
            if (!string.IsNullOrEmpty(SelectedId))
            {
                this.Text = @"编辑申通普通电子面单";

                myEnterBillControl1.PrintBillId = SelectedId;
                // 绑定收发件人的信息
                ZtoPrintBillEntity billEntity = _printBillManager.GetObject(SelectedId);
                myEnterBillControl1.txtSendMan.Text        = billEntity.SendMan;
                myEnterBillControl1.txtSendPhone.Text      = billEntity.SendPhone;
                myEnterBillControl1.txtSendCompany.Text    = billEntity.SendCompany;
                myEnterBillControl1.txtSendAddress.Text    = billEntity.SendAddress;
                myEnterBillControl1.dgvSendArea.Text       = string.Format("{0}-{1}-{2}", billEntity.SendProvince, billEntity.SendCity, billEntity.SendCounty).Replace(" ", "");
                myEnterBillControl1.txtReceiveMan.Text     = billEntity.ReceiveMan;
                myEnterBillControl1.txtReceivePhone.Text   = billEntity.ReceivePhone;
                myEnterBillControl1.txtReceiveCompany.Text = billEntity.ReceiveCompany;
                myEnterBillControl1.txtReceiveAddress.Text = billEntity.ReceiveAddress;
                myEnterBillControl1.txtBigPen.Text         = billEntity.BigPen;
                myEnterBillControl1.dgvReceiveArea.Text    = string.Format("{0}-{1}-{2}", billEntity.ReceiveProvince, billEntity.ReceiveCity, billEntity.ReceiveCounty).Replace(" ", "");
                myEnterBillControl1.cmbGoodsName.Text      = billEntity.GoodsName;
                myEnterBillControl1.txtGoodsWeight.Text    = billEntity.Weight;
                myEnterBillControl1.txtRemark.Text         = billEntity.Remark;
                myEnterBillControl1.txtOrderNumber.Text    = billEntity.OrderNumber;
                myEnterBillControl1.txtBillCode.Text       = billEntity.BillCode;
                // 这里防止重复获取,订单号一样,重复获取没关系啊,除非你改了订单号
                if (!string.IsNullOrEmpty(myEnterBillControl1.txtBillCode.Text))
                {
                    myEnterBillControl1.btnGetZtoElecBill.Enabled = false;
                    myEnterBillControl1.txtOrderNumber.Enabled    = false;
                }
                else
                {
                    myEnterBillControl1.btnGetZtoElecBill.Enabled = true;
                    myEnterBillControl1.txtOrderNumber.Enabled    = true;
                }
                if (!string.IsNullOrEmpty(billEntity.SendDate))
                {
                    myEnterBillControl1.txtSendDate.Text = BaseBusinessLogic.ConvertToDateToString(billEntity.SendDate);
                }
                myEnterBillControl1.txtSendMan.Select(0, 0);
                myEnterBillControl1.txtSendMan.Focus();
            }
        }
コード例 #4
0
        /// <summary>
        /// 窗体加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmImportExcelByTemplate_Load(object sender, EventArgs e)
        {
            var result = BillPrintHelper.GetTodaySend();

            if (string.IsNullOrEmpty(result))
            {
                ckTodaySend.Checked = false;
            }
            else
            {
                ckTodaySend.Checked = result == "1";
            }
            var result1 = BillPrintHelper.GetLoadDefaultSendMan();

            if (string.IsNullOrEmpty(result1))
            {
                ckUserDefaultSendMan.Checked = true;
            }
            else
            {
                ckUserDefaultSendMan.Checked = result == "1";
            }
            //var result2 = BillPrintHelper.GetPrintMarkFromServer();
            //if (string.IsNullOrEmpty(result2))
            //{
            //    ckGetServerPrintMark.Checked = false;
            //}
            //else
            //{
            //    ckGetServerPrintMark.Checked = result == "1";
            //}
            GridDataBind();
            var gridLocalizer = BuilderGridLocalizer.SetGridLocalizer();

            BuilderGridLocalizer.CustomButtonText(gridViewImportExcel, gridLocalizer);
            gridViewImportExcel.OptionsFind.AlwaysVisible = true;
            gridViewImportExcel.FindPanelVisible          = true;
            gridViewImportExcel.ShowFindPanel();
            CreatErrorInfoDataTableFromExcel();
            txtFileFullPath.Text = BillPrintHelper.GetDefaultExcelPath();
        }
コード例 #5
0
        /// <summary>
        /// 窗体加载事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FrmAddBill_Load(object sender, EventArgs e)
        {
            LoadDefaultData();
            BindArea();
            var result = BillPrintHelper.GetLoadDefaultSendMan();

            if (!string.IsNullOrEmpty(result))
            {
                if (result == "1")
                {
                    ckGetDefaultSendMan.Checked = true;
                    ckGetDefaultSendMan_CheckedChanged(this, null);
                    txtReceiveMan.Focus();
                    txtReceiveMan.Select();
                }
            }
            if (!string.IsNullOrEmpty(SelectedId))
            {
                this.Text = @"编辑圆通运单信息";
                // 绑定收发件人的信息
                ZtoPrintBillEntity billEntity = _printBillManager.GetObject(SelectedId);
                txtSendMan.Text        = billEntity.SendMan;
                txtSendPhone.Text      = billEntity.SendPhone;
                txtSendDeparture.Text  = billEntity.SendDeparture;
                txtSendCompany.Text    = billEntity.SendCompany;
                txtSendAddress.Text    = billEntity.SendAddress;
                dgvSearchSendArea.Text = string.Format("{0}-{1}-{2}", billEntity.SendProvince, billEntity.SendCity,
                                                       billEntity.SendCounty).Replace(" ", "");
                txtReceiveMan.Text         = billEntity.ReceiveMan;
                txtReceivePhone.Text       = billEntity.ReceivePhone;
                txtReceiveDestination.Text = billEntity.ReceiveDestination;
                txtReceiveCompany.Text     = billEntity.ReceiveCompany;
                txtReceiveAddress.Text     = billEntity.ReceiveAddress;
                txtPrintMark.Text          = billEntity.BigPen;
                dgvSearchReceiveArea.Text  = string.Format("{0}-{1}-{2}", billEntity.ReceiveProvince,
                                                           billEntity.ReceiveCity, billEntity.ReceiveCounty).Replace(" ", "");
            }
            _report.Initialize  += ReportInitialize;
            _report.FetchRecord += ReportFetchRecord;
        }
コード例 #6
0
        /// <summary>
        /// 加载默认的复选框状态值
        /// </summary>
        void LoadDefaultData()
        {
            var result = BillPrintHelper.GetLoadDefaultSendMan();

            if (string.IsNullOrEmpty(result))
            {
                ckTodaySend.Checked = false;
            }
            else
            {
                ckTodaySend.Checked = result == "1" ? true : false;
            }

            var result1 = BillPrintHelper.GetLoadDefaultSendMan();

            if (string.IsNullOrEmpty(result1))
            {
                ckGetDefaultSendMan.Checked = false;
            }
            else
            {
                ckGetDefaultSendMan.Checked = result1 == "1" ? true : false;
            }
        }