private Boolean LockChild(Guid childID)
        {
            Boolean childLocked = false;

            try
            {
                string addDataForm = "b46fe5b4-0fbf-4dfc-8f9b-e6b19f281720";

                DataFormLoadRequest request = OCM.BBISWebParts.WebsiteChildLockAddDataForm.CreateLoadRequest(this.API.AppFxWebServiceProvider);
                request.FormID = new Guid(addDataForm);
                OCM.BBISWebParts.WebsiteChildLockAddDataFormData data = OCM.BBISWebParts.WebsiteChildLockAddDataForm.LoadData(this.API.AppFxWebServiceProvider, request);

                data.ContextRecordID = ChildID.ToString();
                data.SESSIONID       = Session.SessionID.ToString();

                // if this is successful, then the child was locked.
                data.Save(this.API.AppFxWebServiceProvider);

                // *****  this.LoadChildInfo(id);  *****


                if (ChildID != Guid.Empty)
                {
                    childLocked = true;
                }
            }

            catch (Exception ex)
            {
                // Determine if Child could not be locked
                if (ex.Message.ToString().Contains(LockError))
                {
                    if (ex.Message.ToString().Contains(LockUnsuccessful))
                    {
                        string childLockedPageURL = Utility.GetBBISPageUrl(MyContent.ChildLockedPageID) + "{0}id=" + ChildID;
                        childLockedPageURL = childLockedPageURL.IndexOf("?") > -1 ? String.Format(childLockedPageURL, "&") : String.Format(childLockedPageURL, "?");
                        Response.Redirect(childLockedPageURL, false);
                    }
                    else if (ex.Message.ToString().Contains(ChildNotEligible))
                    {
                        string childIneligiblePageURL = Utility.GetBBISPageUrl(MyContent.ChildIneligiblePageID) + "{0}id=" + ChildID;
                        childIneligiblePageURL = childIneligiblePageURL.IndexOf("?") > -1 ? String.Format(childIneligiblePageURL, "&") : String.Format(childIneligiblePageURL, "?");
                        Response.Redirect(childIneligiblePageURL, false);
                    }
                    else if (ex.Message.ToString().Contains(ChildNotReserved))
                    {
                        string childUnavailablePageURL = Utility.GetBBISPageUrl(MyContent.ChildUnavailablePageID) + "{0}id=" + ChildID;
                        childUnavailablePageURL = childUnavailablePageURL.IndexOf("?") > -1 ? String.Format(childUnavailablePageURL, "&") : String.Format(childUnavailablePageURL, "?");
                        Response.Redirect(childUnavailablePageURL, false);
                    }
                }
                else
                {
                    this.lblError.Text    = ex.Message + "<br /><br />" + ex.StackTrace;
                    this.lblError.Visible = true;
                }
            }

            return(childLocked);
        }
        private void AddSponsorship()
        {
            if (ChildID != Guid.Empty)
            {
                // grab off session once
                DataTable dt = this.cartData;
                //string id = Convert.ToString(Request.QueryString["id"]);

                // if the id is already in the cart, don't re-add it.
                DataRow[] check = dt.Select("id = '" + ChildID.ToString() + "'");
                if (check.Length == 0)
                {
                    DataFormLoadRequest opportunityRequest = OCM.BBISWebParts.WebsiteChildInfoViewForm.CreateRequest(this.API.AppFxWebServiceProvider);
                    opportunityRequest.FormID          = new Guid("9860f33f-efeb-478b-a312-f7e1c3bd4244");
                    opportunityRequest.RecordID        = ChildID.ToString();
                    opportunityRequest.ContextRecordID = ChildID.ToString();
                    OCM.BBISWebParts.WebsiteChildInfoViewFormData opportunity = OCM.BBISWebParts.WebsiteChildInfoViewForm.LoadData(this.API.AppFxWebServiceProvider, opportunityRequest);

                    DataRow dr = dt.NewRow();
                    dr["ID"]          = ChildID;
                    dr["Number"]      = opportunity.CHILDLOOKUPID;
                    dr["Name"]        = opportunity.CHILDNAME;
                    dr["Months"]      = 1;
                    dr["Amount"]      = Classes.Utility.GetSponsorshipAmount();
                    dr["Gender"]      = opportunity.GENDER;
                    dr["CountryName"] = opportunity.COUNTRYNAME;
                    dr["Birthdate"]   = opportunity.BIRTHDATE;
                    dt.Rows.Add(dr);

                    // add data back to session
                    this.cartData = dt;
                }
            }
        }
예제 #3
0
 public Form1()
 {
     InitializeComponent();
     panel1.BringToFront();
     stepIndex = 1;
     if (ChildID == -1)
     {
         ChildID = 1;
     }
     str = ChildID.ToString().PadLeft(8, '0');
     checkRemain();
 }
예제 #4
0
 public void CleanSelect()
 {
     textBox1.Text         = "";
     radioButton1.Checked  = false;
     radioButton2.Checked  = false;
     radioButton3.Checked  = false;
     radioButton4.Checked  = false;
     radioButton5.Checked  = false;
     radioButton6.Checked  = false;
     radioButton7.Checked  = false;
     radioButton8.Checked  = false;
     radioButton9.Checked  = false;
     radioButton10.Checked = false;
     radioButton11.Checked = false;
     radioButton12.Checked = false;
     ChildID++;
     str = ChildID.ToString().PadLeft(8, '0');
 }
