Exemplo n.º 1
0
        public ActionResult FIRPolice(report model)
        {
            firpolouse obj = new firpolouse();


            try
            {
                obj.approvedfir_email     = model.reporter_email;
                obj.approvedfir_police_id = model.police_id;
                obj.approvedfir_mobile    = model.reporter_mobile;
                obj.approvedfir_title     = model.fir_title;
                obj.approved_fir          = model.fir_id.ToString();

                bool   result        = false;
                string email_subject = "Police is Approved your request.";
                string email_message = "<p style='color:red;font-size:50px;font-weight:bold;'><b>The Ploice ID  :</b>" + obj.approvedfir_police_id + ", Who is comming at your address , Please wait on there .<br /><hr/> <b>You F.I.R. For</b>" + obj.approvedfir_title + ",<br /><hr/>  in <b>City:</b>" + obj.approvedfir_mobile + ",<br /><hr/> <b> Email :</b>" + obj.approvedfir_email + ",<br /><hr/> <b> Your Report: </b>" + obj.approved_fir + "<br /><hr/> <b style='color:red;font-size:50px;font-weight:bold;'>Please be on that address</b></p>";

                result = SendEmail(obj.approvedfir_email, email_subject, email_message);


                db.firpolice.Add(obj);
                db.SaveChanges();
            }
            catch (Exception e)
            {
                throw e;
            }



            return(RedirectToAction("Index"));
        }
        public string CreateJsonParameters(List <report> r)
        {
            StringBuilder JsonString = new StringBuilder();
            List <report> products   = r;

            string[] ColumnName = new String[r.Count + 1];
            ColumnName[0] = "\"" + "orderid" + "\":\"";
            ColumnName[1] = "\"" + "pagenum" + "\":\"";
            JsonString.Append("[");
            for (int i = 0; i < r.Count; i++)
            {
                JsonString.Append("{");
                report x = products[i];
                JsonString.Append(ColumnName[0]);
                JsonString.Append(x.Orderid);
                JsonString.Append("\",");
                JsonString.Append(ColumnName[1]);
                JsonString.Append(x.Pagenum);
                JsonString.Append("\"");
                JsonString.Append("},");
            }
            JsonString.Remove(JsonString.Length - 1, 1);
            JsonString.Append("]");
            return(JsonString.ToString());
        }
Exemplo n.º 3
0
        //数据到达事件
        protected void myhid_DataReceived(object sender, report e)
        {
            RecDataBuffer = e.reportBuff;
            string receiveData = new ASCIIEncoding().GetString(RecDataBuffer);

            tbxRece.AppendText(receiveData + "\r\n");
        }
        private void button1_Click(object sender, EventArgs e)
        {
            report rp = new report();

            rp.Show();
            this.Visible = false;
        }
Exemplo n.º 5
0
        public void CheckXml(string ToMoveNoValide)
        {
            //Console.WriteLine("\n");

            foreach (string path in filePath)
            {
                XmlReader reader = XmlReader.Create(path, settings);

                try
                {
                    XmlSerializer       serializer = new XmlSerializer(typeof(report));
                    report              countBox   = (report)serializer.Deserialize(reader);
                    XmlNamespaceManager manager    = new XmlNamespaceManager(reader.NameTable);
                    XmlSchemaValidator  validator  = new XmlSchemaValidator(reader.NameTable, settings.Schemas, manager, XmlSchemaValidationFlags.None);
                    validator.ValidationEventHandler += new ValidationEventHandler(ValidationEventHandler);
                    validator.Initialize();
                }
                catch (Exception ex)
                {
                    reader.Close();
                    move.Move(path, ToMoveNoValide);
                    _log.WriteLog(LogLevel.Error, $"file: [{Path.GetFileName(path)}] \r\n [{ex.InnerException}] | [{ex.Message}] \r\n");
                }
                reader.Close();
                _log.ProcentLog(filePath.Length, ++count);
            }
        }
