private void btnSave_Click(object sender, EventArgs e)
        {
            //try
            //{
            PharmacyDbContext db = new PharmacyDbContext();

            foreach (ListViewItem item in lvMedicine.Items)
            {
                Medicine medicine = new Medicine();

                medicine.Name        = item.SubItems[2].Text;
                medicine.Id          = UniqueNumber.GenerateUniqueNumber();
                medicine.CreatedBy   = currentUser;
                medicine.CreatedDate = DateTime.Now;
                medicine.GroupId     = GroupFactory.GetGroupId(item.SubItems[3].Text, currentUser);
                medicine.CompanyId   = CompanyFactory.GetCompanyId(item.SubItems[4].Text, currentUser);
                db.Medicine.Add(medicine);
            }
            db.SaveChanges();
            db.Dispose();
            MessageBox.Show(@"Save successful!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            lvMedicine.Items.Clear();
            //}
            //catch (Exception exception)
            //{
            //    MessageBox.Show("Saving Error:" + exception.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            //}
        }
Пример #2
0
        public string GetCustomerIdByName(string name, PharmacyDbContext db)
        {
            if (name == "")
            {
                name = "Unknown";
            }
            Customer customer = db.Customer.FirstOrDefault(i => i.Name == name);

            if (customer != null)
            {
                return(customer.Id);
            }
            else
            {
                customer = new Customer
                {
                    Id          = UniqueNumber.GenerateUniqueNumber(),
                    Name        = name,
                    Mobile      = txtPhone.Text,
                    CreatedBy   = currentUser,
                    CreatedDate = DateTime.Now
                };
                db.Customer.Add(customer);
                db.SaveChanges();
                return(customer.Id);
            }
        }
Пример #3
0
        public UniqueNumber CreateAccountNumber()
        {
            var dto = new UniqueNumber();

            _uow.UniqueNumbers.Add(dto);
            _uow.SaveChanges();
            return(dto);
        }
Пример #4
0
        private void InsertObjectiveSub(ObjectiveSub sub)
        {
            var mainId =
                GetUnitOfWork()
                .ObjectiveMainRepository.Get()
                .Where(a => a.EmployeeId == CreatedBy && a.IsActive == true)
                .Select(s => s.Id)
                .FirstOrDefault();
            int weight = 0;

            if (mainId != Guid.Empty)
            {
                weight = GetUnitOfWork().ObjectiveSubRepository.Get().Where(a => a.ObjectiveMainId == mainId).Sum(s => s.Weight ?? 0) + sub.Weight ?? 0;
            }

            if (sub.Id != null)
            {
                if (weight - sub.Weight > 100)
                {
                    throw new Exception("Weight should not be greater then 100");
                }
                ObjectiveSub ob = GetUnitOfWork().ObjectiveSubRepository.Get().FirstOrDefault(a => a.Id == sub.Id);
                if (ob != null)
                {
                    ob.KPI         = sub.KPI;
                    ob.Note        = sub.Note;
                    ob.Target      = sub.Target;
                    ob.Weight      = sub.Weight;
                    ob.Title       = sub.Title;
                    ob.UpdatedBy   = CreatedBy;
                    ob.UpdatedDate = DateTime.Now;
                }
                GetUnitOfWork().ObjectiveSubRepository.Update(ob);
            }
            else
            {
                if (weight > 100)
                {
                    throw new Exception("Weight should not be greater then 100");
                }
                if (mainId == Guid.Empty)
                {
                    ObjectiveMain main = new ObjectiveMain()
                    {
                        EmployeeId = CreatedBy
                    };
                    InsertObjectiveMain(main);
                    mainId = main.Id;
                }
                sub.CreatedBy           = CreatedBy;
                sub.CreatedDate         = DateTime.Now;
                sub.ObjectiveMainId     = mainId;
                sub.IsObjectiveApproved = false;
                sub.Status = true;
                sub.Id     = UniqueNumber.GenerateUniqueNumber();
                GetUnitOfWork().ObjectiveSubRepository.Insert(sub);
            }
        }
Пример #5
0
 public StateBlock(int numVars, StateKind kind)
 {
     baseName  = UniqueNumber.GetName("AA_TEMP");
     this.vars = new TypedIdent[numVars];
     decls     = null;
     //idents = null;
     initialized = false;
     this.kind   = kind;
 }
Пример #6
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (Id != null)
                {
                    hashCode = hashCode * 59 + Id.GetHashCode();
                }
                if (When != null)
                {
                    hashCode = hashCode * 59 + When.GetHashCode();
                }
                if (Where != null)
                {
                    hashCode = hashCode * 59 + Where.GetHashCode();
                }
                if (Requirements != null)
                {
                    hashCode = hashCode * 59 + Requirements.GetHashCode();
                }
                if (ClientDeptId != null)
                {
                    hashCode = hashCode * 59 + ClientDeptId.GetHashCode();
                }
                if (SubDiscipline != null)
                {
                    hashCode = hashCode * 59 + SubDiscipline.GetHashCode();
                }
                if (Grade != null)
                {
                    hashCode = hashCode * 59 + Grade.GetHashCode();
                }
                if (FallbackGrade != null)
                {
                    hashCode = hashCode * 59 + FallbackGrade.GetHashCode();
                }
                if (VacancyReason != null)
                {
                    hashCode = hashCode * 59 + VacancyReason.GetHashCode();
                }

                hashCode = hashCode * 59 + PoNumber.GetHashCode();

                hashCode = hashCode * 59 + UniqueNumber.GetHashCode();
                if (Agency != null)
                {
                    hashCode = hashCode * 59 + Agency.GetHashCode();
                }
                return(hashCode);
            }
        }
        public void TestThatGetUniqueWorksWhenFileIsThere()
        {
            // Arrange
            var csvName = Path.GetTempFileName() + ".csv";
            var sut     = new CsvRepository(csvName);

            sut.Add(UniqueNumber.Create(new DateTime(2018, 4, 5), 1, "031069-0503", "Anders Juul", "Grass"));

            // Act
            var res = sut.GetUniqueNewNumber2(new DateTime(2018, 4, 5), "031069-0503", "Anders Juul", "Grass");

            // Assert
            Assert.AreEqual("20180405-02", res.Id);
        }
