Exemplo n.º 1
0
    public void getCertificateData()
    {
        try
        {
            ConvertNumberToWords   CNTW    = new ConvertNumberToWords();
            IncomeCertificate      ICdal   = new IncomeCertificate();
            IncomeCertificateModel ICModel = new IncomeCertificateModel();
            ICModel.UID      = Convert.ToInt64(Session["UID"]);
            ICModel.DateFrom = Convert.ToDateTime(txtdatefrom.Text);
            ICModel.DateTo   = Convert.ToDateTime(txtdateto.Text);
            DataSet ds = ICdal.getICD(ICModel);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Label1.Text = DateTime.Now.ToShortDateString();
                DataSet sdDS = (DataSet)(ViewState["StudentDetail"]);
                DataRow sddr = sdDS.Tables[0].Rows[0];
                DataRow dr   = ds.Tables[0].Rows[0];
                if (string.IsNullOrEmpty(dr["total"].ToString()))
                {
                    lblError.Visible = true;
                    // lblMessage.Visible = false;
                    lblError.Text = "No Fee paid from " + txtdatefrom.Text + " To " + txtdateto.Text;
                    //lblError.Text = "No Fee paid from " + DateFrom.SelectedDate.ToShortDateString() + " To " + DateTo.SelectedDate.ToShortDateString();
                }
                else
                {
                    Label3.Text = sddr["StudentName"].ToString();    //students Name
                    Label2.Text = sddr["FathersName"].ToString();    //Fathers Name
                    Label4.Text = sddr["PresentAddress"].ToString(); //R/o
                    Label5.Text = sddr["ClassName"].ToString();;     //Class name
                    Label6.Text = sddr["SectionName"].ToString();;   //Class name
                                                                     // lblFeeHeads.Text = "tution";//fee Head



                    lbltotalPaid.Text = dr["total"].ToString();
                    string inwords = CNTW.ConvertNumbertoWords(Convert.ToInt64(dr["total"]));
                    lblwords.Text    = inwords;                                                         // Amount in words
                    lblDateFrom.Text = txtdatefrom.Text; /*DateFrom.SelectedDate.ToShortDateString();*/ //from date
                    lblDateTo.Text   = txtdateto.Text; /*DateTo.SelectedDate.ToShortDateString();*/     //to date
                }
            }
            else
            {
                lblError.Visible = true;
                //   lblMessage.Visible = false;
                //lblError.Text = "No Fee paid from " + DateFrom.SelectedDate.ToShortDateString() + " To " + DateTo.SelectedDate.ToShortDateString();
                lblError.Text = "No Fee paid from " + txtdatefrom.Text + " To " + txtdateto.Text;
            }
        }
        catch (Exception ex)
        {
            lblError.Visible = true;
            //lblMessage.Visible = false;
            lblError.Text = ex.ToString();
        }
    }
        public ActionResult Edit([Bind(Include = "IncomeCertificateID,PersonName,RelationName,Address,IncomeAmt,YearOf,OfficeName,PurposeOf,Inquiry,ReportNo,InquiryDate,Place,PrintDate,UserID,RegisterTypeID,WEBstatusID")] IncomeCertificate incomeCertificate)
        {
            ViewBag.RegisterTypeID = incomeCertificate.RegisterTypeID;

            if (ModelState.IsValid)
            {
                db.Entry(incomeCertificate).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index", new { rt = incomeCertificate.RegisterTypeID }));
            }
            ViewBag.WEBstatusID = new SelectList(db.WEBstatus, "WebStatusID", "Status", incomeCertificate.WEBstatusID);
            return(View(incomeCertificate));
        }
        public ActionResult Create([Bind(Include = "IncomeCertificateID,PersonName,RelationName,Address,IncomeAmt,YearOf,OfficeName,PurposeOf,Inquiry,ReportNo,InquiryDate,Place,PrintDate,UserID,RegisterTypeID,WEBstatusID")] IncomeCertificate incomeCertificate)
        {
            if (ModelState.IsValid)
            {
                incomeCertificate.UserID      = User.Identity.GetUserId();
                incomeCertificate.WEBstatusID = 1;
                db.IncomeCertificates.Add(incomeCertificate);
                db.SaveChanges();
                return(RedirectToAction("Index", new { rt = incomeCertificate.RegisterTypeID }));
            }

            ViewBag.RegisterTypeID = new SelectList(db.RegisterTypes, "RegisterTypeID", "RegisterType1", incomeCertificate.RegisterTypeID);
            ViewBag.WEBstatusID    = new SelectList(db.WEBstatus, "WebStatusID", "Status", incomeCertificate.WEBstatusID);
            return(View(incomeCertificate));
        }
        // GET: IncomeCertificates/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IncomeCertificate incomeCertificate = db.IncomeCertificates.Find(id);

            ViewBag.vp = db.Configs.Select(a => a.VP).FirstOrDefault();

            if (incomeCertificate == null)
            {
                return(HttpNotFound());
            }
            return(View(incomeCertificate));
        }
        // GET: IncomeCertificates/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IncomeCertificate incomeCertificate = db.IncomeCertificates.Find(id);

            ViewBag.RegisterTypeID = incomeCertificate.RegisterTypeID;

            if (incomeCertificate == null)
            {
                return(HttpNotFound());
            }
            ViewBag.WEBstatusID = new SelectList(db.WEBstatus, "WebStatusID", "Status", incomeCertificate.WEBstatusID);
            return(View(incomeCertificate));
        }