static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            core c = new core();

            Application.Run(new frmLogin(c));
        }
 public frmLogin(core _c)
 {
     c = _c;
     InitializeComponent();
     btClose.Click       += BtClose_Click;
     txtEmail.KeyDown    += TxtUsername_KeyDown;
     txtPassword.KeyDown += TxtPassword_KeyDown;
     btnLogin.Click      += BtnLogin_Click;
     this.Load           += FrmLogin_Load;
 }
 public frmOlshopPrintApps(core _c, string username)
 {
     c = _c;
     InitializeComponent();
     ThisUsername       = username;
     this.Load         += frmOlshopPrintApps_Load;
     btnExports.Click  += btnExports_Click;
     Close.Click       += close_Click;
     btnMinimize.Click += BtnMinimize_Click;
     btCari.Click      += BtCari_Click;
     btPrint.Click     += BtPrint_Click;
     timer1.Tick       += Timer1_Tick;
 }
Example #4
0
        public bool Print(LabelType typ, List <String> detail)
        {
            core c    = new core();
            bool temp = false;

            server = new LabelManager2.Application();
            doc    = new LabelManager2.Document();
            string defaultprinter = getdefaultprinter();

            try
            {
                switch (typ)
                {
                //PRINT LABEL
                case LabelType.PRINTLABEL:
                    server.Documents.Open(Application.StartupPath + @"\PRINTLABEL.lab");
                    server.PrinterSystem();
                    doc = server.ActiveDocument;

                    //Nama printer harus sesuai dg Hardware yang dipasang
                    doc.Printer.SwitchTo(defaultprinter);
                    //doc.Printer.SwitchTo("HP DJ 2130 series");
                    //doc.Printer.SwitchTo("HP LaserJet Professional P1102");

                    doc.Variables.FormVariables.Item("olshopname").Value   = detail[0].ToString();
                    doc.Variables.FormVariables.Item("nama").Value         = detail[1].ToString();
                    doc.Variables.FormVariables.Item("alamat").Value       = detail[2].ToString();
                    doc.Variables.FormVariables.Item("email").Value        = detail[3].ToString();
                    doc.Variables.FormVariables.Item("hp").Value           = detail[4].ToString();
                    doc.Variables.FormVariables.Item("tanggalpesan").Value = detail[5].ToString();
                    doc.Variables.FormVariables.Item("qty").Value          = detail[6].ToString();

                    doc.PrintLabel(1);
                    doc.FormFeed();
                    temp = true;
                    c.killLppa();
                    break;
                }
            }
            catch (Exception ex) { }
            return(temp);
        }