public override void AddRecord() { if (!this.m_NickName.m_bIsSet) { this.NickName = this.MakeNN(true); } else if ((this.m_ID.m_bIsSet && this.m_ID.nValue.Equals(0) || !this.m_ID.m_bIsSet) && PLLawyer.GetIDFromNN(this.NickName) > 0) { this.NickName = this.MakeNN(true); } else if ((this.NickName.Length.Equals(0) ? 1 : (this.NickName.Length > 4 ? 1 : 0)) != 0) { this.NickName = this.MakeNN(true); } PLLawyer.AddNicknameToList(this.NickName); base.AddRecord(); for (short index = 1; (int)index <= this.m_RateArr.Count; ++index) { this.m_RateID.SetValue(this.m_RateArr[(int)index - 1].RateID); this.m_RateID.AddRepeatField(this.m_hndPOST, (int)index); this.m_RateAmt.SetValue(this.m_RateArr[(int)index - 1].RateAmount); this.m_RateAmt.AddRepeatField(this.m_hndPOST, (int)index); this.m_RateDate.SetValue(this.m_RateArr[(int)index - 1].RateDate); this.m_RateDate.AddRepeatField(this.m_hndPOST, (int)index); } this.m_RateArr.Clear(); this.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLLawyer plLawyer = this; plLawyer.m_lCounter = plLawyer.m_lCounter + 1; if (this.m_lCounter < PLXMLData.m_nMaxCounter) { return; } this.Send(); }
// public void AddLawyer(string sNN) //// { // this.m_LawyerID.nValue = // } // public void AddLawyer(int nID) // { // this.m_LawyerID.SetValue(nID); // } public override void AddRecord() { PLDiary.eType entryType = this.EntryType; if ((int)this.m_hndPOST == 0) { this.m_hndPOST = this.GetLink().TablePOST_CreateHandle(this.m_sTableName, 0); } if (this.EntryType == PLDiary.eType.Appointment) { if (this.AllDayEvent) { this.StartTime = 700; this.DurationSeconds = 43200; } else if ((this.StartTime > 700 ? 0 : (this.DurationSeconds > 43200 ? 1 : 0)) != 0) { this.StartTime = 700; this.DurationSeconds = 43200; } this.AllDayEvent = false; if (this.DurationSeconds < 360) { this.DurationSeconds = 360; } } if (this.EntryType == PLDiary.eType.TODO && this.DurationSeconds < 360) { this.DurationSeconds = 360; } if (this.IsRecurringEntry) { this.RecurringType = this.EntryType; this.RecurringDescription = this.Description; this.RecurringStartTime = this.StartTime; this.RecurringDuration = this.Duration; if (this.RecurringRepeatUnit != PLDiary.eRepeatUnit.Year || (this.RecurringMonthOfYear == 0 || this.RecurringWeekOfMonth == 0 ? 0 : (this.RecurringDayOfWeek == (PLDiary.eDay) 0 ? 1 : 0)) == 0) { ; } if (this.RecurringRepeatUnit != PLDiary.eRepeatUnit.Month || (this.RecurringWeekOfMonth == 0 ? 0 : (this.RecurringDayOfWeek == (PLDiary.eDay) 0 ? 1 : 0)) == 0) { ; } } if (this.EntryType == PLDiary.eType.Call) { this.ReminderDate = this.DueDate; this.EnteredDate = this.DueDate; } if (this.ReminderDate == 0) { this.ReminderDate = this.DueDate; } if (this.EntryType == PLDiary.eType.Holiday) { //this.ArrLawyers.Clear(); this.ArrMSGRead.Clear(); this.ArrContacts.Clear(); this.m_StartTime.Clear(); this.m_DurationSeconds.Clear(); this.m_ReminderDate.Clear(); } this.Completed = this.m_CompletionDate.m_bIsSet; if ((m_LawyerID != null && m_MsgUserID != null) && (m_LawyerID.nValue > 0 && m_MsgUserID.nValue > 0)) { this.m_LawyerID.AddField(this.m_hndPOST); //this.m_MsgUserID.SetValue(m_MsgUserID.nValue); this.m_MsgUserID.AddField(this.m_hndPOST); this.ArrMSGRead.Clear(); } else { this.m_LawyerID.SetValue(PLLawyer.GetIDFromNN("~IT")); this.m_LawyerID.AddField(this.m_hndPOST); this.m_MsgUserID.SetValue(PLLawyer.GetIDFromNN("~IT")); this.m_MsgUserID.AddField(this.m_hndPOST); } base.AddRecord(); this.m_EntryType.AddField(this.m_hndPOST); if (this.ArrContacts.Count > 0) { for (int nRepeat = 1; nRepeat <= this.ArrContacts.Count; ++nRepeat) { this.m_ContactID.SetValue(Convert.ToInt32(this.ArrContacts[nRepeat - 1])); this.m_ContactID.AddRepeatField(this.m_hndPOST, nRepeat); } this.ArrContacts.Clear(); } this.GetLink().TablePOST_AddRecord(this.m_hndPOST); PLDiary plDiary = this; plDiary.m_lCounter = plDiary.m_lCounter + 1; if (this.m_lCounter < PLXMLData.m_nMaxCounter) { return; } this.Send(); }