Пример #8
0
        public static void NormalizeVariables(List <Variable> v1, List <Variable> v2)
        {
            int      num = Math.Abs(v1.Count - v2.Count);
            Variable t;

            var longer  = (v1.Count > v2.Count ? v1 : v2);
            var shorter = (v1 == longer ? v2 : v1);

            for (int i = 0; i < num; i++)
            {
                t                 = B.Factory.Copy(longer[longer.Count - 1 - i]);
                t.Name            = UniqueNumber.GetName("AA_IN");
                t.TypedIdent.Name = t.Name;
                shorter.Add(t);
            }
        }
        private void SaveMedicineIfNew()
        {
            PharmacyDbContext db       = new PharmacyDbContext();
            Medicine          medicine = new Medicine();

            medicine = db.Medicine.FirstOrDefault(a => a.Name == txtMedicine.Text);
            if (medicine != null)
            {
                medicine.Name        = txtMedicine.Text;
                medicine.Id          = UniqueNumber.GenerateUniqueNumber();
                medicine.CreatedBy   = currentUser;
                medicine.CreatedDate = DateTime.Now;
                medicine.GroupId     = GroupFactory.GetGroupId(txtGroup.Text, currentUser);
                medicine.CompanyId   = CompanyFactory.GetCompanyId(txtCompany.Text, currentUser);
                db.Medicine.Add(medicine);
            }
        }
