protected void ckFamCertReview_Check(object sender, EventArgs e)
 {
     try
     {
         CheckBox     ckBox        = (CheckBox)sender;
         int          rowIndex     = Convert.ToInt32(ckBox.Attributes["RowIndex"]);
         HiddenField  hfFamilyId   = grvFamilyDetails.Rows[rowIndex].FindControl("hfFamId") as HiddenField;
         FamilyDetail familyDetail = _presenter.CurrentAppUser.Employee.GetFamilyDetail(Convert.ToInt32(hfFamilyId.Value));
         if (ckBox.Checked == true)
         {
             familyDetail.Reviewed = true;
         }
         else
         {
             familyDetail.Reviewed = false;
         }
         _presenter.SaveOrUpdateEmployee(_presenter.CurrentAppUser);
         Master.ShowMessage(new AppMessage("You've Successfully Reviewed this Certificate!", RMessageType.Info));
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "movetofamily();", true);
     }
     catch (Exception ex)
     {
         Master.ShowMessage(new AppMessage("Error: While Reviewing Certificate!", RMessageType.Error));
         ExceptionUtility.LogException(ex, ex.Source);
         ExceptionUtility.NotifySystemOps(ex, _presenter.CurrentUser().FullName);
     }
 }
        private string FamilyDetailString(FamilyDetail f)
        {
            int intPreviousIndex = -1;

            foreach (int itemChecked in chklstTMSResults.CheckedIndices)
            {
                intPreviousIndex = itemChecked;
                chklstTMSResults.SetItemChecked(itemChecked, false);
            }

            if (chklstTMSResults.SelectedIndex != intPreviousIndex)
            {
                chklstTMSResults.SetItemChecked(chklstTMSResults.SelectedIndex, true);
            }

            string strSummary = "";

            //Family Summary
            strSummary = strSummary + "FamilyId : " + f.FamilyId + "\r\n";
            strSummary = strSummary + "FamilyState : " + f.FamilyState + "\r\n";
            strSummary = strSummary + "LastAuthorizedAmount : " + f.LastAuthorizedAmount + "\r\n";
            strSummary = strSummary + "MerchantProfileId : " + f.MerchantProfileId + "\r\n";
            strSummary = strSummary + "NetAmount : " + f.NetAmount + "\r\n";
            strSummary = strSummary + "ServiceKey : " + f.ServiceKey + "\r\n";

            //TransactionId
            strSummary = strSummary + "List of TransactionIds\r\n";
            foreach (string txnid in f.TransactionIds)
            {
                strSummary = strSummary + txnid + "\r\n";
            }
            strSummary = strSummary + "\r\n";
            return(strSummary);
        }
 protected void btnFamDelete_Click(object sender, EventArgs e)
 {
     try
     {
         _presenter.CurrentAppUser.Employee.RemoveFamilyDetail(Convert.ToInt32(Session["famId"]));
         FamilyDetail delFamilyDetail = _presenter.GetFamilyDetail(Convert.ToInt32(Session["famId"]));
         if (delFamilyDetail != null)
         {
             _presenter.DeleteFamilyDetail(delFamilyDetail);
         }
         _presenter.SaveOrUpdateEmployee(_presenter.CurrentAppUser);
         Session["famId"] = null;
         //Clear the fields
         clearFamilyDetails();
         BindFamilyDetails();
         btnFamDelete.Enabled = false;
         Master.ShowMessage(new AppMessage("Family Information Is Successfully Deleted!", RMessageType.Info));
         ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "movetofamily();", true);
     }
     catch (Exception ex)
     {
         Master.ShowMessage(new AppMessage("Error: While Deleting Family Detail!", RMessageType.Error));
         ExceptionUtility.LogException(ex, ex.Source);
         ExceptionUtility.NotifySystemOps(ex, _presenter.CurrentUser().FullName);
     }
 }
Пример #4
0
        public static string CreateTemporaryPathForFamily(FamilyDetail famDetail)
        {
            string str  = FamMgr_Util.CreateTempFolder(FamMgr_Util.WorkingDirectory, famDetail.CategoryName + "-" + famDetail.ElmID);
            string text = FamMgr_Util.MakeValidFileName(famDetail.FamilyName);

            text = ((text == string.Empty) ? famDetail.ElmID.ToString() : text);
            return(str + "\\" + text + ".rfa");
        }