Exemplo n.º 6
0
        // Expert image view page
        public ActionResult ExpImageView(long?id, int?page, string sortOrder, string currentFilter, string preColumn, string sucMsg)
        {
            int userID = Convert.ToInt32(Session["UserID"] != null ? Session["UserID"].ToString() : "0"); // Convert session user id to integer for comparison and prevent from NULL

            image  img = db.images.Find(id);                                                              // Find images belong to user id in DB
            report rep = (from r in db.reports
                          where r.ImgID == id
                          select r).FirstOrDefault();     // Find reports belong to this image
            comment cmt = (from s in db.comments
                           where s.ImgID == id
                           select s).FirstOrDefault();      // Find comment belong to the image

            var view = new ImgRepCmtViewModels()            // Initialise a view model for passing into view
            {
                Image   = img,
                Report  = rep,
                Comment = cmt
            };

            //string server = db.Database.Connection.DataSource.ToString(); // Get db server name for retrieving image
            //string img_link = "http://" + server + "/" + img.ImgPath;    // Concatenate image URL
            string img_link = "~/" + img.ImgPath;

            ViewBag.link       = img_link;      // Create viewbag variable for image URL
            ViewBag.Page       = page;          // Create viewbag variable for current page
            ViewBag.Order      = sortOrder;     // Create viewbag variable for current sort
            ViewBag.Filter     = currentFilter; // Create viewbag variable for current filter
            ViewBag.PreColumn  = preColumn;     // Create viewbag variable for filtering column
            ViewBag.SuccessMsg = sucMsg;        // Create viewbag variable for comment successful message
            ViewBag.userName   = (from usr in db.users
                                  where (usr.UserID == userID)
                                  select usr.UserFName).FirstOrDefault().ToString();    // Passing user first name to view
            return(View(view));
        }
Exemplo n.º 7
0
        public ActionResult Create(ReportModel rm)
        {
            var fileNameS  = "";
            var rmfileName = "";

            if (Request.Files.Count > 0)
            {
                HttpPostedFileBase fileS = Request.Files[0];
                if (fileS.ContentLength > 0)
                {
                    fileNameS  = Path.GetFileName(fileS.FileName);
                    rmfileName = Path.Combine(
                        Server.MapPath("~/Content/Upload"), fileNameS);
                    fileS.SaveAs(rmfileName);
                }
            }
            report report = new report()
            {
                objet        = rm.objet,
                description  = rm.description,
                fileName     = rmfileName,
                dateCreation = DateTime.Now,
            };

            sr.Add(report);
            sr.Commit();



            return(RedirectToAction("Index"));
        }
Exemplo n.º 8
0
        void usbHID_DataReceived(object sender, EventArgs e)
        {
            report myRP = (report)e;

            if (InvokeRequired)
            {
                Invoke(new EventHandler(usbHID_DataReceived), new object[] { sender, e });
            }
            else
            {
                receivedStr = USBHID.ByteToHexString(myRP.reportBuff).Substring(2, 100);
                //tb_information.Text += "\r\n" + receivedStr;

                receiveddata = HexStringToByteArray(receivedStr);

                //hidDATAProcessThread = new Thread(new ThreadStart(hidDATAProcess));//创建监听线程
                //hidDATAProcessThread.IsBackground = true;//设为后台线程
                //hidDATAProcessThread.Start();//启动监听线程

                if (DataCheckEvent != null) //事件调用
                {                           //如果有对象注册
                  //if (DataCheckEvent(receiveddata, receiveddata.Length))//和校验通过
                  //{
                    DataanalysisEvent(receiveddata, receiveddata.Length);    //数据解析
                    //}
                }
            }
        }
Exemplo n.º 9
0
        // GET: Report/Details/5
        public ActionResult Details(int id)
        {
            report r = new report();

            r = sr.GetReportById(id);
            return(View(r));
        }