Пример #10
0
 public int?GetNewDocNum()
 {
     try
     {
         using (ExpressTaxi ctx = new ExpressTaxi(conn))
         {
             UniqueNumber u = ctx.UniqueNumbers.SingleOrDefault(r => r.UniqueName == "Receipt");
             if (u != null)
             {
                 return(u.UniqueValue);
             }
         }
     }
     catch (System.Exception ex)
     {
         log.Error(ex);
     }
     return(null);
 }
Пример #11
0
 private void button1_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         using (ExpressTaxi ctx = new ExpressTaxi(conn))
         {
             UniqueNumber u = ctx.UniqueNumbers.SingleOrDefault(r => r.UniqueName == "Receipt");
             if (u != null)
             {
                 int num;
                 if (int.TryParse(textBox7.Text, out num))
                 {
                     u.UniqueValue = num;
                     ctx.SubmitChanges();
                 }
                 else
                 {
                     Config.ShowErrorMessage("Invalid doc number, failed to save this component.");
                 }
             }
         }
         Config.CMP_NAME         = textBox1.Text;
         Config.CMP_ADDRESSLINE1 = textBox2.Text;
         Config.CMP_ADDRESSLINE2 = textBox3.Text;
         Config.CMP_PHONEFAX     = textBox4.Text;
         Config.Subject          = textBox5.Text;
         Config.BodyText         = textBox6.Text;
         if (!Config.SaveCfg())
         {
             Config.ShowErrorMessage("Failed to save configuration, this error has been logged.");
         }
         else
         {
             this.Close();
         }
     }
     catch (System.Exception ex)
     {
         log.Error(ex);
         Config.ShowErrorMessage("Failed to save configuration, this error has been logged.");
     }
 }
Пример #12
0
        /// <summary>
        /// Generation of Unique Number based on the turbine  Id.
        /// </summary>
        /// <param name="turbineId">string</param>
        /// <param name="formType">string</param>
        /// <param name="loginUserId">string</param>
        /// <returns>object</returns>
        public UniqueNumber GetUniqueNumberGeneration(string turbineId, string formType, string loginUserId)
        {
            UniqueNumber oUniquenumber = new UniqueNumber();

            try
            {
                using (var connection = Connection())
                {
                    var result = connection.QueryMultiple("CFG_UniqueNumber", new
                    {
                        TbnId    = turbineId,
                        FormType = formType,
                        UId      = loginUserId
                    }, commandType: CommandType.StoredProcedure);
                    oUniquenumber = result.Read <UniqueNumber>().FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                //SaveErrorMessageInFile(oErrorMessage = new ErrorMessage { UserId = loginUserId, ModuleName = "CIR", MethodName = "GetUniqueNumberGeneration", Exception = ex.Message });
                Logger.Error(ex.Message);
            }
            return(oUniquenumber);
        }
Пример #13
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         using (ExpressTaxi ctx = new ExpressTaxi(conn))
         {
             UniqueNumber u = ctx.UniqueNumbers.SingleOrDefault(r => r.UniqueName == "Receipt");
             if (u != null)
             {
                 textBox7.Text = Convert.ToString(u.UniqueValue);
             }
         }
         textBox1.Text = Config.CMP_NAME;
         textBox2.Text = Config.CMP_ADDRESSLINE1;
         textBox3.Text = Config.CMP_ADDRESSLINE2;
         textBox4.Text = Config.CMP_PHONEFAX;
         textBox5.Text = Config.Subject;
         textBox6.Text = Config.BodyText;
     }
     catch (System.Exception ex)
     {
         log.Error(ex);
     }
 }
Пример #14
0
 private string GenerateOrderNo(OrderType tradeType)
 {
     return(UniqueNumber.GetUniqueNumber(tradeType.ToString()));
 }
Пример #15
0
 public void UniqueNumber_Seeken()
 {
     Assert.AreEqual(2, UniqueNumber.Solve_Seeken(new int[] { 1, 1, 1, 2, 1, 1 }));
 }
Пример #16
0
 public void UniqueNumber_Blune()
 {
     Assert.AreEqual(2, UniqueNumber.Solve_Blune(new int[] { 1, 1, 1, 2, 1, 1 }));
 }
