public async Task <ActionResult> Edit([Bind(Include = "Gid,Date,ApplicationNo,AccountNo,BankName,Amount,Status,Fundstatus,CreatedBy,Files,Certificate,Username,Password,SecurityQuestion,Answer,Caq,CaqUser,CaqPassword,EmailId,EmailPassword,ArrimaUser,ArrimaPassword")] GIC gIC, HttpPostedFileBase file, HttpPostedFileBase thumb, HttpPostedFileBase Caq, Helper help)
        {
            if (ModelState.IsValid)
            {
                using (var transaction = db.Database.BeginTransaction())
                {
                    try
                    {
                        if (file == null || thumb == null || Caq == null)
                        {
                            gIC.Files = file != null?help.uploadfile(file) : img;

                            gIC.Certificate = thumb != null?help.uploadfile(thumb) : img;

                            gIC.Caq = Caq != null?help.uploadfile(Caq) : ca;

                            db.Entry(gIC).State = EntityState.Modified;
                            await db.SaveChangesAsync();

                            Application app = db.Applications.FirstOrDefault(x => x.ApplicationNo == gIC.ApplicationNo);
                            TempData["Success"] = "Gic Account Updated Successfully";
                            transaction.Commit();
                            return(RedirectToAction("Create", "Application", new { id = app.InquiryId }));
                        }
                        else if (file.ContentType == "application/pdf")
                        {
                            gIC.Files = file != null?help.uploadfile(file) : img;

                            gIC.Certificate = thumb != null?help.uploadfile(thumb) : img;

                            gIC.Caq = Caq != null?help.uploadfile(Caq) : ca;

                            db.Entry(gIC).State = EntityState.Modified;
                            await db.SaveChangesAsync();

                            Application app = db.Applications.FirstOrDefault(x => x.ApplicationNo == gIC.ApplicationNo);
                            TempData["Success"] = "Gic Account Updated Successfully";
                            transaction.Commit();
                            return(RedirectToAction("Create", "Application", new { id = app.InquiryId }));
                        }
                        else
                        {
                            TempData["danger"] = "upload only pdf file";
                            transaction.Commit();
                            return(RedirectToAction("Edit", "Gics", new { id = gIC.Gid }));
                        }
                    }
                    catch (Exception)
                    {
                        transaction.Rollback();
                        Application app = db.Applications.FirstOrDefault(x => x.ApplicationNo == gIC.ApplicationNo);
                        TempData["danger"] = "Sorry Gic Update Failed";
                        return(RedirectToAction("Create", "Application", new { id = app.InquiryId }));

                        throw;
                    }
                }
            }
            return(View(gIC));
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            GIC gIC = await db.Gic.FindAsync(id);

            db.Gic.Remove(gIC);
            await db.SaveChangesAsync();

            return(RedirectToAction("Dashboard", "Processing", new { id = gIC.ApplicationNo }));
        }
 public CortexAGenericTimer(Machine machine, GIC gic, ulong genericTimerCompareValue)
 {
     var receiver = gic.GetLocalReceiver(0);
     irq = new GPIO();
     irq.Connect(receiver, 0x01);
     physicalTimer1 = new CortexAGenericTimerUnit(machine, irq, genericTimerCompareValue);
     physicalTimer2 = new CortexAGenericTimerUnit(machine, irq, genericTimerCompareValue);
     virtualTimer = new CortexAGenericTimerUnit(machine, irq, genericTimerCompareValue, enabled: true);
 }
        //   [Authorize(Roles ="Processing")]
        public ActionResult Gic([Bind(Include = "Date,AccountNo,ApplicationNo,BankName,Status,CreatedBy,Amount,Sms,Email,Show")] GIC gic, Helper help, int application)
        {
            using (var transaction = db.Database.BeginTransaction())
            {
                gic.ApplicationNo = application;
                var inquiryid = db.Applications.FirstOrDefault(x => x.ApplicationNo == gic.ApplicationNo).InquiryId;
                try
                {
                    GIC gg = db.Gic.FirstOrDefault(x => x.ApplicationNo == gic.ApplicationNo);
                    if (gg == null)
                    {
                        online onlines = db.onlines.FirstOrDefault(x => x.inquiryid == inquiryid);
                        gic.Date      = System.DateTime.Now;
                        gic.Status    = true;
                        gic.CreatedBy = help.Teacher();
                        db.Gic.Add(gic);
                        db.SaveChanges();
                        Process pr = db.Process.FirstOrDefault(x => x.ApplicationNo == gic.ApplicationNo);
                        if (pr.Gic == false)
                        {
                            var Process = db.Process.SingleOrDefault(x => x.ApplicationNo == gic.ApplicationNo);
                            if (Process != null)
                            {
                                Process.Gic = true;

                                db.SaveChanges();
                            }
                        }

                        transaction.Commit();
                        if (gic.Sms == true)
                        {
                            help.sendsms(onlines.Mobile, "Hello," + onlines.Name + " your Gic Account Has Open Sucessfully ");
                        }
                        // return Json(gic, JsonRequestBehavior.AllowGet);
                        TempData["Success"] = "Your Gic Account Add Successfully";
                        return(RedirectToAction("Create", "Application", new { id = inquiryid }));
                    }
                    else
                    {
                        TempData["danger"] = "Sorry Gic Already Add";
                        //  return Json(gic, JsonRequestBehavior.AllowGet);
                        return(RedirectToAction("Create", "Application", new { id = inquiryid }));
                    }
                }
                catch (Exception e)
                {
                    string a = e.Message;
                    transaction.Rollback();

                    throw;
                    //  return View();
                }
            }
        }
        public async Task <ActionResult> Create([Bind(Include = "Gid,Date,ApplicationNo,AccountNo,BankName,Amount,Status,Fundstatus,CreatedBy")] GIC gIC)
        {
            if (ModelState.IsValid)
            {
                db.Gic.Add(gIC);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(gIC));
        }
        // GET: GICs/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GIC gIC = await db.Gic.FindAsync(id);

            if (gIC == null)
            {
                return(HttpNotFound());
            }
            return(View(gIC));
        }
        // GET: GICs/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GIC gIC = await db.Gic.FindAsync(id);

            img = gIC.Files;
            thm = gIC.Certificate;
            ca  = gIC.Caq;
            if (gIC == null)
            {
                return(HttpNotFound());
            }
            return(View(gIC));
        }
