protected void Timer1_Tick(object sender, EventArgs e) { MODEL.Production mod = new MODEL.Production(); BLL.Data _BLL = new BLL.Data(); mod = _BLL.getStatus(); ArrayList arrL = new ArrayList(); arrL = mod.line; MODEL.Data mod_data = new MODEL.Data(); if (arrL.Count > 0) { for (int i = 0; i < arrL.Count; i++) { mod_data = (MODEL.Data)arrL[i]; if (mod_data.Production_active == "1") { count(mod_data); } else { // L1.Attributes["class"] = "btn btn-danger center-block"; } } } //L1.Attributes["class"] = "btn btn-success center-block"; //Span1.InnerHtml = "1"; }
private void initData() { MODEL.Criteria criteria = new MODEL.Criteria(); BLL.Data _BLL = new BLL.Data(); criteria.dateFrom = DateTime.Parse(RadDateTimePicker1.SelectedDate.ToString()).ToString("dd/MM/yyyy HH:mm:ss "); criteria.dateTo = DateTime.Parse(RadDateTimePicker2.SelectedDate.ToString()).ToString("dd/MM/yyyy HH:mm:ss "); Session["DATETO"] = criteria.dateTo; Session["DATEFROM"] = criteria.dateFrom; DataTable dt; dt = _BLL.getDataMissing(criteria); foreach (DataRow dr in dt.Rows) // search whole table { dr["panelTimeOutput"] = _BLL.panelDTOutput(dr["panelTime"].ToString()); //change the name if (dr["Company"].ToString() == "") { dr["Company"] = "NA"; } } ButtonReport.Visible = true; Session["REPORT"] = dt; RadGrid1.DataSource = dt; RadGrid1.DataBind(); }
private void txtBarcode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { MODEL.Data model = new MODEL.Data(); model.vm_id = txtBarcode.Text; BLL.Data _BLL = new BLL.Data(); DataTable dt; dt = _BLL.Update_Data(model); if (dt.Rows.Count > 0) { lbName2.Text = dt.Rows[0]["name"].ToString(); lbSurname2.Text = dt.Rows[0]["lastname"].ToString(); lbCard2.Text = dt.Rows[0]["id_card"].ToString(); lbCompany2.Text = dt.Rows[0]["company"].ToString(); lbContact_person2.Text = dt.Rows[0]["contact_person"].ToString(); lbDept2.Text = dt.Rows[0]["dept"].ToString(); lbLicense2.Text = dt.Rows[0]["license_plate"].ToString(); lb_in_time.Text = dt.Rows[0]["in_time"].ToString(); lb_out_time.Text = dt.Rows[0]["out_time"].ToString(); Bitmap bm = new Bitmap(Application.StartupPath + "//Photo//" + model.vm_id + ".Jpg"); picShow2.Image = bm; } } }
private void button1_Click(object sender, EventArgs e) { MODEL.Data _model = new MODEL.Data(); string strDT1, strDT2; strDT1 = dt1.Value.ToString("yyyy-MM-dd") + " 08:00:00"; strDT2 = dt2.Value.ToString("yyyy-MM-dd") + " 08:00:00"; _model.in_time = strDT1; _model.out_time = strDT2; BLL.Data _BLL = new BLL.Data(); DataTable dt; dt = _BLL.Select_Data(_model); DG.DataSource = dt; }
private void count(MODEL.Data model) { HtmlButton button = new HtmlButton(); HtmlButton button_stop = new HtmlButton(); string tmp = "0"; tmp = Session[model.Line_Name].ToString(); switch (model.Line_Name) { case "1": button = L1; button_stop = S1; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span1.InnerHtml = Session[model.Line_Name].ToString(); break; case "2": button = L2; button_stop = S2; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span2.InnerHtml = Session[model.Line_Name].ToString(); break; case "3": button = L3; button_stop = S3; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span3.InnerHtml = Session[model.Line_Name].ToString(); break; case "4": button = L4; button_stop = S4; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span4.InnerHtml = Session[model.Line_Name].ToString(); break; case "5": button = L5; button_stop = S5; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span5.InnerHtml = Session[model.Line_Name].ToString(); break; case "6": button = L6; button_stop = S6; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span6.InnerHtml = Session[model.Line_Name].ToString(); break; case "7": button = L7; button_stop = S7; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span7.InnerHtml = Session[model.Line_Name].ToString(); break; case "8": button = L8; button_stop = S8; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span8.InnerHtml = Session[model.Line_Name].ToString(); break; case "9": button = L9; button_stop = S9; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span9.InnerHtml = Session[model.Line_Name].ToString(); break; case "10": button = L10; button_stop = S10; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span10.InnerHtml = Session[model.Line_Name].ToString(); break; case "11": button = L11; button_stop = S11; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span11.InnerHtml = Session[model.Line_Name].ToString(); break; case "12": button = L12; button_stop = S12; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span12.InnerHtml = Session[model.Line_Name].ToString(); break; case "13": button = L13; button_stop = S13; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span13.InnerHtml = Session[model.Line_Name].ToString(); break; case "14": button = L14; button_stop = S14; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span14.InnerHtml = Session[model.Line_Name].ToString(); break; case "15": button = L15; button_stop = S15; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span15.InnerHtml = Session[model.Line_Name].ToString(); break; case "16": button = L16; button_stop = S16; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span16.InnerHtml = Session[model.Line_Name].ToString(); break; case "17": button = L17; button_stop = S17; Session[model.Line_Name] = Convert.ToInt32(tmp) + 1; Span17.InnerHtml = Session[model.Line_Name].ToString(); break; } button.Attributes["class"] = "btn btn-success center-block"; if (tmp == "31") { BLL.Data bLL = new BLL.Data(); bLL.NoActive(model); button.Attributes["class"] = "btn btn-danger center-block"; return; } Int32 tmpCountBack; tmpCountBack = 30 - Convert.ToInt32(tmp); SHOWCOUNT.InnerHtml = tmpCountBack.ToString() + "/30"; }
private void btnSave_Click(object sender, EventArgs e) { if (picCard.Image == null && imgCapture.Image == null) { MessageBox.Show("ต้องบันทึกภาพก่อน"); return; } if (cbNocard.Checked) { _Data.name = txtName.Text; _Data.lastname = txtSurname.Text; _Data.picture = imgCapture.Image; _Data.license_plate = txtLicense.Text; _Data.company = txtCompany.Text; _Data.contact_person = txtContactPerson.Text; _Data.dept = txtDept.Text; } else { _Data.name = lbName.Text; _Data.lastname = lbSurname.Text; _Data.id_card = lbCard.Text; _Data.address = lbAddress.Text; _Data.birth = lbBirth.Text; _Data.picture = picCard.Image; _Data.license_plate = txtLicense.Text; _Data.company = txtCompany.Text; _Data.contact_person = txtContactPerson.Text; _Data.dept = txtDept.Text; } BLL.Data _BLL = new BLL.Data(); _Data.vm_id = _BLL.getRuningNoDoc(); Zen.Barcode.Code128BarcodeDraw barcode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum; picBarcode.Image = barcode.Draw(_Data.vm_id, 50); // var barcodeImage = barcode.Draw(_Data.vm_id, 50); // var resultImage = new Bitmap(barcodeImage.Width + 100, barcodeImage.Height + 20); // 20 is bottom padding, adjust to your text // using (var graphics = Graphics.FromImage(resultImage)) //using (var font = new Font("Consolas", 7)) // using (var brush = new SolidBrush(Color.Black)) // using (var format = new StringFormat() // { // Alignment = StringAlignment.Center, // Also, horizontally centered text, as in your example of the expected output // LineAlignment = StringAlignment.Far // }) // { // graphics.Clear(Color.White); // graphics.DrawImage(barcodeImage, 0, 0); // graphics.DrawString(_Data.vm_id,font, brush, resultImage.Width / 2, resultImage.Height, format); // } // picBarcode.Image = resultImage; SaveImageBarcode(picBarcode.Image, _Data); SaveImageCapture(_Data.picture, _Data); _BLL.Insert_Data(_Data); btnPrint.Enabled = true; }