コード例 #1
0
ファイル: MailMessageBuilder.cs プロジェクト: balab2020/vms
        public string BuildBody(Meeting meeting, bool isInvite = true)
        {
            var ipServer = System.Configuration.ConfigurationManager.AppSettings["ServerIp"];
            var url      = $"http://{ipServer}/api/meeting/Acknowledge/${meeting.MeetingId}?email={meeting.VisitorEmail}";
            var message  = $"<p> Your are being invited to meet <strong>{meeting.OrganizorName}</strong> for discussing about {meeting.Purpose}  which scheduled at { meeting.DateTime.ToString()}.</ p >";
            var barcode  = BarcodeController.GenerateQrcodeBase64(meeting.MeetingId + "," + meeting.OTP);
            var mailBody = new StringBuilder();

            mailBody.Append("<html><body>");
            mailBody.Append($"<p>Dear {meeting.VisitorEmail},</p>");
            if (isInvite)
            {
                mailBody.Append($"<p>You are being invited to meet Mr.{meeting.OrganizorName.ToUpper()} for {meeting.Purpose}.</p>");
                mailBody.Append($"<p>Meeting (Id:<strong>{meeting.MeetingId}</strong>) is scheduled at <strong>{meeting.DateTime.ToString()}</strong></p>");
                mailBody.Append($"<p>Please show this mail at security gate, click <a href=\"{url}\">here</a> to confirm your visit.</p>");
                mailBody.Append($"<br/><img src=\"data:image/bitmap;base64,{barcode}\"/>");
            }
            else
            {
                mailBody.Append($"Your meeting is approved. Thanks for visiting campus to meet {meeting.OrganizorName}");
            }
            mailBody.Append("<br/><p>Thanks & Regards,</p>");
            mailBody.Append("<a href='http://www.psnacet.edu.in/'>");
            mailBody.Append("<span>PSNA CET Team</span>");
            mailBody.Append("</a>");
            mailBody.Append("</body></html>");
            var body = mailBody.ToString();

            return(body);
        }
コード例 #2
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     BarcodeController.print_barcode(int.Parse(txtId.Text), int.Parse(txtQty.Text));
     BarcodeController.print_barcode_preview(int.Parse(txtId.Text));
 }
コード例 #3
0
ファイル: AddProduct.cs プロジェクト: chamodPriyamal/CPOS
        private void btnNew_Click(object sender, EventArgs e)
        {
            try
            {
                if (PermissionController.CheckPermission(PermissionType.PRODUCT_ADD))
                {
                    if (MessageHelper.AlertRegisterConfirmation() == DialogResult.Yes)
                    {
                        Product product = new Product();
                        product.Name         = txtName.Text;
                        product.Description  = txtDescription.Text;
                        product.Category     = (Category)cmbCategory.SelectedItem;
                        product.BarcodeData  = txtBarcode.Text;
                        product.ReOrderLevel = decimal.Parse(txtReOrder.Text);


                        ProductBatch batch = new ProductBatch();
                        batch.Cost   = CostCodeController.CodeToCost(txtCost.Text);
                        batch.Cash   = decimal.Parse(txtCash.Text);
                        batch.Credit = decimal.Parse(txtCredit.Text);
                        batch.Markup = decimal.Parse(txtMarkup.Text);
                        batch.Stock  = decimal.Parse(txtStock.Text);

                        if (product.BarcodeData == "")
                        {
                            context.Products.Add(product);
                            context.SaveChanges();
                            product.BarcodeData  = product.Id.ToString();
                            product.BarcodeImage = BarcodeController.GetBarcodeBytes(product.BarcodeData.ToString());
                            context.SaveChanges();
                            batch.Product = product;
                            context.ProductBatches.Add(batch);
                            context.SaveChanges();
                            MessageHelper.AlertRegisterSuccess();
                        }
                        else
                        {
                            context.Products.Add(product);
                            context.SaveChanges();
                            batch.Product = product;
                            context.ProductBatches.Add(batch);
                            context.SaveChanges();
                            MessageHelper.AlertRegisterSuccess();
                        }

                        if (MessageBox.Show("Do you want to print Labels", "Labels", MessageBoxButtons.YesNo) ==
                            DialogResult.Yes)
                        {
                            if (MessageBox.Show("Do you want to Double the Labels", "Labels", MessageBoxButtons.YesNo) ==
                                DialogResult.Yes)
                            {
                                BarcodeController.print_barcode(product.Id, int.Parse((batch.Stock * 2).ToString()));
                                // BarcodeController.print_barcode_preview(product.Id);
                            }
                            else
                            {
                                BarcodeController.print_barcode(product.Id, int.Parse(batch.Stock.ToString()));
                                //BarcodeController.print_barcode_preview(product.Id);
                            }
                        }

                        Helper.ClearForm.ClearAllTextFields(this);
                        txtDescription.Text = "-";
                        txtReOrder.Text     = "0";
                        txtName.Focus();
                    }
                }
                else
                {
                    throw new Exception("Access Denied! (PRODUCT_ADD)");
                }
            }
            catch (Exception ex)
            {
                MessageHelper.AlertError(ex.Message);
            }
        }