コード例 #1
0
        /// <summary>
        /// 初始化页面首次调用的方法
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            //初始化信息的时候给首页的内容读取XML文件中的信息显示,读取需要显示的内容
            var indexDic = ReadXml.ReadXmlTitle();

            //通用内容整理—打印请假条,出工单
            PrintTool.Title         = string.IsNullOrEmpty(indexDic["title"]) ? "打印小工具" : indexDic["title"];    //软件名称
            LeavePrintDateTime.Text = GoWorkPrintDateTime.Text = "打印时间:" + DateTime.Now.ToString("yyyy-MM-dd"); //打印时间
            LevelCompanyName.Text   = GoWorkCompanyName.Text = string.IsNullOrEmpty(indexDic["companyName"])
                ? "甘肃联众建筑设计有限责任公司"
                : indexDic["companyName"]; //请假单和出工单共用的方法
            TabControl.FontSize = 16;      //字体大小限制为16px

            //打印—请假条
            LeaveTitle.Header = LeaveName.Text = string.IsNullOrEmpty(indexDic["leave"]) ? "请假条" : indexDic["leave"];
            LeveRemark.Text   = string.IsNullOrEmpty(indexDic["leaveRemak"]) ? "暂无备注" : indexDic["leaveRemak"]; //打印请假条备注

            //打印—出工单
            GoWork.Header     = GoWorkName.Text = string.IsNullOrEmpty(indexDic["goWork"]) ? "出工单" : indexDic["goWork"];
            GoWorkRemark.Text = string.IsNullOrEmpty(indexDic["goWorkRemrk"]) ? "暂无备注" : indexDic["goWorkRemrk"];
            string departMent = string.IsNullOrEmpty(indexDic["departMent"]) ? "建筑室,结构室,设备室、后勤" : indexDic["departMent"];

            //读取下拉列表信息
            BindDepartMentInfo(departMent);
        }
コード例 #2
0
        public MainWindow()
        {
            InitializeComponent();
            //初始化信息的时候给首页的内容读取XML文件中的信息显示,读取需要显示的内容
            var indexDic = ReadXml.ReadXmlTitle();

            PrintTool.Title = string.IsNullOrEmpty(indexDic["title"]) ? "打印小工具" : indexDic["title"]; //软件名称
            //打印功能名称
            Leave.Header = string.IsNullOrEmpty(indexDic["leave"]) ? "请假单" : indexDic["leave"];

            GoWork.Header       = string.IsNullOrEmpty(indexDic["goWork"]) ? "出工单" : indexDic["goWork"];
            CreateName.Content  = "接收时间:" + DateTime.Now.ToString("yyyy-MM-dd");
            TabControl.FontSize = 16;
        }
コード例 #3
0
        /// <summary>
        /// 读取XML文件中的信息,传递到前台进行绑定—出工单
        /// </summary>
        public static PrintTxtValue GetGoWorkPrintTxtValue()
        {
            //调用方法,读取XML
            var indexDic = ReadXml.ReadXmlTitle();
            //构造前段需要显示的信息
            var printTxtValue = new PrintTxtValue
            {
                PrintDateTime = NetworkDateTime.CurrentDateTime().ToString("yyyy-MM-dd HH:mm"),
                Title         = string.IsNullOrEmpty(indexDic["goWork"]) ? "出工单" : indexDic["goWork"],
                CompanyName   = string.IsNullOrEmpty(indexDic["companyName"]) ? "甘肃联众建筑设计有限责任公司" : indexDic["companyName"],
                Remark        = string.IsNullOrEmpty(indexDic["goWorkRemrk"]) ? "暂无备注" : indexDic["goWorkRemrk"]
            };

            return(printTxtValue);
        }
コード例 #4
0
        /// <summary>
        /// 读取XML文件中的信息,传递到前台进行绑定—请假条
        /// </summary>
        public static PrintTxtValue GetLeavePrintTxtValue(string departmentText, bool?thingHoliday, bool?loseHoliday,
                                                          bool?wedHoliday, bool?leaveHoliday, bool?failHoliday, bool?yearHoliday)
        {
            //调用方法,读取XML
            var indexDic = ReadXml.ReadXmlTitle();
            //构造需要显示到前端的信息
            var printTxtValue = new PrintTxtValue
            {
                PrintDateTime = NetworkDateTime.CurrentDateTime().ToString("yyyy-MM-dd HH:mm"),
                Title         = string.IsNullOrEmpty(indexDic["leave"]) ? "请假条" : indexDic["leave"],
                CompanyName   = string.IsNullOrEmpty(indexDic["companyName"]) ? "甘肃联众建筑设计有限责任公司" : indexDic["companyName"],
                Remark        = string.IsNullOrEmpty(indexDic["leaveRemak"]) ? "暂无备注" : indexDic["leaveRemak"],
                DepartMent    = departmentText,
                ThingHoliday  = thingHoliday,
                LoseHoliday   = loseHoliday,
                WedHoliday    = wedHoliday,
                LeaveHoliday  = leaveHoliday,
                FailHoliday   = failHoliday,
                YearHoliday   = yearHoliday
            };

            return(printTxtValue);
        }