Exemplo n.º 10
0
        public ActionResult ExportQR(string Id)
        {
            string s       = "";
            var    product = productService.GetProduct(Id);

            if (product != null)
            {
                string url = HttpContext.Request.Url.GetLeftPart(UriPartial.Authority);
                string p   = Url.Action("Index", "Product", new { Id = product.QRHashCode, Area = String.Empty });

                p = url + p;
                var    imageQR  = SaveImageQR.Instance.createQRCode(p, product.Id.ToString(), Server);
                report reportQR = new report();
                var    uri      = new Uri(product.ImageOne).LocalPath;

                var imageOne = Image.FromFile(Server.MapPath(uri));
                reportQR.create(imageQR, imageOne, product.Name, product.HarvestAt.ToShortDateString());

                string path  = "~/Media/Uploads/FolderPDF";
                bool   exist = System.IO.Directory.Exists(Server.MapPath(path));
                if (!exist)
                {
                    System.IO.Directory.CreateDirectory(Server.MapPath(path));
                }

                reportQR.CreateDocument();
                reportQR.ExportToPdf(Server.MapPath(path) + "\\" + product.QRHashCode + ".pdf");

                s = url + "/Media/Uploads/FolderPDF/" + product.QRHashCode + ".pdf";

                return(Json(new { success = true, message = "Xuất tệp tin thành công", linkScript = s }, JsonRequestBehavior.AllowGet));
            }
            return(Json(new { success = false, message = "Xuất tệp tin thất bại", linkScript = s }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 11
0
        public ActionResult Profil(ReclmationViewModel rvm)
        {
            su = new ServiceUser();
            rs = new ReclamationService();
            report r = new report();

            r.Content = rvm.Content;
            r.subject = rvm.subject;
            r.vu      = 0;
            if (mail != null)
            {
                user u = su.Get(us => us.email == mail);
                r.name       = u.firstName;
                r.lastName   = u.lastName;
                r.insured_id = u.id;

                idU = u.id;
            }
            rs.Add(r);
            rs.Commit();

            su.email(rvm.Email, rvm.pass, rvm.subject, rvm.Content);
            ViewBag.Message = "Your Profile page.";

            return(RedirectToAction("Profil", new
            {
                id = idU
            }));
        }
Exemplo n.º 12
0
        public ActionResult Aboutbutton()
        {
            var MR = new report();
            List <ExciseFreeApply> EF = new List <ExciseFreeApply>
            {
                new ExciseFreeApply {
                    Name          = "1111股份有限公司",
                    ID            = "050",
                    Address       = "台北市",
                    ProdTaxNumber = "123456789012",
                    ProdChName    = "鳳梨",
                    ProdEngName   = "鳳梨",
                    ProcessDate   = Convert.ToDateTime("2018-10-10"),
                    Qty           = 2240,
                    Mode          = "3",
                    TaxUnits      = "KU",
                    SheetNumber   = ""
                }
            };
            string downloadPath = MR.ExciseRpt(EF);

            byte[] fileBytes = System.IO.File.ReadAllBytes(downloadPath);
            string fileName  = Path.GetFileName(downloadPath);

            return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName));
        }
Exemplo n.º 13
0
 public Headline(report reportItem, Headline parentHeadline)
 {
     this.ID              = reportItem.reportID;
     this.HeadlineName    = reportItem.reportName;
     this.ParentHeadline  = parentHeadline;
     this.HeadlineNumbers = GetHeadlineNumbers(this.HeadlineName);
 }
Exemplo n.º 14
0
        // GET api/<controller>
        public List <report> Get(string date)
        {
            report        p        = new report();
            List <report> dishList = p.Read(date);

            return(dishList);
        }
 private void btn_sales_Click(object sender, EventArgs e)
 {
     ll();
     report report = new report();
     report_panel.Show();
     panel4.Controls.Add(report);
 }
Exemplo n.º 16
0
        public ActionResult Edit(int id, ReportModel rm)
        {
            var fileNameS  = "";
            var rmfileName = "";

            if (Request.Files.Count > 0)
            {
                HttpPostedFileBase fileS = Request.Files[0];
                if (fileS.ContentLength > 0)
                {
                    fileNameS  = Path.GetFileName(fileS.FileName);
                    rmfileName = Path.Combine(
                        Server.MapPath("~/Content/Upload"), fileNameS);
                    fileS.SaveAs(rmfileName);
                }
            }


            report r = sr.GetReportById(id);

            r.id          = rm.id;
            r.objet       = rm.objet;
            r.description = rm.description;
            r.fileName    = rmfileName;
            if (ModelState.IsValid)
            {
                sr.Update(r);
                sr.Commit();
                return(RedirectToAction("Index"));
            }
            return(View());
        }
        private void btn_addproduct_Click(object sender, EventArgs e)
        {
            panel();
            report rep = new report();

            panel4.Controls.Add(rep);
            sales_panel.Show();
        }
Exemplo n.º 18
0
        public ActionResult DeleteConfirmed(int id)
        {
            report report = db.reports.Find(id);

            db.reports.Remove(report);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 19
0
        public ActionResult DeleteConfirmed(int id)
        {
            report report = db.reports.Find(id);
            var    taskId = report.taskId;

            db.reports.Remove(report);
            db.SaveChanges();
            return(RedirectToAction("taskReports", new { id = taskId }));
        }
Exemplo n.º 20
0
        /// <summary>
        /// HID接收数据方法.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Hid_DataReceived(object sender, report e)
        {
            string text = Encoding.Default.GetString(e.reportBuff);

            BeginInvoke(new EventHandler(delegate
            {
                receiveText.AppendText(text + "\r\n");
            }));
        }
Exemplo n.º 21
0
        private void report_html()
        {
            report r = new report();

            r.html_report();
            r.html2_report();
            r.html3_report();
            r.html4_report();
        }
Exemplo n.º 22
0
        public CaseSubmittedViewModel merge(ReportViewModel model, report currentReport)
        {
            CaseSubmittedViewModel temp = new CaseSubmittedViewModel();

            if (model != null)
            {
                try
                {
                    ReportingFrom       = db.country.Where(item => item.id == model.reportFrom).FirstOrDefault().country_nm;
                    anonymityStatus     = db.anonymity.Where(item => item.id == model.incident_anonymity_id).FirstOrDefault().anonymity_en;
                    reporterTypeDetail  = db.company_relationship.Where(item => item.id == model.reporterTypeDetail).FirstOrDefault().relationship_en;
                    locationsOfIncident = db.company_location.Where(item => item.id == model.locationsOfIncident).FirstOrDefault().location_en;
                    int tempDepartmnt = db.report_department.Where(item => item.report_id == currentReport.id).FirstOrDefault().department_id;
                    departmentInvolved = db.company_department.Where(item => item.id == tempDepartmnt).FirstOrDefault().department_en;

                    managementKnow = db.management_know.Where(item => item.id == model.managamentKnowId).FirstOrDefault().text_en;
                    if (model.reported_outside_id == 6)
                    {
                        reported_outside_id = "Other";
                    }
                    else
                    {
                        reported_outside_id = db.reported_outside.Where(item => item.id == model.reported_outside_id).FirstOrDefault().description_en;
                    }

                    isUrgent = db.priority.Where(item => item.id == model.isUrgent).FirstOrDefault().priority_en;
                    caseInformationReport = model.caseInformationReport;
                    dateIncidentHappened  = model.dateIncidentHappened.ToShortDateString();
                    if (model.isOnGoing == 1)
                    {
                        isOnGoing = EC.App_LocalResources.GlobalRes.No;
                    }
                    else if (model.isOnGoing == 2)
                    {
                        isOnGoing = EC.App_LocalResources.GlobalRes.Yes;// +" Description : " + _report.report_frequency_text;
                    }
                    else if (model.isOnGoing == 3)
                    {
                        isOnGoing = EC.App_LocalResources.GlobalRes.NotSureUp;
                    }
                    describeHappened = model.describeHappened;
                    this.Login       = model.userName;
                    this.Password    = model.password;
                    if (model.userEmail == String.Empty)
                    {
                        this.Email = "confidentiality level: Anonymous";
                    }
                    else
                    {
                        this.Email = model.userEmail;
                    }
                } catch (Exception) { }
                //incidentResultReport =
            }
            return(temp);
        }
Exemplo n.º 23
0
        private void btnSend_Click(object sender, EventArgs e)
        {
            string str = tbxSend.Text;     //转为字符串了

            Byte[] data = Encoding.Default.GetBytes(str);

            report r = new report(0, data);

            myHid.Write(r);
        }
Exemplo n.º 24
0
        public bool CreateReport(report InsertReport)
        {
            using (var db = new DbSimaer())
            {
                db.report.Add(InsertReport);
                db.SaveChanges();

                return(true);
            }
        }
Exemplo n.º 25
0
        public bool DeleteReport(report DeleteReport)
        {
            using (var db = new DbSimaer())
            {
                db.report.Remove(DeleteReport);
                db.SaveChanges();

                return(true);
            }
        }
Exemplo n.º 26
0
 public ActionResult Edit([Bind(Include = "fir_id,fir_title,reporter_name,reporter_mobile,reporter_email,report_for,report_summary,report_image,report_processing,report_city,report_state,report_address,police_id")] report report)
 {
     if (ModelState.IsValid)
     {
         db.Entry(report).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(report));
 }
Exemplo n.º 27
0
        public bool UpdateReport(report UpdateReport)
        {
            using (var db = new DbSimaer())
            {
                db.report.AddOrUpdate(UpdateReport);
                db.SaveChanges();

                return(true);
            }
        }
Exemplo n.º 28
0
        public ActionResult TestCode()
        {
            var MR = new report();

            //string downloadPath = MR.OutputWordTest();
            //byte[] fileBytes = System.IO.File.ReadAllBytes(downloadPath);
            //string fileName = Path.GetFileName(downloadPath);
            //return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
            return(File(MR.OutputWordTest(), System.Net.Mime.MediaTypeNames.Application.Octet, "1234.docx"));
        }
Exemplo n.º 29
0
 public ActionResult Edit([Bind(Include = "reportId,taskId,date,Info,time")] report report)
 {
     if (ModelState.IsValid)
     {
         db.Entry(report).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("taskReports", new { id = report.taskId }));
     }
     ViewBag.taskId = new SelectList(db.tasks, "taskId", "Name", report.taskId);
     return(View(report));
 }
Exemplo n.º 30
0
        public report GetReport(string id)
        {
            report report = new report();

            report = DataSource.reports.FirstOrDefault(tempREport => tempREport.idOfReport == id);
            if (report == null)
            {
                throw new ArgumentNullException();
            }
            return(report);
        }
Exemplo n.º 31
0
 public bool Update_report(report reportIns)
 {
     try
     {
         report a = db.report.First(t => t.id == reportIns.id);
         a.name = reportIns.name;
         a.email = reportIns.email;
         a.ip = reportIns.ip;
         a.message1 = reportIns.message1;
         db.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         Console.WriteLine("{2} Update_report exception caught." + e);
         return false;
     }
 }
Exemplo n.º 32
0
 public bool Insert_report(report reportIns)
 {
     try
     {
         db.report.InsertOnSubmit(reportIns);
         db.SubmitChanges();
         return true;
     }
     catch (Exception e)
     {
         Console.WriteLine("{0} Insert_report exception caught." + e);
         return false;
     }
 }