//protected void amChecked()
        //{
        //    var amichecked = Optional_NextofKin__c.Checked;
        //    SACCOFactory.ShowAlert("Look what they did" + amichecked);
        //    if (amichecked==true)
        //    {
        //        SACCOFactory.ShowAlert("Look what they did");
        //    }
        //    else
        //    {
        //        SACCOFactory.ShowAlert("Not checked");
        //    }
        //   // ScriptManager.RegisterStartupScript(this, this.GetType(), "text", "AmReallyChecked()", true);

        //}

        protected void prebtnSubmit_Click(object sender, EventArgs e)
        {
            string fullname    = TextFname.Text.Trim();
            string idno        = TextIdno.Text.Trim();
            string phoneno     = pretxtPhoneno.Text.Trim();
            string email       = pretxtEmail.Text.Trim();
            string countryr    = pretxtcountry.Text.Trim();
            string town        = pretxttown.Text.Trim();
            string pin         = TextPin.Text.Trim();
            string county      = pretcounty.Text.Trim();
            string reffullname = textrefName.Text.Trim();

            string refidno = pretxtRId.Text.Trim();
            //string refphone = Textrefphone.Text.Trim();

            string kinname  = TxtKnameMajor.Text.Trim();
            string kinID    = txtPrkinId.Text.Trim();
            string KinPhone = txtPrphone.Text.Trim();

            //string Guardianname = TxtGname.Text.Trim();
            //string GuardianID = pretxtKGid.Text.Trim();
            string GuardianPhone = TextGphone.Text.Trim();

            string KinMinorname = TxtKinMinorname.Text.Trim();


            var MobileString  = pretxtPhoneno.Text.Trim();
            var mobileBuilder = new StringBuilder(MobileString);

            mobileBuilder.Remove(0, 1);     //Trim one character from position 1
            mobileBuilder.Insert(0, "254"); // replace position 0 with 254
            MobileString = mobileBuilder.ToString();

            int    actype  = 0;
            int    idDocs  = 0;
            int    gen     = 0;
            string acctype = TextAcct.Text.Trim();

            switch (acctype)
            {
            case "Individual Deposists (BOSA)":
                actype = 0;
                break;

            case "KSA Individual (FOSA)":
                actype = 1;
                break;
            }
            string iddoc = pretxtIdtype.Text.Trim();

            switch (iddoc)
            {
            case "NATIONAL_ID":
                idDocs = 0;
                break;

            case "ID":
                idDocs = 1;
                break;
            }
            string gender = Textgnd.Text.Trim();

            switch (gender)
            {
            case "M":
                gen = 1;
                break;

            case "F":
                gen = 2;
                break;
            }

            string   dob = TextDob.Text;
            DateTime dt  = Convert.ToDateTime(dob);


            string   kindot = TxtKdot.Text;
            DateTime kindt  = Convert.ToDateTime(kindot);


            //string Guardiandob = TxtGdob.Text;

            //DateTime Gdt = Convert.ToDateTime(Gdob);



            if (string.IsNullOrEmpty(fullname) || string.IsNullOrEmpty(iddoc) || string.IsNullOrEmpty(idno) ||
                string.IsNullOrEmpty(phoneno) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(acctype) || string.IsNullOrEmpty(countryr) || string.IsNullOrEmpty(town))
            {
                SACCOFactory.ShowAlert("Please fill all the empty required fields!");
                return;
            }
            else
            {
                try
                {
                    var     credentials = new NetworkCredential(ConfigurationManager.AppSettings["W_USER"], ConfigurationManager.AppSettings["W_PWD"], ConfigurationManager.AppSettings["DOMAIN"]);
                    Portals sup         = new Portals();
                    sup.Credentials     = credentials;
                    sup.PreAuthenticate = true;
                    sup.FnMemberApply(fullname, phoneno, email, idno, gen, pin, actype, dt, idDocs, countryr, county, town, refidno, reffullname);


                    //sup.FnRegisterKin(KinMinorname, "", "", DateTime.Now, idno, "MINOR");


                    var checkedkin = Optional_NextofKin__c.Checked;

                    switch (checkedkin)
                    {
                    case true:
                        // sup.FnRegisterKinMinor(KinMinorname, DateTime.Now, idno);
                        //sup.FnRegisterKin(Gname, KGid, GuardianPhone, dt, idno, "GUARD");

                        break;

                    case false:
                        //sup.FnRegisterKin(kinname, kinID, KinPhone, kindt, idno, "MAJOR");
                        break;
                    }
                    SACCOFactory.ShowAlert("Your data succcessfully saved");
                    //Your membership application submitted successfully. You will receive your Account details via SMS once approved. Thank you for choosing Kingdom sacco.
                }
                catch (Exception ex)
                {
                    SACCOFactory.ShowAlert(ex.Message);
                    //lblError.Text = ex.Message;
                    return;
                }
            }
        }
        protected void prebtnSubmitminor_Click(object sender, EventArgs e)
        {
            registerMultiView.SetActiveView(PaymentView);

            string fullname = TextFname.Text.Trim();
            string idno     = TextIdno.Text.Trim();
            //string phoneno = pretxtPhoneno.Text.Trim();
            string email       = pretxtEmail.Text.Trim();
            string countryr    = pretxtcountry.Text.Trim();
            string town        = pretxttown.Text.Trim();
            string pin         = TextPin.Text.Trim();
            string county      = pretcounty.Text.Trim();
            string reffullname = textrefName.Text.Trim();

            string refidno = pretxtRId.Text.Trim();
            //string refphone = Textrefphone.Text.Trim();

            string kinname  = TxtKnameMajor.Text.Trim();
            string kinID    = txtPrkinId.Text.Trim();
            string KinPhone = txtPrphone.Text.Trim();
            string rel      = ddlKinrelation.SelectedItem.Text;

            string guardianname  = TxtGname.Text.Trim();
            string guardianId    = pretxtKGid.Text.Trim();
            string guardianPhone = TextGphone.Text.Trim();

            string kinMinorname = TxtKinMinorname.Text.Trim();
            string relminor     = ddlKinminorrelation.SelectedItem.Text;


            var MobileString  = pretxtPhoneno.Text.Trim();
            var mobileBuilder = new StringBuilder(MobileString);

            mobileBuilder.Remove(0, 1);     //Trim one character from position 1
            mobileBuilder.Insert(0, "254"); // replace position 0 with 254
            MobileString = mobileBuilder.ToString();

            int    actype  = 0;
            int    idDocs  = 0;
            int    gen     = 0;
            string acctype = TextAcct.Text.Trim();

            switch (acctype)
            {
            case "Individual Deposists (BOSA)":
                actype = 0;
                break;

            case "KSA Individual (FOSA)":
                actype = 1;
                break;
            }
            string iddoc = pretxtIdtype.Text.Trim();

            switch (iddoc)
            {
            case "NATIONAL_ID":
                idDocs = 0;
                break;

            case "ID":
                idDocs = 1;
                break;
            }
            string gender = Textgnd.Text.Trim();

            switch (gender)
            {
            case "M":
                gen = 1;
                break;

            case "F":
                gen = 2;
                break;
            }

            string   dob = TextDob.Text;
            DateTime dt  = Convert.ToDateTime(dob);



            DateTime dobminor;
            var      kdb = kindob.Value;

            if (string.IsNullOrWhiteSpace(kdb))
            {
                SACCOFactory.ShowAlert("Please Select date of birth");
                kindob.Focus();
                return;
            }
            else
            {
                dobminor = DateTime.Parse(kdb);
            }


            string Guardiandob = TxtGdob.Text;

            DateTime Gdt = Convert.ToDateTime(Guardiandob);



            if (string.IsNullOrEmpty(fullname) || string.IsNullOrEmpty(iddoc) || string.IsNullOrEmpty(idno) ||
                string.IsNullOrEmpty(MobileString) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(acctype) || string.IsNullOrEmpty(countryr) || string.IsNullOrEmpty(town))
            {
                SACCOFactory.ShowAlert("Please fill all the empty required fields!");
                return;
            }
            else
            {
                try
                {
                    var     credentials = new NetworkCredential(ConfigurationManager.AppSettings["W_USER"], ConfigurationManager.AppSettings["W_PWD"], ConfigurationManager.AppSettings["DOMAIN"]);
                    Portals sup         = new Portals();
                    sup.Credentials     = credentials;
                    sup.PreAuthenticate = true;
                    sup.FnMemberApply(fullname, MobileString, email, idno, gen, pin, actype, dt, idDocs, countryr, county, town, refidno, reffullname);
                    sup.FnRegisterKin(guardianname, guardianId, "", guardianPhone, Gdt, idno, "GUARD");
                    sup.FnRegisterKin(kinMinorname, "", relminor, "", dobminor, idno, "MINOR");

                    SACCOFactory.ShowAlert("Your membership application submitted successfully. You will receive your Account details via SMS once approved. Thank you for choosing Kingdom sacco.");
                    //Your membership application submitted successfully. You will receive your Account details via SMS once approved. Thank you for choosing Kingdom sacco.
                    sup.IPRSPHOTOS(idno);
                }
                catch (Exception ex)
                {
                    SACCOFactory.ShowAlert(ex.Message);
                    //lblError.Text = ex.Message;
                    return;
                }
            }
        }
