Esempio n. 1
0
        private void GetStudentDetails()
        {
            ImageConvertor objImageConvertor = new ImageConvertor();

            if (SelectedStudentNew == null)
            {
                return;
            }
            string studentid  = SelectedStudentNew.StudentID;
            int    student_id = 0;

            int.TryParse(studentid, out student_id);
            string sql = "exec [SMS].[GetStudentPaymentDetails] '" + this.ID + "'," + student_id + "," + this.Schoolid;

            SearchResult = DAL.Select(sql);
            if (SearchResult != null && SearchResult.Rows.Count > 0)
            {
                string PhotoID = SearchResult.Rows[0]["PhotoID"].ToString();
                if (!string.IsNullOrEmpty(PhotoID))
                {
                    if (File.Exists(PhotoID))
                    {
                        StreamReader sr          = new StreamReader(PhotoID);
                        string       photostring = sr.ReadToEnd();
                        sr.Close();
                        byte[] bytearr = Convert.FromBase64String(photostring);
                        objImageConvertor.ConvertByteArrayToPhot(bytearr);
                    }
                }
                this.ImageSource  = objImageConvertor.ImageSource;
                this.FullName     = SearchResult.Rows[0]["FullName"].ToString();
                this.EnrollmentNo = SearchResult.Rows[0]["EnrollmentNo"].ToString();
                this.ClassRoom    = SearchResult.Rows[0]["Class"].ToString();
                FormFields();
                lstStudentPaymentDetails = new ObservableCollection <StudentPaymentViewModelEntity>();

                foreach (DataRow dr in SearchResult.Rows)
                {
                    StudentPaymentViewModelEntity obj = new StudentPaymentViewModelEntity();
                    obj.ID              = dr["ID"].ToString();
                    obj.EntityID        = dr["EntityID"].ToString();
                    obj.EntityType      = dr["EntityType"].ToString();
                    obj.PaymentType     = dr["PaymentType"].ToString();
                    obj.TransType       = dr["TransType"].ToString();
                    obj.Amount          = dr["Amount"].ToString();
                    obj.Comments        = dr["Comments"].ToString();
                    obj.FullName        = dr["FullName"].ToString();
                    obj.EnrollmentNo    = dr["EnrollmentNo"].ToString();
                    obj.CreatedDateTime = dr["CreatedDateTime"].ToString();
                    obj.AcademicYear    = dr["AcademicYear"].ToString();
                    obj.ModeofPayment   = dr["ModeofPayment"].ToString();
                    //obj.ChequeNo = dr["chequeno"].ToString();
                    //obj.BankBranchDetails = dr["BankBranchDetails"].ToString();
                    lstStudentPaymentDetails.Add(obj);
                }
            }
        }
Esempio n. 2
0
        private bool canGeneratePaymentReciept()
        {
            if (lstStudentPaymentDetails != null)
            {
                StudentPaymentViewModelEntity obj = lstStudentPaymentDetails.FirstOrDefault(x => x.PrintingChecked == true);

                if (obj != null)
                {
                    return(true);
                }
            }
            return(false);
        }