Пример #17
0
 public bool SaveTransaction()
 {
     try
     {
         if (ValidateTransaction())
         {
             using (ExpressTaxi ctx = new ExpressTaxi(conn))
             {
                 FinancialTransaction t = ctx.FinancialTransactions.SingleOrDefault(r => r.DOC_NUM == _DOC_NUM);
                 if (t == null)
                 {
                     t                   = new FinancialTransaction();
                     t.CMP_COD           = _CMP_COD;
                     t.DOC_NUM           = _DOC_NUM;
                     t.DOC_TYPE_NAME     = _Doc_Type_Name;
                     t.DOCUMENT_DATE     = _Doc_Date;
                     t.DRV_COD           = _DRV_COD;
                     t.IsValid           = true;
                     t.LAST_MODIFIED     = DateTime.Now;
                     t.NO_PAX            = _No_Pax;
                     t.SERV_NAME         = _Serv_Name;
                     t.TRANS_COMMENTS    = _Comments;
                     t.TRANS_DATE        = DateTime.Today;
                     t.TRANS_DESTINATION = _Destination;
                     t.TRANS_FINAL_VALUE = _Trans_Final;
                     t.TRANS_REDUCTION   = _Trans_Reduct;
                     t.TRANS_VALUE       = _Trans_Value;
                     t.VOUCHER_NUM       = _Voucher_Num;
                     UniqueNumber num = ctx.UniqueNumbers.SingleOrDefault(r => r.UniqueName == "Receipt");
                     if (num != null)
                     {
                         if (num.UniqueValue != _DOC_NUM)
                         {
                             _DOC_NUM  = num.UniqueValue;
                             t.DOC_NUM = _DOC_NUM;
                         }
                         num.UniqueValue = num.UniqueValue + 1;
                         ctx.FinancialTransactions.InsertOnSubmit(t);
                         ctx.SubmitChanges();
                         return(true);
                     }
                 }
                 else // edit mode
                 {
                     t.CMP_COD           = _CMP_COD;
                     t.DOC_NUM           = _DOC_NUM;
                     t.DOC_TYPE_NAME     = _Doc_Type_Name;
                     t.DOCUMENT_DATE     = _Doc_Date;
                     t.DRV_COD           = _DRV_COD;
                     t.IsValid           = true;
                     t.LAST_MODIFIED     = DateTime.Now;
                     t.NO_PAX            = _No_Pax;
                     t.SERV_NAME         = _Serv_Name;
                     t.TRANS_COMMENTS    = _Comments;
                     t.TRANS_DATE        = DateTime.Today;
                     t.TRANS_DESTINATION = _Destination;
                     t.TRANS_FINAL_VALUE = _Trans_Final;
                     t.TRANS_REDUCTION   = _Trans_Reduct;
                     t.TRANS_VALUE       = _Trans_Value;
                     t.VOUCHER_NUM       = _Voucher_Num;
                     ctx.SubmitChanges();
                     return(true);
                 }
             }
         }
     }
     catch (System.Exception ex)
     {
         log.Error(ex);
     }
     return(false);
 }
 public void Add(UniqueNumber number)
 {
     _uow.UniqueNumbers.Add(number);
     _uow.SaveChanges();
 }
