コード例 #1
0
        //更新到正式表
        public void UpdateToFormalTable()
        {
            if (另一人录入的记录 == null || this.内容不同的字段.Count > 0)
            {
                return;
            }

            MonthlyWageLoanItem m = MonthlyWageLoanItem.AddMonthlyWageLoanItem(this.员工编号, this.年, this.月);

            this.CopyWatchMember(m);

            m.创建人  = this.录入人;
            m.创建时间 = DateTime.Now;
            m.Save();

            //更新生效标记
            if (!this.已生效)
            {
                this.生效时间 = DateTime.Now;
                this.Save();

                MonthlyWageLoanItemEntry opposite = 另一人录入的记录;
                opposite.生效时间 = DateTime.Now;
                opposite.Save();
            }
        }
コード例 #2
0
        public static MonthlyWageLoanItemEntry AddMonthlyWageLoanItemEntry(string emplid, string name, int year, int month, bool isVerify)
        {
            MonthlyWageLoanItemEntry item = GetMonthlyWageLoanItemEntry(emplid, year, month, isVerify);

            if (item == null)
            {
                item = new MonthlyWageLoanItemEntry();

                item.标识    = Guid.NewGuid();
                item.员工编号  = emplid;
                item.姓名    = name;
                item.年     = year;
                item.月     = month;
                item.是验证录入 = isVerify;
                item.录入时间  = DateTime.Now;

                item.Save();
            }
            return(item);
        }
コード例 #3
0
        protected override void OnSaved()
        {
            base.OnSaved();
            if (录入人 == null)
            {
                //如果对向没有记录,自动创建
                MonthlyWageLoanItemEntry opposite = GetEditingRow(this.员工编号, this.年, this.月, !this.是验证录入);
                if (opposite == null)
                {
                    opposite = new MonthlyWageLoanItemEntry();

                    opposite.标识    = Guid.NewGuid();
                    opposite.员工编号  = this.员工编号;
                    opposite.姓名    = this.姓名;
                    opposite.年     = this.年;
                    opposite.月     = this.月;
                    opposite.是验证录入 = !this.是验证录入;

                    opposite.录入人  = "";
                    opposite.录入时间 = DateTime.Now;
                    opposite.Save();
                }
            }
        }