Exemple #1
0
        private LawUnit mapLawyer(LawyerModel lawyer, List <CodeMapping> bars)
        {
            var model = new LawUnit()
            {
                UicTypeId     = NomenclatureConstants.UicTypes.EGN,
                LawUnitTypeId = NomenclatureConstants.LawUnitTypes.Lawyer,
                Code          = lawyer.PersonalId,
                Department    = bars.Where(x => x.OuterCode == lawyer.BarAssociation).Select(x => x.Description).FirstOrDefault(),
                DateFrom      = DefaultDateFrom,
                DateWrt       = DateTime.Now
            };

            if (!lawyer.PracticeAllowed)
            {
                model.DateTo = DefaultDateTo;
            }

            model.SplitPersonNames(lawyer.Name);
            model.FullName = model.MakeFullName();

            if (!string.IsNullOrEmpty(model.Uic))
            {
                model.Person.CopyFrom(model);
            }
            else
            {
                model.Person = null;
            }
            return(model);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool AssignLawyersToCollection(LawyerModel model)
 {
     if (new DataAccess.DataAccess().ExecuteNonQuery("AVZ_COL_spAssignLawyers", new { MerchantId = model.merchantId, ContractId = model.contractId, LawyerId = model.lawyerId, DocumentIds = model.documentType, InsertUserId = model.insertUserId }))
         return true;
     else
         return false;
 }
 public HttpResponseMessage AssignLawyer(LawyerModel model)
 {
     using (CollectionsTier ct = new CollectionsTier())
     {
         if (ct.AssignLawyersToCollection(model))
             return this.Request.CreateResponse(HttpStatusCode.OK);
         else
             return this.Request.CreateResponse(HttpStatusCode.NotModified);
     }
 }
        public void Add(LawyerModel lawyer)
        {
            var data = GetAll();

            //var lawyers = CommonFunctions.Getlawyers();

            //var p = lawyers.FirstOrDefault(a => a.KeyId == lawyer.lawyerTypeId);
            //if (p != null)
            //    lawyer.firstName = p.firstName;
            if (lawyer.lawyerId > 0)
            {
                lawyer.ID =Convert.ToInt16(lawyer.lawyerId);
            }
            else if (lawyer.ID == 0)
            {
                if (data.Count > 0)
                    lawyer.ID = data.Max(a => a.ID) + 1;
                else
                    lawyer.ID = 100000;
            }

            data.Add(lawyer);
            HttpContext.Current.Session[SessionLawyerList] = data;
        }
        public void Update(LawyerModel lawyer)
        {
            //Delete(lawyer.ID);
            var data = GetAll();
            var itm = data.Where(a => a.ID == lawyer.ID).FirstOrDefault();
            if (itm != null)
            {

                data.Remove(itm);
                HttpContext.Current.Session[SessionLawyerList] = data;
            }
            Add(lawyer);
        }
Exemple #6
0
 public LawyerController(LawyerModel context)
 {
     this.context = context;
 }