Esempio n. 1
0
        public ActionResult Create([Bind(Include = "Uid,FirstName,LastName,PanNumber,MobileNumber,Email, Password,BankName,AccountNumber,IFSC")] Registration registration)
        {
            string pannumber = registration.PanNumber;

            if (registration.Password != Request["cpassword"])
            {
                ViewBag.Message2 = "The password and confirmation password do not match.";
                return(View(registration));
            }
            if (pannumber != null)
            {
                var data = db.PanCardDetails.Where(m => m.PanNumber.Equals(pannumber)).FirstOrDefault();
                if (data == null)
                {
                    ViewBag.Message = "PanCard is Not Exist Try Another One.";
                    return(View(registration));
                }
                if (data.MobileNumber != registration.MobileNumber)
                {
                    ViewBag.Message1 = "Mobile Number Does Not Match With Pan Card!";
                    return(View(registration));
                }
            }
            if (ModelState.IsValid)
            {
                db.Registrations.Add(registration);
                db.SaveChanges();
                return(RedirectToAction("Index", "Login"));
            }

            return(View(registration));
        }
Esempio n. 2
0
 public ActionResult UploadFile(HttpPostedFileBase billfile, [Bind(Include = "MRP,GST,Flag")] GSTINformation gSTINformation)
 {
     if (IsValidExtension(billfile.FileName))
     {
         try
         {
             if (billfile.ContentLength > 0)
             {
                 string _FileName = Path.GetFileName(billfile.FileName);
                 string _path     = Path.Combine(Server.MapPath("~/UploadedFiles"), _FileName);
                 billfile.SaveAs(_path);
                 gSTINformation.Bill = _FileName;
                 gSTINformation.Uid  = Convert.ToInt32(Session["Uid"]);
                 if (ModelState.IsValid)
                 {
                     db.GSTINformations.Add(gSTINformation);
                     db.SaveChanges();
                 }
             }
             ViewBag.Message = "File Uploaded Successfully!!";
             return(View("Gstrate"));
         }
         catch
         {
             ViewBag.Message = "File upload failed!!";
             return(View("Gstrate"));
         }
     }
     else
     {
         ViewBag.Message = "Please upload .jpeg,.png,.gif,.jpg,.bmp image only";
     }
     return(View("Gstrate"));
 }
        public ActionResult Create([Bind(Include = "Tid,Uid,Year,Status,TotalIncome,TotalTax")] TaxInformation taxInformation)
        {
            if (ModelState.IsValid)
            {
                db.TaxInformations.Add(taxInformation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Uid = new SelectList(db.Registrations, "Uid", "FirstName", taxInformation.Uid);
            return(View(taxInformation));
        }
        public ActionResult Create([Bind(Include = "Gnid,Uid,GSTNumber1")] GSTNumber gSTNumber)
        {
            if (ModelState.IsValid)
            {
                db.GSTNumbers.Add(gSTNumber);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Uid = new SelectList(db.Registrations, "Uid", "FirstName", gSTNumber.Uid);
            return(View(gSTNumber));
        }
        public ActionResult ResetPassword(ResetPasswordModel model)
        {
            var message = "";

            if (ModelState.IsValid)
            {
                using (TaxSystemEntities1 dc = new TaxSystemEntities1())
                {
                    var user = dc.AdminInformations.Where(a => a.ResetPasswordCode == model.ResetCode).FirstOrDefault();
                    if (user != null)
                    {
                        user.Password          = model.NewPassword;
                        user.ResetPasswordCode = "";
                        dc.Configuration.ValidateOnSaveEnabled = false;
                        dc.SaveChanges();
                        message = "New password updated successfully";
                    }
                }
            }
            else
            {
                message = "Something invalid";
            }
            ViewBag.Message = message;
            return(View(model));
        }
        public ActionResult ForgotPassword(string EmailID)
        {
            //Verify Email ID
            //Generate Reset password link
            //Send Email
            string message = "";

            using (TaxSystemEntities1 dc = new TaxSystemEntities1())
            {
                var account = dc.AdminInformations.Where(a => a.Email == EmailID).FirstOrDefault();
                if (account != null)
                {
                    //Send email for reset password
                    string resetCode = Guid.NewGuid().ToString();
                    SendVerificationLinkEmail(account.Email, resetCode, "ResetPassword");
                    account.ResetPasswordCode = resetCode;
                    //This line I have added here to avoid confirm password not match issue , as we had added a confirm password property
                    //in our model class in part 1
                    dc.Configuration.ValidateOnSaveEnabled = false;
                    dc.SaveChanges();
                    message = "Reset password link has been sent to your email id.";
                }
                else
                {
                    message = "Account not found";
                }
            }
            ViewBag.Message = message;
            return(View());
        }
        public ActionResult Sendrefund()
        {
            if (Session["Admin"] != null)
            {
                var    Email             = Session["Email"].ToString();
                var    total             = Session["Total"].ToString();
                var    fromEmail         = new MailAddress("*****@*****.**", "TaxBazar");
                var    toEmail           = new MailAddress(Email);
                var    fromEmailPassword = "******";
                string subject           = "Refund Information";
                string body = "Your Refund is credited in your Bank Account.Amount is " + total;
                var    smtp = new SmtpClient
                {
                    Host                  = "smtp.gmail.com",
                    Port                  = 587,
                    EnableSsl             = true,
                    DeliveryMethod        = SmtpDeliveryMethod.Network,
                    UseDefaultCredentials = false,
                    Credentials           = new NetworkCredential(fromEmail.Address, fromEmailPassword)
                };
                using (var message = new MailMessage(fromEmail, toEmail)
                {
                    Subject = subject,
                    Body = body,
                    IsBodyHtml = true
                })
                    smtp.Send(message);
            }
            else
            {
                return(RedirectToAction("Index", "AdminInformations"));
            }

            using (TaxSystemEntities1 db = new TaxSystemEntities1())
            {
                var x     = Session["Email"].ToString();
                var data  = db.Registrations.Where(m => m.Email.Equals(x)).SingleOrDefault();
                var data1 = db.GSTINformations.Where(q => q.Uid.Equals(data.Uid)).ToList();
                foreach (var model in data1)
                {
                    model.Flag = 0;
                }
                db.SaveChanges();
            }


            Session["Email"] = null;
            Session["Total"] = null;
            ViewBag.message  = "SuccessFul";
            return(RedirectToAction("Search", "AdminInformations"));
        }
        public ActionResult Approval()
        {
            if (Session["Admin"] != null)
            {
                var gst             = RandomString(15);
                var uid             = Convert.ToInt32(Request["item.Uid"]);
                var Email           = Request["item.Registration.Email"].ToString();
                var taxInformations = db.GSTNumbers.Where(t => t.Registration.Uid.Equals(uid)).FirstOrDefault();
                taxInformations.GSTNumber1 = gst;
                db.SaveChanges();
                var    fromEmail         = new MailAddress("*****@*****.**", "TaxBazar");
                var    toEmail           = new MailAddress(Email);
                var    fromEmailPassword = "******";
                string subject           = "About GST Number";
                string body = "Your GST Number Request is Approved and Your GST Number is " + gst;
                var    smtp = new SmtpClient
                {
                    Host                  = "smtp.gmail.com",
                    Port                  = 587,
                    EnableSsl             = true,
                    DeliveryMethod        = SmtpDeliveryMethod.Network,
                    UseDefaultCredentials = false,
                    Credentials           = new NetworkCredential(fromEmail.Address, fromEmailPassword)
                };
                using (var message = new MailMessage(fromEmail, toEmail)
                {
                    Subject = subject,
                    Body = body,
                    IsBodyHtml = true
                })
                    smtp.Send(message);

                return(RedirectToAction("Approve", "AdminInformations"));
            }
            else
            {
                return(RedirectToAction("Index", "AdminInformations"));
            }
        }
Esempio n. 9
0
        public ActionResult ComputeTax(TaxInformation taxinfo)
        {
            string year = Request["year"].ToString();
            string tptext = Request["tptext"].ToString();
            string stext = Request["statustext"].ToString();
            string status = tptext + " || " + stext;
            int    taxpayer = Convert.ToInt32(Request["taxpayer"].ToString());
            int    statusnum = Convert.ToInt32(Request["status"].ToString());
            int    taxableincome = Convert.ToInt32(Request["taxableincome"].ToString());
            int    arincometax = 0, surcharge = 0, educationcess = 0, totaltax = 0;

            if (taxpayer <= 1)
            {
                if (statusnum <= 1)
                {
                    if (taxableincome <= 250000)
                    {
                        arincometax   = 0;
                        surcharge     = 0;
                        educationcess = 0;
                        totaltax      = 0;
                    }
                    else if (taxableincome <= 500000)
                    {
                        arincometax = (taxableincome - 250000) * 5 / 100;
                        if (taxableincome <= 350000)
                        {
                            if (arincometax <= 2500)
                            {
                                arincometax = 0;
                            }
                            else
                            {
                                arincometax = arincometax - 2500;
                            }
                        }
                        surcharge = 0;
                    }
                    else if (taxableincome <= 1000000)
                    {
                        arincometax = 12500 + (taxableincome - 500000) * 20 / 100;
                        surcharge   = 0;
                    }
                    else
                    {
                        arincometax = 112500 + (taxableincome - 1000000) * 30 / 100;
                        if (taxableincome <= 10000000 && taxableincome > 5000000)
                        {
                            surcharge = arincometax / 10;
                        }
                        else
                        {
                            surcharge = arincometax * 15 / 100;
                        }
                    }
                    educationcess = arincometax * 4 / 100;
                    totaltax      = arincometax + surcharge + educationcess;
                }
                else if (statusnum == 2)
                {
                    if (taxableincome <= 300000)
                    {
                        arincometax   = 0;
                        surcharge     = 0;
                        educationcess = 0;
                        totaltax      = 0;
                    }
                    else if (taxableincome <= 500000)
                    {
                        arincometax = (taxableincome - 300000) * 5 / 100;
                        if (taxableincome <= 350000)
                        {
                            if (arincometax <= 2500)
                            {
                                arincometax = 0;
                            }
                            else
                            {
                                arincometax = arincometax - 2500;
                            }
                        }
                        surcharge = 0;
                    }
                    else if (taxableincome <= 1000000)
                    {
                        arincometax = 10000 + (taxableincome - 500000) * 20 / 100;
                        surcharge   = 0;
                    }
                    else
                    {
                        arincometax = 110000 + (taxableincome - 1000000) * 30 / 100;
                        if (taxableincome <= 10000000 && taxableincome > 5000000)
                        {
                            surcharge = arincometax / 10;
                        }
                        else
                        {
                            surcharge = arincometax * 15 / 100;
                        }
                    }
                    educationcess = arincometax * 4 / 100;
                    totaltax      = arincometax + surcharge + educationcess;
                }
                else
                {
                    if (taxableincome <= 500000)
                    {
                        arincometax   = 0;
                        surcharge     = 0;
                        educationcess = 0;
                        totaltax      = 0;
                    }
                    else if (taxableincome <= 1000000)
                    {
                        arincometax = (taxableincome - 500000) * 20 / 100;
                        surcharge   = 0;
                    }
                    else
                    {
                        arincometax = 100000 + (taxableincome - 1000000) * 30 / 100;
                        if (taxableincome <= 10000000 && taxableincome > 5000000)
                        {
                            surcharge = arincometax / 10;
                        }
                        else
                        {
                            surcharge = arincometax * 15 / 100;
                        }
                    }
                    educationcess = arincometax * 4 / 100;
                    totaltax      = arincometax + surcharge + educationcess;
                }
            }
            else
            {
                if (taxableincome <= 10000)
                {
                    arincometax = (taxableincome - 0) * 10 / 100;
                    surcharge   = 0;
                }
                else if (taxableincome <= 20000)
                {
                    arincometax = (taxableincome - 10000) * 20 / 100;
                    surcharge   = 0;
                }
                else
                {
                    arincometax = (taxableincome - 20000) * 30 / 100;
                    surcharge   = 0;
                }
                educationcess = arincometax * 4 / 100;
                totaltax      = arincometax + surcharge + educationcess;
            }
            if (totaltax <= 250000)
            {
                using (TaxSystemEntities1 db = new TaxSystemEntities1())
                {
                    if (ModelState.IsValid)
                    {
                        taxinfo.TotalIncome = taxableincome;
                        taxinfo.Status      = status;
                        taxinfo.TotalTax    = totaltax;
                        taxinfo.Year        = year;
                        taxinfo.Uid         = Convert.ToInt32(Session["Uid"]);
                        db.TaxInformations.Add(taxinfo);
                        db.SaveChanges();
                    }
                }
            }
            ViewBag.arincometax   = arincometax;
            ViewBag.taxableincome = taxableincome;
            ViewBag.surcharge     = surcharge;
            ViewBag.educationcess = educationcess;
            ViewBag.totaltax      = totaltax;
            ModelState.Clear();
            return(View("Index"));
        }