예제 #5
0
 public override bool Equals(Object obj)
 {
     if (obj is Problem ob)
     {
         return(Id.Equals(ob.Id) && CategoryId.Equals(ob.CategoryId) && ThemeId.Equals(ob.ThemeId) && Adress.Equals(ob.Adress) &&
                SourceId.Equals(ob.SourceId) && CreateDate.Equals(ob.CreateDate) && AnswerDate.Equals(ob.AnswerDate) &&
                ProblemText.Equals(ob.ProblemText) && ProblemPhotos.Equals(ob.ProblemPhotos) && AnswerText.Equals(ob.AnswerText) &&
                AnswerPhotos.Equals(ob.AnswerPhotos) && StatusId.Equals(ob.StatusId) && DistrictId.Equals(ob.DistrictId) && ChildID.Equals(ob.ChildID) &&
                ParentID.Equals(ob.ParentID) && IspolnitelName.Equals(ob.IspolnitelName) && IspolnitelId.Equals(ob.IspolnitelId));
     }
     return(false);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.SetSponsorshipState();

                if (ChildID != Guid.Empty)
                {
                    try
                    {
                        // Check if there are any locks and if the child is available and eligible using the data list
                        // The GetRows method will throw an exception if the child is not available or not eligible

                        OCM.BBISWebParts.WebsiteChildLockDataListFilterData filter = new OCM.BBISWebParts.WebsiteChildLockDataListFilterData();
                        filter.SESSIONID = Session.SessionID.ToString();

                        OCM.BBISWebParts.WebsiteChildLockDataListRow[] childLocks = OCM.BBISWebParts.WebsiteChildLockDataList.GetRows(this.API.AppFxWebServiceProvider, ChildID.ToString(), filter);

                        // If are any rows, then there are locks that have not expired
                        if (childLocks.Length > 0)
                        {
                            string childLockedPageURL = Utility.GetBBISPageUrl(MyContent.ChildLockedPageID) + "{0}id=" + ChildID;
                            childLockedPageURL = childLockedPageURL.IndexOf("?") > -1 ? String.Format(childLockedPageURL, "&") : String.Format(childLockedPageURL, "?");
                            Response.Redirect(childLockedPageURL);
                        }
                        else
                        {
                            // If you make it to here, the child can be displayed
                            this.LoadChildInfo(ChildID);
                        }
                    }

                    catch (Exception ex)
                    {
                        // Determine if Child could not be locked
                        if (ex.Message.ToString().Contains(LockError))
                        {
                            if (ex.Message.ToString().Contains(ChildNotEligible))
                            {
                                string childIneligiblePageURL = Utility.GetBBISPageUrl(MyContent.ChildIneligiblePageID) + "{0}id=" + ChildID;
                                childIneligiblePageURL = childIneligiblePageURL.IndexOf("?") > -1 ? String.Format(childIneligiblePageURL, "&") : String.Format(childIneligiblePageURL, "?");
                                Response.Redirect(childIneligiblePageURL, false);
                            }
                            else if (ex.Message.ToString().Contains(ChildNotReserved))
                            {
                                string childUnavailablePageURL = Utility.GetBBISPageUrl(MyContent.ChildUnavailablePageID) + "{0}id=" + ChildID;
                                childUnavailablePageURL = childUnavailablePageURL.IndexOf("?") > -1 ? String.Format(childUnavailablePageURL, "&") : String.Format(childUnavailablePageURL, "?");
                                Response.Redirect(childUnavailablePageURL, false);
                            }
                        }
                        else
                        {
                            this.lblError.Text    = ex.Message + "<br /><br />" + ex.StackTrace;
                            this.lblError.Visible = true;
                        }
                    }

                    //try
                    //{

                    //    string addDataForm = "b46fe5b4-0fbf-4dfc-8f9b-e6b19f281720";

                    //    DataFormLoadRequest request = OCM.BBISWebParts.WebsiteChildLockAddDataForm.CreateLoadRequest(this.API.AppFxWebServiceProvider);
                    //    request.FormID = new Guid(addDataForm);
                    //    OCM.BBISWebParts.WebsiteChildLockAddDataFormData data = OCM.BBISWebParts.WebsiteChildLockAddDataForm.LoadData(this.API.AppFxWebServiceProvider, request);

                    //    data.ContextRecordID = id.ToString();
                    //    data.SESSIONID = Session.SessionID.ToString();

                    //    // if this is successful, then the child was locked.
                    //    data.Save(this.API.AppFxWebServiceProvider);

                    //    this.LoadChildInfo(id);
                    //}
                    //catch (Exception ex)
                    //{
                    //    // Determine if Child could not be locked
                    //    if (ex.Message.ToString().Contains(LockError))
                    //    {
                    //        if (ex.Message.ToString().Contains(LockUnsuccessful))
                    //        {
                    //            string childLockedPageURL = Utility.GetBBISPageUrl(MyContent.ChildLockedPageID) + "{0}id=" + id;
                    //            childLockedPageURL = childLockedPageURL.IndexOf("?") > -1 ? String.Format(childLockedPageURL, "&") : String.Format(childLockedPageURL, "?");
                    //            Response.Redirect(childLockedPageURL);
                    //        }
                    //        else if (ex.Message.ToString().Contains(ChildNotEligible))
                    //        {
                    //            string childIneligiblePageURL = Utility.GetBBISPageUrl(MyContent.ChildIneligiblePageID) + "{0}id=" + id;
                    //            childIneligiblePageURL = childIneligiblePageURL.IndexOf("?") > -1 ? String.Format(childIneligiblePageURL, "&") : String.Format(childIneligiblePageURL, "?");
                    //            Response.Redirect(childIneligiblePageURL);
                    //        }
                    //        else if (ex.Message.ToString().Contains(ChildNotReserved))
                    //        {
                    //            string childUnavailablePageURL = Utility.GetBBISPageUrl(MyContent.ChildUnavailablePageID) + "{0}id=" + id;
                    //            childUnavailablePageURL = childUnavailablePageURL.IndexOf("?") > -1 ? String.Format(childUnavailablePageURL, "&") : String.Format(childUnavailablePageURL, "?");
                    //            Response.Redirect(childUnavailablePageURL);
                    //        }

                    //    }
                    //    else
                    //    {
                    //        this.lblError.Text = ex.Message + "<br /><br />" + ex.StackTrace;
                    //        this.lblError.Visible = true;
                    //    }
                    //}
                }
            }
        }
