コード例 #1
0
        public rptFeesReceipt(string receiptNo, string userId)
        {
            InitializeComponent();
            xrPicheader.ImageUrl = "~/pictures/letter_head.jpg";

            string curency = new InstanceConfigServices().GetConfig("moneyCurency");

            xrPowered.Text = "powered by : " + new InstanceConfigServices().GetConfig("developedBy") + " :: " + new InstanceConfigServices().GetConfig("developerWeb");

            FeesPayment fp = new FeesPaymentService().GetFeesPayment(receiptNo);

            xrStudID.Text    = fp.xIndexNo.ToString();
            xrStudName.Text  = fp.xFullName;
            xrPayDate.Text   = fp.DateCreated.Date.ToString();
            xrChequeNo.Text  = fp.ChequeNo;
            xrPayMode.Text   = fp.PayType.ToString();
            xrCashier.Text   = fp.xCashier;
            xrPaidBy.Text    = fp.PaidBy;
            xrReceiptNo.Text = fp.ReceiptNo;
            xrTerm.Text      = fp.xCourse + " " + fp.xTerm;
            xrAcademic.Text  = fp.xAcademic;
            xrAmtPaid.Text   = curency + " " + fp.Payvalue.ToString();



            StudentFees sf = new StudentFeesService().GetStudentFeesAccounts(fp.StuduserId, fp.BatchId, userId);

            xrTotalFees.Text     = curency + " " + sf.xFeevalue.ToString();
            xrTotalPayments.Text = curency + " " + sf.xPayments.ToString();
            xrFessBalance.Text   = curency + " " + sf.xFeesLeft.ToString();
        }
コード例 #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string        studReg     = "";
            string        studLessons = "";
            List <object> studUserIds = gvStudents.GetSelectedFieldValues("UserId");
            string        regState    = new InstanceConfigServices().GetConfig("lessonsRegistration");

            if (studUserIds.Count > 0)
            {
                if (cmbProgram.Value != null)
                {
                    List <Lesson> allLessons = new LessonService().GetAllLessonsByClassID(int.Parse(cmbProgram.GridView.GetRowValues(cmbProgram.GridView.FocusedRowIndex, "ID").ToString()), new SessionManager().GetUserId(Session));

                    if (allLessons.Count > 0)
                    {
                        foreach (object studUserId in studUserIds)
                        {
                            studReg += "('" + cmbProgram.GridView.GetRowValues(cmbProgram.GridView.FocusedRowIndex, "ID").ToString() + "','" + cmbProgram.GridView.GetRowValues(cmbProgram.GridView.FocusedRowIndex, "Bgroup").ToString() + "','" + studUserId + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'),";
                            if (regState == "Administration")
                            {
                                foreach (Lesson allLesson in allLessons)
                                {
                                    studLessons += "('" + studUserId + "','" + cmbProgram.GridView.GetRowValues(cmbProgram.GridView.FocusedRowIndex, "ID").ToString() + "','" + cmbProgram.GridView.GetRowValues(cmbProgram.GridView.FocusedRowIndex, "Bgroup").ToString() + "','" + allLesson.ID + "','" + allLesson.ClassID + "','" + allLesson.ModuleID + "','" + 0 + "','" + 0 + "','" + " " + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'),";
                                }
                            }
                        }

                        if (new StudentRegistrationService().AddStudentRegistrationList(studReg.TrimEnd(','), new SessionManager().GetUserId(Session)))
                        {
                            if (regState == "Administration")
                            {
                                new StudentLessonsRegistrationService().AddStudentLessonsRegistrationList(studLessons.TrimEnd(','), new SessionManager().GetUserId(Session));
                            }
                            ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.success('Saved Successfully','Message')", true);
                            clearfields();
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.error('Saving Failed','Message')", true);
                        }
                    }
                    else
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.info('There are no lessons/courses associated with this batch. ','Message')", true);
                    }
                }
                else
                {
                    cmbProgram.IsValid = false;
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.info('Select at least a student','Message')", true);
            }
            loadRegStudents();
            uPanel.Update();
        }