Exemplo n.º 1
0
        public static string Translate(this FamilyRelations tagtype)
        {
            switch (tagtype)
            {
            case FamilyRelations.Parent:
                return(Messages.TagType_Parent);

            case FamilyRelations.Child:
                return(Messages.TagType_Child);

            default:
                Assert.FailOnEnumeration(tagtype);
                return(null);
            }
        }
Exemplo n.º 2
0
 private string SetRelation(FamilyRelations relation)
 {
     return string.Format(Messages.Msg_Relation, relation.Translate(), PluginContext.Host.SelectedPatient.DisplayedName);
 }
Exemplo n.º 3
0
 private string SetRelation(FamilyRelations relation)
 {
     return(string.Format(Messages.Msg_Relation, relation.Translate(), PluginContext.Host.SelectedPatient.DisplayedName));
 }
        public ActionResult SubmitRelations(IDictionary <string, string> jsondata)
        {
            try
            {
                int FamId = int.Parse(jsondata["FamilyId"]);
                int flag  = 1;
                int ApplicationID;
                jsondata.Remove("FamilyId");

                var Relations = httpHelper.GetCall <List <FamilyRelations> >("api/Family/GetFamilyRelations").Result;
                Relations = Relations.AsQueryable().Where(x => x.FamilyId == FamId).ToList();
                if (Relations.Count == jsondata.Count)
                {
                    FamilyDetails familyDetails = new FamilyDetails();
                    familyDetails.FamilyId   = FamId;
                    familyDetails.isApproved = false;
                    var FamDetails  = httpHelper.GetCall <List <FamilyDetails> >("api/Family/GetFamilyDetails").Result;
                    var RequiredFam = FamDetails.AsQueryable().Where(x => x.FamilyId == FamId).FirstOrDefault();
                    if (RequiredFam == null)
                    {
                        ApplicationID = httpHelper.PostDataAndGetAppId <FamilyDetails>(familyDetails, "api/Family/PostFamilyDetails");
                        return(Json(ApplicationID, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(RequiredFam.ApplicationId, JsonRequestBehavior.AllowGet));
                    }
                }

                foreach (var item in jsondata)
                {
                    FamilyRelations familyRelations = new FamilyRelations();
                    familyRelations.Id       = item.Key;
                    familyRelations.Relation = item.Value;
                    familyRelations.FamilyId = FamId;
                    bool status = httpHelper.PostData <FamilyRelations>(familyRelations, "api/Family/PostFamilyRelations");
                    if (status == false)
                    {
                        flag = 0;
                        return(Json("Something went wrong", JsonRequestBehavior.AllowGet));
                    }
                }
                if (flag == 1)
                {
                    var FamDetails  = httpHelper.GetCall <List <FamilyDetails> >("api/Family/GetFamilyDetails").Result;
                    var RequiredFam = FamDetails.AsQueryable().Where(x => x.FamilyId == FamId).FirstOrDefault();
                    if (RequiredFam == null)
                    {
                        FamilyDetails familyDetails = new FamilyDetails();
                        familyDetails.FamilyId   = FamId;
                        familyDetails.isApproved = false;
                        ApplicationID            = httpHelper.PostDataAndGetAppId <FamilyDetails>(familyDetails, "api/Family/PostFamilyDetails");
                        return(Json(ApplicationID, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(RequiredFam.ApplicationId, JsonRequestBehavior.AllowGet));
                    }
                }
                else
                {
                    return(Json("Something Went Wrong", JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                return(View("Error"));;
            }
        }