Пример #5
0
        public async Task <bool> Add(PersonalDetailEntity entity)
        {
            var result     = 0;
            var memberList = _context.Member.Where(x => x.IsActive.Value).Select(x => new {
                id   = x.MemberId,
                desc = x.MemberDesc
            }).ToList();

            var maxSerialno      = 0;
            var maxSerialnoquery = _context.FamilyDetail.Where(x => x.IsActive.Value && x.RepId == LoggedInUserId).Select(x => x.SerialNo);

            if (maxSerialnoquery.Any())
            {
                maxSerialno = maxSerialnoquery.Max();
            }
            var CodeValue = _context.CodeValue.Where(x => x.IsActive.Value).Select(x => x).ToList();

            var detail = new FamilyDetail()
            {
                RepId             = LoggedInUserId,
                MemberId          = memberList.Where(x => x.desc == entity.RelationWithEmp).Select(x => x.id).FirstOrDefault(),
                SerialNo          = maxSerialno + 1,
                BirthDate         = Convert.ToDateTime(entity.DateOfBirth),
                GenderId          = CodeValue.Where(x => x.ValCode.ToLower() == entity.Gender.ToLower() && x.TypeCode == GlobalConstant.Gender).Select(x => x.CodeValId).FirstOrDefault(),
                FirstName         = entity.MemberName.Split(" ")[0],
                LastName          = entity.MemberName.Split(" ")[1],
                MaritalStatusId   = CodeValue.Where(x => x.ValCode.ToLower() == entity.MaritalStatus.ToLower() && x.TypeCode == GlobalConstant.MaritalStatus).Select(x => x.CodeValId).FirstOrDefault(),
                NomineeName       = string.IsNullOrEmpty(entity.NameOfNominee) ? null : entity.NameOfNominee,
                NomineeRelationId = string.IsNullOrEmpty(entity.RelationOfNomineeWithEmp) ? (int?)null : memberList.Where(x => x.desc == entity.RelationOfNomineeWithEmp).Select(x => x.id).FirstOrDefault(),
                Reason            = entity.Reason,
                IsActive          = true,
                CreatedBy         = "System",
                CreatedDate       = DateTime.Now,
                ModifiedBy        = "System",
                ModifiedDate      = DateTime.Now,
            };

            _context.FamilyDetail.Add(detail);
            result = _context.SaveChanges();

            if (result > 0)
            {
                return(true);
            }
            return(false);
        }
        protected void grvFamilyDetails_SelectedIndexChanged(object sender, EventArgs e)
        {
            famId            = Convert.ToInt32(grvFamilyDetails.SelectedDataKey[0]);
            Session["famId"] = Convert.ToInt32(grvFamilyDetails.SelectedDataKey[0]);
            FamilyDetail familyDetail = _presenter.CurrentAppUser.Employee.GetFamilyDetail(famId);

            txtFamFirstName.Text             = familyDetail.FirstName;
            txtFamLastName.Text              = familyDetail.LastName;
            txtFamCellPhone.Text             = familyDetail.CellPhone;
            txtFamDateOfBirth.Text           = Convert.ToDateTime(familyDetail.DateOfBirth).ToShortDateString();
            txtFamDateOfMarriage.Text        = Convert.ToDateTime(familyDetail.DateOfMarriage).ToShortDateString();
            ddlFamGender.SelectedValue       = familyDetail.Gender;
            ddlFamRelationship.SelectedValue = familyDetail.Relationship;
            btnFamSave.Text      = "Update";
            btnFamDelete.Enabled = true;

            #region Relationship Logic
            //Handle the Relationship logic Regarding Dates being visible or not
            if (ddlFamRelationship.SelectedValue == "Spouse")
            {
                pnlFamDateOfMarriage.Visible = true;
                pnlFamCertificate.Visible    = true;
                pnlFamDateOfBirth.Visible    = false;
                txtFamDateOfBirth.Text       = String.Empty;
            }
            else if (ddlFamRelationship.SelectedValue == "Child")
            {
                pnlFamDateOfBirth.Visible    = true;
                pnlFamCertificate.Visible    = true;
                pnlFamDateOfMarriage.Visible = false;
                txtFamDateOfMarriage.Text    = String.Empty;
            }
            else if (ddlFamRelationship.SelectedValue == "Parent")
            {
                pnlFamDateOfMarriage.Visible = false;
                pnlFamDateOfBirth.Visible    = false;
                pnlFamCertificate.Visible    = false;
                txtFamDateOfMarriage.Text    = String.Empty;
                txtFamDateOfBirth.Text       = String.Empty;
            }
            #endregion

            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "movetofamily();", true);
        }
 private void chklstTMSResults_SelectedIndexChanged(object sender, EventArgs e)
 {
     //Process SummaryDetail response
     if (_lastSearch == LastSearchType.QueryTransactionsSummary)
     {
         if (chklstTMSResults.SelectedItem == null)
         {
             return;
         }
         SummaryDetail s = ((SummaryDetailVal)(chklstTMSResults.SelectedItem)).SD;
         txtTMSResults.Text = SummaryDetailString(s);
     }
     //Process FamilyDetail response
     if (_lastSearch == LastSearchType.QueryTransactionFamilies)
     {
         if (chklstTMSResults.SelectedItem == null)
         {
             return;
         }
         FamilyDetail f = ((FamilyDetailVal)(chklstTMSResults.SelectedItem)).FD;
         txtTMSResults.Text = FamilyDetailString(f);
     }
     //Process BatchDetailData response
     if (_lastSearch == LastSearchType.QueryBatch)
     {
         if (chklstTMSResults.SelectedItem == null)
         {
             return;
         }
         BatchDetailData b = ((BatchDetailDataVal)(chklstTMSResults.SelectedItem)).BDD;
         txtTMSResults.Text = BatchDetailDataString(b);
     }
     //Process TransactionDetail response
     if (_lastSearch == LastSearchType.QueryTransactionsDetail)
     {
         if (chklstTMSResults.SelectedItem == null)
         {
             return;
         }
         TransactionDetail t = ((TransactionDetailVal)(chklstTMSResults.SelectedItem)).TD;
         txtTMSResults.Text = TransactionDetailString(t);
     }
 }
 public FamilyDetailVal(FamilyDetail fd)
 {
     FD = fd;
 }
        private string FamilyDetailString(FamilyDetail f)
        {
            int intPreviousIndex = -1;
            foreach (int itemChecked in chklstTMSResults.CheckedIndices)
            {
                intPreviousIndex = itemChecked;
                chklstTMSResults.SetItemChecked(itemChecked, false);
            }

            if (chklstTMSResults.SelectedIndex != intPreviousIndex)
                chklstTMSResults.SetItemChecked(chklstTMSResults.SelectedIndex, true);

            string strSummary = "";

            //Family Summary
            strSummary = strSummary + "FamilyId : " + f.FamilyId + "\r\n";
            strSummary = strSummary + "FamilyState : " + f.FamilyState + "\r\n";
            strSummary = strSummary + "LastAuthorizedAmount : " + f.LastAuthorizedAmount + "\r\n";
            strSummary = strSummary + "MerchantProfileId : " + f.MerchantProfileId + "\r\n";
            strSummary = strSummary + "NetAmount : " + f.NetAmount + "\r\n";
            strSummary = strSummary + "ServiceKey : " + f.ServiceKey + "\r\n";

            //TransactionId
            strSummary = strSummary + "List of TransactionIds\r\n";
            foreach (string txnid in f.TransactionIds)
            {
                strSummary = strSummary + txnid + "\r\n";
            }
            strSummary = strSummary + "\r\n";
            return strSummary;
        }
        private void FamilyDetailString(FamilyDetail f)
        {
            RtxtTMSResults.SelectionColor = Color.Black;

            //Family Summary
            RtxtTMSResults.AppendText("BatchId : " + f.BatchId + "\r\n");
            RtxtTMSResults.AppendText("CaptureDateTime : " + f.CaptureDateTime + "\r\n");
            RtxtTMSResults.AppendText("CapturedAmount : " + f.CapturedAmount + "\r\n");
            RtxtTMSResults.AppendText("CustomerId : " + f.CustomerId + "\r\n");
            RtxtTMSResults.AppendText("FamilyId : " + f.FamilyId + "\r\n");
            RtxtTMSResults.AppendText("FamilyState : " + f.FamilyState + "\r\n");
            RtxtTMSResults.AppendText("LastAuthorizedAmount : " + f.LastAuthorizedAmount + "\r\n");
            RtxtTMSResults.AppendText("MerchantProfileId : " + f.MerchantProfileId + "\r\n");
            RtxtTMSResults.AppendText("NetAmount : " + f.NetAmount + "\r\n");
            RtxtTMSResults.AppendText("ServiceKey : " + f.ServiceKey + "\r\n");

            //TransactionId
            RtxtTMSResults.AppendText("List of TransactionIds\r\n");
            foreach (string txnid in f.TransactionIds)
            {
                RtxtTMSResults.AppendText(txnid + "\r\n");
            }
            RtxtTMSResults.AppendText("\r\nTransaction Meta Data\r\n");
            foreach (TransactionMetaData TMD in f.TransactionMetaData)
            {
                RtxtTMSResults.AppendText("TransactionId : " + TMD.TransactionId + "\r\n");
                RtxtTMSResults.AppendText("* Amount : " + TMD.Amount + "\r\n");
                RtxtTMSResults.AppendText("* CardType : " + TMD.CardType + "\r\n");
                RtxtTMSResults.AppendText("* MaskedPAN : " + TMD.MaskedPAN + "\r\n");
                RtxtTMSResults.AppendText("* SequenceNumber : " + TMD.SequenceNumber + "\r\n");
                RtxtTMSResults.AppendText("* ServiceId : " + TMD.ServiceId + "\r\n");
                RtxtTMSResults.AppendText("* TransactionClass : " + TMD.TransactionClassTypePair.TransactionClass + "    ");
                RtxtTMSResults.AppendText("* TransactionType : " + TMD.TransactionClassTypePair.TransactionType + "\r\n");
                RtxtTMSResults.AppendText("* TransactionDateTime : " + TMD.TransactionDateTime + "\r\n");
                RtxtTMSResults.AppendText("* TransactionState : " + TMD.TransactionState + "\r\n");
                RtxtTMSResults.AppendText("* WorkflowId : " + TMD.WorkflowId + "\r\n");
                RtxtTMSResults.AppendText("\r\n");
            }

            RtxtTMSResults.AppendText("\r\n");
        }
        protected void btnFamSave_Click(object sender, EventArgs e)
        {
            try
            {
                FamilyDetail familyDetail = null;
                if (Session["famId"] != null)
                {
                    familyDetail = _presenter.CurrentAppUser.Employee.GetFamilyDetail(Convert.ToInt32(Session["famId"]));
                }
                else
                {
                    familyDetail = new FamilyDetail();
                }

                familyDetail.FirstName = txtFamFirstName.Text;
                familyDetail.LastName  = txtFamLastName.Text;
                if (!String.IsNullOrEmpty(txtFamDateOfBirth.Text))
                {
                    familyDetail.DateOfBirth = Convert.ToDateTime(txtFamDateOfBirth.Text);
                }
                else
                {
                    familyDetail.DateOfBirth = null;
                }
                familyDetail.Gender       = ddlFamGender.SelectedValue;
                familyDetail.Relationship = ddlFamRelationship.SelectedValue;
                familyDetail.CellPhone    = txtFamCellPhone.Text;
                if (!String.IsNullOrEmpty(txtFamDateOfMarriage.Text))
                {
                    familyDetail.DateOfMarriage = Convert.ToDateTime(txtFamDateOfMarriage.Text);
                }
                else
                {
                    familyDetail.DateOfMarriage = null;
                }
                //Attached Certificates
                if (fuCertificate.HasFile)
                {
                    string fileName = "Fam" + _presenter.CurrentAppUser.UserName + Path.GetFileName(fuCertificate.PostedFile.FileName);
                    familyDetail.Certificate = "~/Certificates/" + fileName;
                    fuCertificate.PostedFile.SaveAs(Server.MapPath("~/Certificates/") + fileName);
                }

                if (Session["famId"] == null)
                {
                    _presenter.CurrentAppUser.Employee.FamilyDetails.Add(familyDetail);
                }
                _presenter.SaveOrUpdateEmployee(_presenter.CurrentAppUser);
                BindFamilyDetails();
                clearFamilyDetails();
                Session["famId"] = null;
                btnFamSave.Text  = "Save & Add New";
                Master.ShowMessage(new AppMessage("You've Successfully Updated Your Family Information!", RMessageType.Info));
                Log.Info(_presenter.CurrentUser().FullName + " has updated his/her Family Information");
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "script", "movetofamily();", true);
            }
            catch (Exception ex)
            {
                Master.ShowMessage(new AppMessage("Error: While Updating Family Information!", RMessageType.Error));
                ExceptionUtility.LogException(ex, ex.Source);
                ExceptionUtility.NotifySystemOps(ex, _presenter.CurrentUser().FullName);
            }
        }
 public FamilyDetailVal(FamilyDetail fd)
 {
     FD = fd;
 }
Пример #13
0
 public void DeleteFamilyDetail(FamilyDetail familyDetail)
 {
     _controller.DeleteEntity(familyDetail);
 }