示例#8
0
    private static void Main(string[] args)
    {
        var sw = Stopwatch.StartNew();
        //cronometram cat a durat toata sandramaua

        /*
         * GIC gram = new LR1.Utils.GIC(new List<string>{ "a", "b" },
         *  new List<string> {"S"}, "S", new List<Regula> { new Regula("S","aSbS"), new Regula("S",Constants.Lambda) });
         *  //First(S) imi da 'a'   - E OK!
         */
        /*GIC gram = new LR1.Utils.GIC(new List<string> { "a", "b" },
         * new List<string> { "S" }, "S", new List<Regula> { new Regula("S", "SbS"), new Regula("S", "a"), new Regula("S", Constants.Lambda) });
         *  //First(S) imi da 'a' si 'b'  - E OK!
         *
         */

        GIC gram = new LR1.Utils.GIC(new List <string> {
            "a", "b", "c", "d"
        },
                                     new List <string> {
            "S", "A"
        }, "S",
                                     new List <Regula> {
            new Regula("S", "SbS"),
            new Regula("S", "a"),
            new Regula("S", Constants.Lambda),
            new Regula("S", "A"),
            new Regula("A", "Sc")
        });


        GIC extinsa = GIC.extinde(gram);



        Parser lr1Parser = new Parser(extinsa);


        Console.WriteLine(sw.ElapsedMilliseconds);

        List <string> firstA = lr1Parser.getFirst("A");
    }
 public CortexA7(Machine machine, GIC gic, ulong genericTimerCompareValue, Endianess endianness = Endianess.LittleEndian) : base("cortex-a15", machine, endianness)
 {
     genericTimer = new CortexAGenericTimer(machine, gic, genericTimerCompareValue);
 }