Пример #19
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (DutyId != null)
                {
                    hashCode = hashCode * 59 + DutyId.GetHashCode();
                }
                if (SlaveDutyId != null)
                {
                    hashCode = hashCode * 59 + SlaveDutyId.GetHashCode();
                }
                if (BlockId != null)
                {
                    hashCode = hashCode * 59 + BlockId.GetHashCode();
                }
                if (ClientDeptId != null)
                {
                    hashCode = hashCode * 59 + ClientDeptId.GetHashCode();
                }
                if (SubDiscipline != null)
                {
                    hashCode = hashCode * 59 + SubDiscipline.GetHashCode();
                }

                hashCode = hashCode * 59 + RequestGender.GetHashCode();
                if (Grade != null)
                {
                    hashCode = hashCode * 59 + Grade.GetHashCode();
                }
                if (FallbackGrade != null)
                {
                    hashCode = hashCode * 59 + FallbackGrade.GetHashCode();
                }
                if (VacancyReason != null)
                {
                    hashCode = hashCode * 59 + VacancyReason.GetHashCode();
                }
                if (Date != null)
                {
                    hashCode = hashCode * 59 + Date.GetHashCode();
                }
                if (StartTime != null)
                {
                    hashCode = hashCode * 59 + StartTime.GetHashCode();
                }
                if (EndTime != null)
                {
                    hashCode = hashCode * 59 + EndTime.GetHashCode();
                }

                hashCode = hashCode * 59 + BreakDuration.GetHashCode();

                hashCode = hashCode * 59 + PoNumber.GetHashCode();

                hashCode = hashCode * 59 + UniqueNumber.GetHashCode();
                if (Agency != null)
                {
                    hashCode = hashCode * 59 + Agency.GetHashCode();
                }
                if (Skill != null)
                {
                    hashCode = hashCode * 59 + Skill.GetHashCode();
                }
                if (Specialty != null)
                {
                    hashCode = hashCode * 59 + Specialty.GetHashCode();
                }
                if (FallbackSkill != null)
                {
                    hashCode = hashCode * 59 + FallbackSkill.GetHashCode();
                }
                if (FallbackSpeciality != null)
                {
                    hashCode = hashCode * 59 + FallbackSpeciality.GetHashCode();
                }

                hashCode = hashCode * 59 + Status.GetHashCode();
                if (Rates != null)
                {
                    hashCode = hashCode * 59 + Rates.GetHashCode();
                }
                if (TimeIntervalRates != null)
                {
                    hashCode = hashCode * 59 + TimeIntervalRates.GetHashCode();
                }
                if (Person != null)
                {
                    hashCode = hashCode * 59 + Person.GetHashCode();
                }
                return(hashCode);
            }
        }
Пример #20
0
        /// <summary>
        /// Analyzes contents of an XML element as a (possibly segmented) XLIFF inline text.
        /// </summary>
        /// <param name="builder">Results are stored in this object.</param>
        /// <param name="elem">The element whose contents is analyzed.</param>
        /// <param name="allow_segmentation">true if the standard XLIFF segmentation is allowed.</param>
        protected void SegmentInlineContent(SegmentedContentBuilder builder, XElement elem, bool allow_segmentation)
        {
            // Why shouldn't we throw ArgumentNullException in this case?  FIXME.
            if (elem == null)
            {
                return;
            }

            foreach (var n in elem.Nodes())
            {
                if (n is XText)
                {
                    builder.Add((n as XText).Value);
                }
                else if (n is XElement)
                {
                    var e    = (XElement)n;
                    var ns   = e.Name.Namespace;
                    var name = e.Name.LocalName;
                    if (ns == X && name == "mrk")
                    {
                        var handled = HandleMarkElement(builder, e, allow_segmentation);
                        if (!handled)
                        {
                            SegmentInlineContent(builder, e, allow_segmentation);
                        }
                    }
                    else if (ns == X && (name == "x" || name == "ph"))
                    {
                        // Replace a standalone native code element with a standalone inline tag.
                        builder.Add(BuildNativeCodeTag(Tag.S, e, name == "ph"));
                    }
                    else if (ns == X && (name == "bx" || name == "bpt"))
                    {
                        // Replace a beginning native code element with a beginning inline tag.
                        builder.Add(BuildNativeCodeTag(Tag.B, e, name == "bpt"));
                    }
                    else if (ns == X && (name == "ex" || name == "ept"))
                    {
                        // Replace an ending native code element with an ending inline tag.
                        builder.Add(BuildNativeCodeTag(Tag.E, e, name == "ept"));
                    }
                    else if (ns == X && name == "it")
                    {
                        // Replace an isolated native code element with an appropriate inline tag.
                        Tag type;
                        switch ((string)e.Attribute("pos"))
                        {
                        case "open": type = Tag.B; break;

                        case "close": type = Tag.E; break;

                        default: type = Tag.S; break;
                        }
                        builder.Add(BuildNativeCodeTag(type, e, true));
                    }
                    else if (ns == X && name == "g")
                    {
                        // If this is an XLIFF g element,
                        // replace start and end tags with inline tags,
                        // and keep converting its content,
                        // because the g holds instructions in its attributes,
                        // and its content is a part of translatable text.
                        builder.Add(BuildNativeCodeTag(Tag.B, e, false));
                        SegmentInlineContent(builder, e, allow_segmentation);
                        builder.Add(BuildNativeCodeTag(Tag.E, e, false));
                    }
                    else
                    {
                        // Unknown element, i.e., some external (no XLIFF) element or a
                        // misplaced XLIFF element.
                        // OH, I have no good idea how to handle it.  FIXME.
                        var handled = HandleUnknownTag(builder, e);
                        if (!handled)
                        {
                            var id  = "*";
                            var rid = UniqueNumber.ToString();
                            if (string.IsNullOrEmpty(e.Value))
                            {
                                builder.Add(new InlineTag(Tag.S, id, rid, name, null, null, null));
                            }
                            else
                            {
                                // Assume the contents of this element is a translatable text.
                                builder.Add(new InlineTag(Tag.B, id, rid, name, null, null, null));
                                SegmentInlineContent(builder, e, allow_segmentation);
                                builder.Add(new InlineTag(Tag.E, id, rid, name, null, null, null));
                            }
                        }
                    }
                }
                else
                {
                    // Silently discard any other nodes, i.e., comment or pi, entirely.
                }
            }
        }
