コード例 #1
0
        /// <summary>
        /// 根据主键索引,获得指定的假期记录以便查看编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void clientAtt_GetShiftDefineByIDCompleted(object sender, GetShiftDefineByIDCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                entShiftDefine = e.Result;
                //entShiftDefine.NEEDFIRSTCARD = entShiftDefine.NEEDFIRSTCARD == "2" ? "2" : "1";
                //entShiftDefine.NEEDSECONDCARD = entShiftDefine.NEEDSECONDCARD == "2" ? "2" : "1";
                //entShiftDefine.NEEDTHIRDCARD = entShiftDefine.NEEDTHIRDCARD == "2" ? "2" : "1";
                //entShiftDefine.NEEDFOURTHCARD = entShiftDefine.NEEDFOURTHCARD == "2" ? "2" : "1";

                this.DataContext = entShiftDefine;

                //上班
                IsNeedCard(entShiftDefine.NEEDFIRSTCARD, cbNeedFirstCard, nudFirstCardStartTime, nudFirstCardEndTime);
                IsNeedCard(entShiftDefine.NEEDSECONDCARD, cbNeedSecondCard, nudSecCardStartTime, nudSecCardEndTime);
                IsNeedCard(entShiftDefine.NEEDTHIRDCARD, cbNeedThirdCard, nudThirdCardStartTime, nudThirdCardEndTime);
                IsNeedCard(entShiftDefine.NEEDFOURTHCARD, cbNeedFourthCard, nudFourthCardStartTime, nudFourthCardEndTime);

                //下班
                IsNeedCard(entShiftDefine.NEEDFIRSTOFFCARD, cbNeedFirstOffCard, nudFirstOffCardStartTime, nudFirstOffCardEndTime);
                IsNeedCard(entShiftDefine.NEEDSECONDOFFCARD, cbNeedSecondOffCard, nudSecOffCardStartTime, nudSecOffCardEndTime);
                IsNeedCard(entShiftDefine.NEEDTHIRDOFFCARD, cbNeedThirdOffCard, nudThirdOffCardStartTime, nudThirdOffCardEndTime);
                IsNeedCard(entShiftDefine.NEEDFOURTHOFFCARD, cbNeedFourthOffCard, nudFourthOffCardStartTime, nudFourthOffCardEndTime);

                SetToolBar();
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
            }
        }
コード例 #2
0
ファイル: ShiftDefineForm.xaml.cs プロジェクト: JuRogn/OA
        /// <summary>
        /// 根据主键索引,获得指定的假期记录以便查看编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void clientAtt_GetShiftDefineByIDCompleted(object sender, GetShiftDefineByIDCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                entShiftDefine = e.Result;
                //entShiftDefine.NEEDFIRSTCARD = entShiftDefine.NEEDFIRSTCARD == "2" ? "2" : "1";
                //entShiftDefine.NEEDSECONDCARD = entShiftDefine.NEEDSECONDCARD == "2" ? "2" : "1";
                //entShiftDefine.NEEDTHIRDCARD = entShiftDefine.NEEDTHIRDCARD == "2" ? "2" : "1";
                //entShiftDefine.NEEDFOURTHCARD = entShiftDefine.NEEDFOURTHCARD == "2" ? "2" : "1";

                this.DataContext = entShiftDefine;

                //上班
                IsNeedCard(entShiftDefine.NEEDFIRSTCARD, cbNeedFirstCard, nudFirstCardStartTime, nudFirstCardEndTime);
                IsNeedCard(entShiftDefine.NEEDSECONDCARD, cbNeedSecondCard, nudSecCardStartTime, nudSecCardEndTime);
                IsNeedCard(entShiftDefine.NEEDTHIRDCARD, cbNeedThirdCard, nudThirdCardStartTime, nudThirdCardEndTime);
                IsNeedCard(entShiftDefine.NEEDFOURTHCARD, cbNeedFourthCard, nudFourthCardStartTime, nudFourthCardEndTime);

                //下班
                IsNeedCard(entShiftDefine.NEEDFIRSTOFFCARD, cbNeedFirstOffCard, nudFirstOffCardStartTime, nudFirstOffCardEndTime);
                IsNeedCard(entShiftDefine.NEEDSECONDOFFCARD, cbNeedSecondOffCard, nudSecOffCardStartTime, nudSecOffCardEndTime);
                IsNeedCard(entShiftDefine.NEEDTHIRDOFFCARD, cbNeedThirdOffCard, nudThirdOffCardStartTime, nudThirdOffCardEndTime);
                IsNeedCard(entShiftDefine.NEEDFOURTHOFFCARD, cbNeedFourthOffCard, nudFourthOffCardStartTime, nudFourthOffCardEndTime);

                SetToolBar();
            }
            else
            {
                Utility.ShowCustomMessage(MessageTypes.Error, Utility.GetResourceStr("ERROR"), Utility.GetResourceStr(e.Error.Message));
            }
        }