示例#3
0
        protected void registerMember()
        {
            string acCate     = ddlACcat.SelectedItem.Text;
            int    acCategory = 0;

            if (acCate.Equals("Individual"))
            {
                acCategory = 0;
            }
            else
            {
                acCategory = 1;
            }


            string apCate = ddlAPPCat.SelectedItem.Text;
            int    apType = 0;

            if (apCate.Equals("New Application"))
            {
                apType = 0;
            }
            else if (apCate.Equals("Rejoining"))
            {
                apType = 1;
            }
            else
            {
                apType = 2;
            }
            string gender = lstGender.SelectedItem.Text;
            int    gen;

            if (gender.Equals("Male"))
            {
                gen = 0;
            }
            else
            {
                gen = 1;
            }

            string marital = ddlMarital.SelectedItem.Text;
            int    marstat = 0;

            if (marital.Equals("Single"))
            {
                marstat = 1;
            }
            else if (marital.Equals("Married"))
            {
                marstat = 2;
            }
            else if (marital.Equals("Devorced"))
            {
                marstat = 3;
            }
            else if (marital.Equals("Widow"))
            {
                marstat = 4;
            }
            else if (marital.Equals("Widower"))
            {
                marstat = 5;
            }

            var MobileString  = txtPhoneNo.Text.Trim();
            var mobileBuilder = new StringBuilder(MobileString);

            mobileBuilder.Remove(0, 1);      //Trim one character from position 1
            mobileBuilder.Insert(0, "+254"); // replace position 0 with +254
            MobileString = mobileBuilder.ToString();

            var MobileKin = txtKinPhone.Text.Trim();
            var kinTrimer = new StringBuilder(MobileKin);

            kinTrimer.Remove(0, 1);
            kinTrimer.Insert(0, "+254");
            MobileKin = kinTrimer.ToString();

            string   memberGrp   = ddlCustGrp.SelectedItem.Text;
            string   fname       = txtfNname.Text.Trim();
            string   mname       = txtMname.Text.Trim();
            string   lname       = txtLname.Text.Trim();
            string   boxoffice   = txtAddress.Text.Trim();
            string   residence   = txtResidence.Text.Trim();
            string   pocode      = ddlPostal.SelectedItem.Text;
            string   town        = txtTown.Text.Trim();
            string   email       = txtEmail.Text.Trim();
            string   idno        = txtIDNo.Text.Trim();
            string   dateofbirth = DooooB.Text.Trim();
            DateTime dtoB        = Convert.ToDateTime(dateofbirth);
            string   branchcode  = ddlBankCode.SelectedItem.Text;
            string   branchname  = txtBranchName.Text.Trim();
            string   kinname     = kinfullNames.Text.Trim();
            string   rel         = ddlrlnshipTypes.SelectedItem.Text;
            string   kinID       = txtKinIDNO.Text.Trim();
            string   kinAdd      = txtKinAddress.Text.Trim();
            string   empname     = ddlEmpName.SelectedItem.Text.Trim();
            string   banlACNo    = txtACNo.Text.Trim();


            if (string.IsNullOrEmpty(fname) || string.IsNullOrEmpty(lname) || string.IsNullOrEmpty(MobileString) ||
                string.IsNullOrEmpty(email) || string.IsNullOrEmpty(idno) || string.IsNullOrEmpty(dateofbirth) || string.IsNullOrEmpty(branchcode) ||
                string.IsNullOrEmpty(branchname) || string.IsNullOrEmpty(kinname) || string.IsNullOrEmpty(kinAdd) || string.IsNullOrEmpty(banlACNo))
            {
                lblError.Text = "Please fill all the empty required fields!";
                return;
            }
            else
            {
                try
                {
                    var     credentials = new NetworkCredential(ConfigurationManager.AppSettings["W_USER"], ConfigurationManager.AppSettings["W_PWD"], ConfigurationManager.AppSettings["DOMAIN"]);
                    Portals sup         = new Portals();
                    sup.Credentials     = credentials;
                    sup.PreAuthenticate = true;
                    sup.FnMemberApply(fname, mname, lname, boxoffice, residence, pocode, town, MobileString,
                                      email, idno, branchcode, branchname, banlACNo, gen, marstat, acCategory, apType,
                                      memberGrp, empname, dtoB);
                    sup.FnRegisterKin(kinname, rel, kinID, MobileKin, kinAdd, idno);
                    SACCOFactory.ShowAlert("Your data succcessfully saved");
                    Response.Redirect("MemberRegistration");
                }
                catch (Exception ex) {
                    lblError.Text = ex.Message;
                    return;
                }
            }
        }