Пример #21
0
 public void Test()
 {
     Assert.Equal(1, UniqueNumber.GetUnique(new[] { 1, 2, 2, 2 }));
     Assert.Equal(-2, UniqueNumber.GetUnique(new[] { -2, 2, 2, 2 }));
     Assert.Equal(14, UniqueNumber.GetUnique(new[] { 11, 11, 14, 11, 11 }));
 }
Пример #22
0
        /// <summary>
        /// Returns true if Duty instances are equal
        /// </summary>
        /// <param name="other">Instance of Duty to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Duty other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DutyId == other.DutyId ||
                     DutyId != null &&
                     DutyId.Equals(other.DutyId)
                     ) &&
                 (
                     SlaveDutyId == other.SlaveDutyId ||
                     SlaveDutyId != null &&
                     SlaveDutyId.Equals(other.SlaveDutyId)
                 ) &&
                 (
                     BlockId == other.BlockId ||
                     BlockId != null &&
                     BlockId.Equals(other.BlockId)
                 ) &&
                 (
                     ClientDeptId == other.ClientDeptId ||
                     ClientDeptId != null &&
                     ClientDeptId.Equals(other.ClientDeptId)
                 ) &&
                 (
                     SubDiscipline == other.SubDiscipline ||
                     SubDiscipline != null &&
                     SubDiscipline.Equals(other.SubDiscipline)
                 ) &&
                 (
                     RequestGender == other.RequestGender ||

                     RequestGender.Equals(other.RequestGender)
                 ) &&
                 (
                     Grade == other.Grade ||
                     Grade != null &&
                     Grade.Equals(other.Grade)
                 ) &&
                 (
                     FallbackGrade == other.FallbackGrade ||
                     FallbackGrade != null &&
                     FallbackGrade.Equals(other.FallbackGrade)
                 ) &&
                 (
                     VacancyReason == other.VacancyReason ||
                     VacancyReason != null &&
                     VacancyReason.Equals(other.VacancyReason)
                 ) &&
                 (
                     Date == other.Date ||
                     Date != null &&
                     Date.Equals(other.Date)
                 ) &&
                 (
                     StartTime == other.StartTime ||
                     StartTime != null &&
                     StartTime.Equals(other.StartTime)
                 ) &&
                 (
                     EndTime == other.EndTime ||
                     EndTime != null &&
                     EndTime.Equals(other.EndTime)
                 ) &&
                 (
                     BreakDuration == other.BreakDuration ||

                     BreakDuration.Equals(other.BreakDuration)
                 ) &&
                 (
                     PoNumber == other.PoNumber ||

                     PoNumber.Equals(other.PoNumber)
                 ) &&
                 (
                     UniqueNumber == other.UniqueNumber ||

                     UniqueNumber.Equals(other.UniqueNumber)
                 ) &&
                 (
                     Agency == other.Agency ||
                     Agency != null &&
                     Agency.Equals(other.Agency)
                 ) &&
                 (
                     Skill == other.Skill ||
                     Skill != null &&
                     Skill.Equals(other.Skill)
                 ) &&
                 (
                     Specialty == other.Specialty ||
                     Specialty != null &&
                     Specialty.Equals(other.Specialty)
                 ) &&
                 (
                     FallbackSkill == other.FallbackSkill ||
                     FallbackSkill != null &&
                     FallbackSkill.Equals(other.FallbackSkill)
                 ) &&
                 (
                     FallbackSpeciality == other.FallbackSpeciality ||
                     FallbackSpeciality != null &&
                     FallbackSpeciality.Equals(other.FallbackSpeciality)
                 ) &&
                 (
                     Status == other.Status ||

                     Status.Equals(other.Status)
                 ) &&
                 (
                     Rates == other.Rates ||
                     Rates != null &&
                     other.Rates != null &&
                     Rates.SequenceEqual(other.Rates)
                 ) &&
                 (
                     TimeIntervalRates == other.TimeIntervalRates ||
                     TimeIntervalRates != null &&
                     other.TimeIntervalRates != null &&
                     TimeIntervalRates.SequenceEqual(other.TimeIntervalRates)
                 ) &&
                 (
                     Person == other.Person ||
                     Person != null &&
                     Person.Equals(other.Person)
                 ));
        }
