public bool Post([FromBody] Register1 reg)
        {
            try
            {
                if (string.IsNullOrEmpty(reg.Pp))
                {
                    return(false);
                }

                var output = (from claim in _DatabaseContext.Register1
                              where claim.Pp == reg.Pp
                              select claim.Pp).Count();

                if (output > 0)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 2
0
 public void updatepassword()
 {
     try
     {
         if (password.Value != Cpassword.Value)
         {
             Response.Write("<script>alert('Password and confirm password does not match')</script>");
             return;
         }
         Register1 r    = new Register1();
         int       pid  = Convert.ToInt32(Request.QueryString["pid"].ToString());
         var       data = context.Tbl_VerifyResetPass.Where(p => p.Passverify_ID == pid).FirstOrDefault();
         if (data != null)
         {
             string enPswd = EncryptionHelper.GetSwcSHA1(password.Value);
             r.userid       = Convert.ToInt32(data.user_id);
             r.password     = enPswd;
             r.modifydate   = DateTime.Now;
             r.uniqueid     = data.uniqueidentifier;
             r.passverifyID = data.Passverify_ID;
             DataTable dt = new DataTable();
             dt = r.updatepassword(r);
             ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openalert('Password has been changed successfully','True');", true);
         }
     }
     catch (Exception ex)
     {
         ErrorLog.saveerror(ex);
     }
 }
Esempio n. 3
0
        private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
        {
            /* var member = new Member
             * {
             *   Username = this.Username.Text,
             *   Password = this.Password.Password
             * };*/

            //var register1 = new Register1
            //{
            //    firstName = this.FirstName.Text,
            //    lastName = this.LastName.Text,
            //    avatar = this.Avatar.Text,
            //    phone = this.Phone.Text,
            //    address = this.Address.Text,
            //    introduction = this.Introduction.Text,
            //    gender = Int32.Parse(this.Gender.Text),
            //    birhtday = this.Birthday.Text,
            //    password = this.Password.Password

            //};

            var member = new Register1
            {
                firstName    = "Nhat",
                password     = "******",
                lastName     = "Nguyen",
                address      = "Cau Dien",
                avatar       = "https://i.ytimg.com/vi/Za0iUFKxzBc/maxresdefault.jpg",
                birhtday     = "2018-12-30",
                email        = "*****@*****.**",
                gender       = 1,
                introduction = "Hllo T1807E",
                phone        = "01234567",
            };

            // validate phía client.
            Debug.WriteLine(JsonConvert.SerializeObject(member));
            var httpClient = new HttpClient();
            //httpClient.DefaultRequestHeaders.Add("Authorization", "Basic " + token);
            HttpContent content = new StringContent(JsonConvert.SerializeObject(member), Encoding.UTF8,
                                                    "application/json");
            Task <HttpResponseMessage> httpRequestMessage = httpClient.PostAsync(ApiUrl, content);
            String responseContent = httpClient.PostAsync(ApiUrl, content).Result.Content.ReadAsStringAsync().Result;

            Debug.WriteLine("Response: " + responseContent);

            Member resMember = JsonConvert.DeserializeObject <Member>(responseContent);
            // Debug.WriteLine(resMember.email);
        }
Esempio n. 4
0
        /// <summary>
        /// All The Methods That are used in coding
        /// </summary>

        #region Methods
        public void activeuser()
        {
            try
            {
                int       userid   = Convert.ToInt32(Request.QueryString["userid"].ToString());
                string    uniqueid = Request.QueryString["uniqueid"].ToString();
                Register1 r        = new Register1();
                r.userid   = userid;
                r.uniqueid = uniqueid;
                r.activeuser(r);
                lblusername.Text = r.first_name.ToString() + " " + r.last_name.ToString();
            }
            catch (Exception ex)
            {
                ErrorLog.saveerror(ex);
            }
        }
        //There must also be an Admin view for a site administrator.This page must:

        //GET: Admin
        public ActionResult Index()
        {
            using (InsuranceQuoteEntities2 db = new InsuranceQuoteEntities2())
            {
                var dbquotes  = db.Register1.ToList();
                var QuoteList = new List <Register1>();
                foreach (var q in dbquotes) //Show all quotes issued
                {
                    var quotes = new Register1();
                    quotes.FirstName    = q.FirstName;    //along with the user's first name
                    quotes.LastName     = q.LastName;     //last name
                    quotes.EmailAddress = q.EmailAddress; //and email address.
                    QuoteList.Add(quotes);
                }

                return(View(QuoteList));
            }
        }
Esempio n. 6
0
 public void ClearEntry()
 {
     if (Register2.Status == RegisterStatus.Set)
     {
         Register2.Clear();
         return;
     }
     if (Operator.IsSet)
     {
         Operator.Clear();
         return;
     }
     if (Register1.Status == RegisterStatus.Set)
     {
         Register1.Clear();
         return;
     }
 }
Esempio n. 7
0
        public void Register()
        {
            try
            {
                if (validationss())
                {
                    Guid      uniqueid = Guid.NewGuid();
                    Register1 r        = new Register1();
                    r.first_name     = txtfirstname.Value;
                    r.last_name      = txtlastname.Value;
                    r.country_id     = Int32.Parse(ddlcountry.SelectedValue);
                    r.company_name   = txtcompanyname.Value;
                    r.owner_emailid  = email.Value;
                    r.owner_mobileno = txtmobile.Value;

                    string enPswd = GetSwcSHA1(password.Value);

                    r.password     = enPswd;
                    r.pincode      = txtzip.Value;
                    r.created_by   = txtfirstname.Value;
                    r.created_date = DateTime.Now;
                    r.start_date   = startdate.Value;
                    r.end_date     = enddate.Value;
                    r.uniqueid     = uniqueid.ToString();
                    r.IsVerified   = false;
                    r.Ref_Mobile   = txtRefMobNum.Value;

                    //context.sp_Register(company_name,)
                    DataTable dt = new DataTable();
                    dt = r.Insert(r);
                    Session["userdetails"] = dt;
                    //SendMail();
                    Session["regisFlag"] = null;
                    ClientScript.RegisterStartupScript(this.GetType(), "Pop", "openalert('Thank you for signing up please confirm your Mobile No.','True');", true);
                }
            }
            catch (Exception ex)
            {
                ErrorLog.saveerror(ex);
            }
        }
Esempio n. 8
0
        public bool Post([FromBody] Register1 reg)
        {
            try
            {
                var output = (from claims in _DatabaseContext.Register1
                              where claims.Pp == reg.Pp
                              select claims.Pp).Count();

                if (output > 0)
                {
                    return(false);
                }
                else
                {
                    _DatabaseContext.Add(reg);
                    _DatabaseContext.SaveChanges();
                    return(true);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
        public static string insertrecord(Register1 Register)
        {
            try
            {
                SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["conn"].ConnectionString);

                string fullname    = Register.FirstName + " " + Register.LastName;
                string NomineeName = Register.NomineeFirst + " " + Register.NomineeLastName;

                SqlCommand cmd = new SqlCommand("dbo.SP_InsertMember", con);
                cmd.CommandType = CommandType.StoredProcedure;
                //cmd.Parameters.AddWithValue("@PinCode", Register.EnterPin);
                //cmd.Parameters.AddWithValue("@Pin", Register.EnterPin); ;
                cmd.Parameters.AddWithValue("@SponsorID", Register.sponserid);
                cmd.Parameters.AddWithValue("@ParentID", Register.sponserid);
                //cmd.Parameters.AddWithValue("@ConnectingSide", Register.Position);
                cmd.Parameters.AddWithValue("@LoginPassword", Register.LoginPassword);
                cmd.Parameters.AddWithValue("@TransectionPassword", Register.LoginPassword);
                cmd.Parameters.AddWithValue("@LoginName", "NA");
                cmd.Parameters.AddWithValue("@UserName", fullname);
                cmd.Parameters.AddWithValue("@Status", Register.FatherHusband);
                cmd.Parameters.AddWithValue("@DOB", Register.DateofBirth);
                cmd.Parameters.AddWithValue("@Address", Register.Address);
                cmd.Parameters.AddWithValue("@State", Register.State);
                cmd.Parameters.AddWithValue("@City", Register.city);
                cmd.Parameters.AddWithValue("@Country", Register.Country);
                cmd.Parameters.AddWithValue("@District", Register.District);
                cmd.Parameters.AddWithValue("@PostalCode", Register.PinCode);
                cmd.Parameters.AddWithValue("@MobileNo", Register.MobileNo);
                cmd.Parameters.AddWithValue("@TelephoneNo", "");
                cmd.Parameters.AddWithValue("@EMail", Register.EmailID);
                cmd.Parameters.AddWithValue("@BankName", Register.BankName);
                cmd.Parameters.AddWithValue("@AccountNo", Register.AccountNo);
                cmd.Parameters.AddWithValue("@IFSCCode", Register.IFSCode);
                cmd.Parameters.AddWithValue("@NomineeName", "");
                cmd.Parameters.AddWithValue("@NomineeRelation", "");
                cmd.Parameters.AddWithValue("@NomineeFatherName", "");
                cmd.Parameters.AddWithValue("@NomineeContact", "");
                cmd.Parameters.AddWithValue("@PanNo", Register.PANNo);
                cmd.Parameters.AddWithValue("@AadharCard", Register.AadharCard);
                //cmd.Parameters.AddWithValue("@PinAmount", pinamonut);

                con.Open();
                string result = cmd.ExecuteScalar().ToString();

                con.Close();


                //Gen obj = new Gen();

                //string Msg = "Dear " + fullname + ", Congratulation! Your MemberId is: " + result + " Password is: " + Register.LoginPassword + " Please logon to " + System.Configuration.ConfigurationManager.AppSettings["URL"].ToString() + "";

                //if (!string.IsNullOrEmpty(Register.MobileNo) && Register.MobileNo.Trim().Length > 9)
                //{
                //    try
                //    {
                //        obj.SendNormalSMS(System.Configuration.ConfigurationManager.AppSettings["SMSSenderID"], Register.MobileNo.Trim(), Msg);
                //    }
                //    catch
                //    { }
                //}


                if (result.Length > 2)
                {
                    Register.MobileNo   = "";
                    Register.PANNo      = "";
                    Register.AadharCard = "";
                    string Msg = "";
                    string url = "https://retail.diwakarretail.com/";
                    Msg = "Dear " + fullname + " <br><br> Congratulations! You are now an associate on " + System.Configuration.ConfigurationManager.AppSettings["CoName"].ToString() + " <br><br> Your User Id is: " + result + "<br> Password is: " + Register.LoginPassword + "<br><br> Please logon to " + url + "";

                    Gen obj = new Gen();
                    System.Net.Mail.MailMessage n      = new System.Net.Mail.MailMessage();
                    System.Net.Mail.SmtpClient  client = new System.Net.Mail.SmtpClient();
                    if (Register.EmailID != "")
                    {
                        n.To.Add(Register.EmailID);
                        n.From           = new MailAddress(System.Configuration.ConfigurationManager.AppSettings["Email"].ToString(), "Diwakar Retails");
                        n.Body           = Msg;
                        n.Subject        = "Congratulations on Joining " + System.Configuration.ConfigurationManager.AppSettings["CoName"].ToString() + " ";
                        n.IsBodyHtml     = true;
                        client.EnableSsl = false;
                        try
                        {
                            client.Send(n);
                        }
                        catch { }
                    }
                }

                return(result);
            }

            catch (Exception ex)
            {
                return("error");
            }
        }
Esempio n. 10
0
        public bool Put(string id, [FromBody] Register1 reg)
        {
            try
            {
                if (string.IsNullOrEmpty(id))
                {
                    return(false);
                }

                if (reg == null)
                {
                    return(false);
                }

                var claimupdate = new Register1
                {
                    Pp          = reg.Pp,
                    Mp          = reg.Mp,
                    Place       = reg.Place,
                    Garza       = reg.Garza,
                    DatePost    = reg.DatePost,
                    Result      = reg.Result,
                    DateAuction = reg.DateAuction,
                    Region      = reg.Region,
                    Player      = reg.Player,
                    Client      = reg.Client,
                    Manager     = reg.Manager,
                    FirstPrice  = reg.FirstPrice,
                    Sum         = reg.Sum,
                    Return      = reg.Return,
                    SumPrize    = reg.SumPrize,
                    Percent     = reg.Percent,
                    Status      = reg.Status
                };

                var db = _DatabaseContext;
                db.Register1.Attach(claimupdate);
                //db.Entry(claimupdate).Property(x => x.Pp).IsModified = true;
                db.Entry(claimupdate).Property(x => x.Mp).IsModified          = true;
                db.Entry(claimupdate).Property(x => x.Place).IsModified       = true;
                db.Entry(claimupdate).Property(x => x.Garza).IsModified       = true;
                db.Entry(claimupdate).Property(x => x.DatePost).IsModified    = true;
                db.Entry(claimupdate).Property(x => x.Result).IsModified      = true;
                db.Entry(claimupdate).Property(x => x.DateAuction).IsModified = true;
                db.Entry(claimupdate).Property(x => x.Region).IsModified      = true;
                db.Entry(claimupdate).Property(x => x.Player).IsModified      = true;
                db.Entry(claimupdate).Property(x => x.Client).IsModified      = true;
                db.Entry(claimupdate).Property(x => x.Manager).IsModified     = true;
                db.Entry(claimupdate).Property(x => x.FirstPrice).IsModified  = true;
                db.Entry(claimupdate).Property(x => x.Sum).IsModified         = true;
                db.Entry(claimupdate).Property(x => x.Return).IsModified      = true;
                db.Entry(claimupdate).Property(x => x.SumPrize).IsModified    = true;
                db.Entry(claimupdate).Property(x => x.Percent).IsModified     = true;
                db.Entry(claimupdate).Property(x => x.Status).IsModified      = true;
                db.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 11
0
        public IEnumerable <string> Def(RegType regType)
        {
            // MOVE D2,D0   Def: D0
            // MOVE (A2)+,D0   Def: D0, A2
            // MOVE (A2)+,A1   Def: A2
            // MOVE (A2)+,(A1)-   Def: A2,A1

            if (Opcode == M68kOpcode.Jsr)
            {
                if (regType == RegType.Data)
                {
                    yield return("D0");

                    yield return("D1");
                }
                if (regType == RegType.Address)
                {
                    yield return("A0");

                    yield return("A1");
                }
            }

            if (Opcode == M68kOpcode.RegDef)
            {
                foreach (var du in DefsUses)
                {
                    if ((du[0] == 'D' && regType == RegType.Data) || (du[0] == 'A' && regType == RegType.Address))
                    {
                        yield return(du);
                    }
                }
            }

            if (Opcode == M68kOpcode.Cmp)
            {
                yield break;
            }

            if (Register2 != null && AddressingMode2 == M68kAddressingMode.Register && Register2.Type == regType)
            {
                yield return(Register2.ToString());
            }

            if (Register1 != null && Register1.Type == regType)
            {
                switch (AddressingMode1)
                {
                case M68kAddressingMode.AddressWithPostIncrement:
                case M68kAddressingMode.AddressWithPostDecrement:
                case M68kAddressingMode.AddressWithPreDecrement:
                case M68kAddressingMode.AddressWithPreIncrement:
                    yield return(Register1.ToString());

                    break;
                }
            }

            if (Register2 != null && Register2.Type == regType)
            {
                switch (AddressingMode2)
                {
                case M68kAddressingMode.AddressWithPostIncrement:
                case M68kAddressingMode.AddressWithPostDecrement:
                case M68kAddressingMode.AddressWithPreDecrement:
                case M68kAddressingMode.AddressWithPreIncrement:
                    yield return(Register2.ToString());

                    break;
                }
            }
        }
Esempio n. 12
0
        public IEnumerable <string> Use(RegType regType)
        {
            if (Opcode == M68kOpcode.RegUse)
            {
                foreach (var du in DefsUses)
                {
                    yield return(du);
                }
            }

            if (Opcode == M68kOpcode.Cmp || Opcode == M68kOpcode.Lsr)
            {
                if (Register1 != null)
                {
                    yield return(Register1.ToString());
                }
                yield return(Register2.ToString());

                yield break;
            }

            if (Register1 != null && Register1.Type == regType)
            {
                yield return(Register1.ToString());
            }

            if ((Opcode == M68kOpcode.Add || Opcode == M68kOpcode.Sub || Opcode == M68kOpcode.Adda) && Register2 != null && Register2.Type == regType)
            {
                yield return(Register2.ToString());
            }

            if (Register2 != null && Register2.Type == regType)
            {
                switch (AddressingMode2)
                {
                case M68kAddressingMode.Address:
                case M68kAddressingMode.AddressWithOffset:
                case M68kAddressingMode.AddressWithPostIncrement:
                case M68kAddressingMode.AddressWithPostDecrement:
                case M68kAddressingMode.AddressWithPreDecrement:
                case M68kAddressingMode.AddressWithPreIncrement:
                    yield return(Register2.ToString());

                    break;
                }
            }

            if (Opcode == M68kOpcode.Rts)
            {
                if (regType == RegType.Data)
                {
                    if (FinalRegister1.HasValue)
                    {
                        yield return("D0");
                    }
                    yield return("D2");

                    yield return("D3");

                    yield return("D4");

                    yield return("D5");

                    yield return("D6");

                    yield return("D7");
                }
                if (regType == RegType.Address)
                {
                    yield return("A2");

                    yield return("A3");

                    yield return("A4");

                    yield return("A5");

                    yield return("A6");
                }
            }
        }
Esempio n. 13
0
        //Use the following rules to calculate a quote:
        public ActionResult Quote(string FirstName, string LastName, string EmailAddress, DateTime Age,
                                  string vYear, string vMake, string vModel, string DUI, string Speeder, string Coverage)
        {
            //try
            // {

            decimal Price  = 50; //Start with a base of $50 / month.
            var     quotes = new List <Register1>();
            var     Q      = new CarInsuranceQuoteApp.Models.Register1();

            Q.FirstName    = FirstName;
            Q.LastName     = LastName;
            Q.EmailAddress = EmailAddress;
            Q.Price        = 50;


            var AgeCheck = DateTime.Now.Year - Age.Year;

            if (AgeCheck < 18) //If the user is under 18, add $100 to the monthly total.
            {
                Price += 100;
            }

            else if (AgeCheck < 25) //If the user is under 25, add $25 to the monthly total.
            {
                Price += 25;
            }

            else if (AgeCheck > 100)
            {
                Price += 25;
            }

            if (Convert.ToInt32(vYear) < 2000) //If the car's year is before 2000, add $25 to the monthly total.
            {
                Price += 25;
            }

            else if (Convert.ToInt32(vYear) > 2015) //If the car's year is after 2015, add $25 to the monthly total.
            {
                Price += 25;
            }

            else
            {
            }

            var make = vMake.ToUpper();

            if (make == "Porche")     //If the car's Make is a Porsche, add $25 to the Price.
            {
                Price += 25;
            }
            var model = vModel.ToUpper();

            if (make == "Porche" && model == "911 Carrera")     //If the car's Make is a Porsche and its model is a 911 Carrera, add an additional $25 to the Price.
            {
                Price += 25;
            }

            for (int i = 0; i < Convert.ToInt32(Speeder); i++)     //Add $10 to the monthly total for every speeding ticket the user has.
            {
                Price += 10;
            }
            var dui = DUI.ToUpper();

            if (dui == "Yes")     //If the user has ever had a DUI, add 25 % to the total.
            {
                Price = Price + (Price / 4);
            }

            var coverage = Coverage.ToUpper();

            if (coverage == "1")     //If it's full coverage, add 50% to the total.
            {
                Price = Price + (Price / 2);
            }
            Price   = TruncateDecimal(Price, 2);
            Q.Price = Convert.ToDouble(Price);
            quotes.Add(Q);

            using (InsuranceQuoteEntities2 db = new InsuranceQuoteEntities2())
            {
                Q              = new Register1();
                Q.FirstName    = FirstName;
                Q.LastName     = LastName;
                Q.EmailAddress = EmailAddress;

                db.Register1.Add(Q);
                db.SaveChanges();
            }
            return(View(quotes));
            // }
            //catch
            // {
            //return View("Error");
            //}
        }
Esempio n. 14
0
 public void Clear()
 {
     Register1.Clear();
     Register2.Clear();
     Operator.Clear();
 }