Ejemplo n.º 1
0
        public ActionResult duesList(repDues_Statement rep)
        {
            repDues_listMain dues = new repDues_listMain();

            dues.pdfDues_list(rep.section_id, rep.amount, rep.operation, rep.class_id, rep.session, rep.month_name);


            DDsession_name();

            return(View());
        }
Ejemplo n.º 2
0
        public ActionResult duesListTransportWise(reptransportList_DuesList list)
        {
            repDues_listMain dues = new repDues_listMain();

            List <int> pick_id = new List <int>();

            foreach (var i in list.pickup)
            {
                pick_id.Add(i);
            }

            dues.pdfDues_listTransportWise(pick_id, list.amount, list.operation);

            DDPickup_point_withoutWholeTransport(list);
            return(View(list));
        }
Ejemplo n.º 3
0
        public ActionResult duesListNotice_students(int class_id, int section_id, decimal amount, string operation, string month_name, string payment_by, string message, string session, int font_size)
        {
            if (payment_by == null)
            {
                ModelState.AddModelError(String.Empty, "Due Date is mandatory.");
            }

            repDues_listMain           dues = new repDues_listMain();
            IEnumerable <repDues_list> result;

            result = dues.duesList_Notice(class_id, section_id, amount, operation, month_name, session);
            foreach (var i in result)
            {
                i.month_name = month_name;
                i.payment_by = DateTime.Parse(payment_by);
                i.message    = message;
                i.font_size  = font_size;
            }
            return(View(result));
        }
Ejemplo n.º 4
0
        public async System.Threading.Tasks.Task <ActionResult> duesListNotice_students(IEnumerable <repDues_list> list)
        {
            using (MySqlConnection con = new MySqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ToString()))
            {
                repDues_listMain    dues   = new repDues_listMain();
                List <repDues_list> result = new List <repDues_list>();

                bool flag = false;

                int font_size = 8;

                foreach (repDues_list li in list)
                {
                    if (li.check)
                    {
                        result.Add(new repDues_list {
                            sr_number = li.sr_number, amount = li.amount, month_name = li.month_name, std_father_name = li.std_father_name, name = li.name, payment_by = li.payment_by, message = li.message
                        });
                        if (li.flag_sms)
                        {
                            flag = true;
                        }
                        else
                        {
                            flag = false;
                        }
                    }

                    if (li.font_size != 0)
                    {
                        font_size = li.font_size;
                    }
                }
                SMSMessage sms = new SMSMessage();
#if !DEBUG
                sms.setRecentSMS(result.FirstOrDefault().message, 15, "fees_notice");
                if (flag)
                {
                    foreach (var std in result)
                    {
                        string contact = @"SELECT 
                                        COALESCE(std_contact, std_contact1, std_contact2)
                                    FROM
                                        sr_register
                                    WHERE
                                        sr_number = @sr_number
                                            AND std_active = 'Y'";
                        string number  = con.Query <string>(contact, new { sr_number = std.sr_number }).SingleOrDefault();


                        string body = std.message.Replace("#father_name#", std.std_father_name);

                        body = body.Replace("#amount#", std.amount.ToString());

                        body = body.Replace("#month_name#", std.month_name);

                        body = body.Replace("#std_name#", std.name);

                        body = body.Replace("#date#", std.payment_by.ToString("dd/MM/yyyy"));

                        await sms.SendSMS(body, number, true);
                    }
                    return(View("success"));
                }
#endif

                repDues_listMain ll = new repDues_listMain();

                ll.pdfDuesList_notice(result, font_size);


                string msg = "";

                foreach (var i in result)
                {
                    msg = i.message;

                    break;
                }

                sms.setRecentSMS(msg, 15, "fees_notice");

                return(View(list));
            }
        }