예제 #7
0
        public async void SearchClicked(string dob, string enrollmentDate)
        {
            var searchChildRecords = new List <ChildRecordsNewAssessment>();
            var isMorethan1000     = false;

            await LoadChildRecordsFromDBAsync();

            if (!string.IsNullOrEmpty(FirstName) || !string.IsNullOrEmpty(LastName) || (SelectedLocations != null && SelectedLocations.Any()) || !string.IsNullOrEmpty(dob) || !string.IsNullOrEmpty(enrollmentDate) || !string.IsNullOrEmpty(ChildID))
            {
                IEnumerable <ChildRecordsNewAssessment> query = ChildTestRecords;

                if (!string.IsNullOrEmpty(FirstName))
                {
                    query = query.Where(p => !string.IsNullOrEmpty(p.FirstName) && p.FirstName.ToLower().Contains(FirstName.ToLower()));
                }
                if (!string.IsNullOrEmpty(LastName))
                {
                    query = query.Where(p => !string.IsNullOrEmpty(p.LastName) && p.LastName.ToLower().Contains(LastName.ToLower()));
                }
                if (!string.IsNullOrEmpty(ChildID))
                {
                    query = query.Where(p => !string.IsNullOrEmpty(p.ChildID) && p.ChildID.ToLower().Contains(ChildID.ToLower()));
                }
                if (!string.IsNullOrEmpty(dob))
                {
                    query = query.Where(p => !string.IsNullOrEmpty(p.DOB) && p.DOB == dob);
                }
                if (!string.IsNullOrEmpty(enrollmentDate))
                {
                    query = query.Where(p => !string.IsNullOrEmpty(p.Enrollment) && p.Enrollment == enrollmentDate);
                }
                if (SelectedLocations.Count > 0)
                {
                    query = query.Where(p => !string.IsNullOrEmpty(p.Location) && SelectedLocations.Contains(p.Location));
                }

                searchChildRecords = new List <ChildRecordsNewAssessment>(query);
            }
            else
            {
                searchChildRecords = ChildTestRecords;
            }


            if (!searchChildRecords.Any())
            {
                SearchResult       = ErrorMessages.RecordMatchesFoundMessage;
                SearchErrorColor   = Color.Red;
                SearchErrorVisible = true;
            }
            else
            {
                SearchResult       = string.Format(ErrorMessages.RecordsFoundMessage, searchChildRecords.Count(), searchChildRecords.Count() == 1 ? "Match" : "Matches");
                SearchErrorColor   = Color.Black;
                SearchErrorVisible = true;
                if (searchChildRecords.Count > 1000)
                {
                    isMorethan1000     = true;
                    SearchResult       = ErrorMessages.SearchError;
                    SearchErrorColor   = Color.Red;
                    SearchErrorVisible = true;
                }
                else if (searchChildRecords.Count > 5)
                {
                    searchChildRecords[searchChildRecords.Count - 1].IsTableSepartorVisble = false;
                }
                else
                {
                    searchChildRecords[searchChildRecords.Count - 1].IsTableSepartorVisble = true;
                    IsTableBottomLineVisible = false;
                }
                if (SelectAll)
                {
                    int index = 0;
                    foreach (var record in searchChildRecords)
                    {
                        index++;
                    }
                }
            }
            var list          = searchChildRecords.OrderBy(a => a.LastName);
            var reorderedList = new List <ChildRecordsNewAssessment>(list);

            ChildTestRecords.Clear();
            if (!isMorethan1000)
            {
                ChildTestRecords = reorderedList;
            }
        }