Пример #23
0
        /// <summary>
        /// Returns true if Duty instances are equal
        /// </summary>
        /// <param name="other">Instance of Duty to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Duty other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     When == other.When ||
                     When != null &&
                     When.Equals(other.When)
                 ) &&
                 (
                     Where == other.Where ||
                     Where != null &&
                     Where.Equals(other.Where)
                 ) &&
                 (
                     Requirements == other.Requirements ||
                     Requirements != null &&
                     Requirements.Equals(other.Requirements)
                 ) &&
                 (
                     ClientDeptId == other.ClientDeptId ||
                     ClientDeptId != null &&
                     ClientDeptId.Equals(other.ClientDeptId)
                 ) &&
                 (
                     SubDiscipline == other.SubDiscipline ||
                     SubDiscipline != null &&
                     SubDiscipline.Equals(other.SubDiscipline)
                 ) &&
                 (
                     Grade == other.Grade ||
                     Grade != null &&
                     Grade.Equals(other.Grade)
                 ) &&
                 (
                     FallbackGrade == other.FallbackGrade ||
                     FallbackGrade != null &&
                     FallbackGrade.Equals(other.FallbackGrade)
                 ) &&
                 (
                     VacancyReason == other.VacancyReason ||
                     VacancyReason != null &&
                     VacancyReason.Equals(other.VacancyReason)
                 ) &&
                 (
                     PoNumber == other.PoNumber ||

                     PoNumber.Equals(other.PoNumber)
                 ) &&
                 (
                     UniqueNumber == other.UniqueNumber ||

                     UniqueNumber.Equals(other.UniqueNumber)
                 ) &&
                 (
                     Agency == other.Agency ||
                     Agency != null &&
                     Agency.Equals(other.Agency)
                 ));
        }