Beispiel #1
0
        private void xemTaiLiêuThiêtKêToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DocUtils.InitFTPQLSX();
            int status = TextUtils.ToInt(grvData.GetFocusedRowCellValue(colS));

            if (status == 0)
            {
                MessageBox.Show("Sản phẩm này không có tài liệu thiết kế!", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            //DriveListEx m_list = new DriveListEx();
            //m_list.Load();
            //List<string> listSerial = new List<string>();
            //foreach (var item in m_list)
            //{
            //    listSerial.Add(item.SerialNumber);
            //}

            //if (listSerial.Contains("serialDemo"))
            //{

            //}

            string productCode = grvData.GetFocusedRowCellValue(colCode).ToString();
            string name        = grvData.GetFocusedRowCellValue(colName).ToString();

            if (productCode.StartsWith("TPAD"))
            {
                string _pathCkFTP = "Thietke.Ck/" + productCode.Substring(0, 6) + "/" + productCode + ".Ck";
                if (!DocUtils.CheckExits(_pathCkFTP))
                {
                    MessageBox.Show("Sản phẩm này không có tài liệu thiết kế!", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }
                frmTLTK frm = new frmTLTK();
                frm.ProductCode = productCode;
                frm.ProductName = name;
                frm.Status      = status;
                frm.Show();
            }
            else
            {
                string _pathDtFTP = "Thietke.Dt/PCB/" + productCode;
                if (!DocUtils.CheckExits(_pathDtFTP))
                {
                    MessageBox.Show("Sản phẩm này không có tài liệu thiết kế!", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }
                frmElectronicMaterial frm = new frmElectronicMaterial();
                frm.ProductCode = productCode;
                frm.Show();
            }
        }
        private void xemTaiLiêuThiêtKêToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DocUtils.InitFTPQLSX();

            string productCode = TextUtils.ToString(grvData.GetFocusedRowCellValue(colCode)).Substring(0, 10);
            string name        = TextUtils.ToString(grvData.GetFocusedRowCellValue(colName));

            if (productCode.StartsWith("TPAD"))
            {
                string _pathCkFTP = "Thietke.Ck/" + productCode.Substring(0, 6) + "/" + productCode + ".Ck";
                if (!DocUtils.CheckExits(_pathCkFTP))
                {
                    MessageBox.Show("Cơ cấu này không có tài liệu thiết kế!", TextUtils.Caption, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    return;
                }
                frmTLTK frm = new frmTLTK();
                frm.ProductCode = productCode;
                frm.ProductName = name;
                frm.Status      = 2;
                frm.Show();
            }
        }