Exemplo n.º 1
0
        private void custom_orderComboBox_SelectedValueChanged(object sender, EventArgs e)
        {
            string str = this.custom_orderComboBox.Text;

            if (str == "")
            {
                return;
            }

            string substr = "";
            string inTime = "";

            //try
            //{
            //    substr = str.Substring(str.Length - 8, 6);
            //    inTime = "20" + substr.Substring(0, 2) + "/" + substr.Substring(2, 2) + "/" + substr.Substring(4, 2);
            //    this.order_out_dateTextBox.Text = inTime;
            //}
            //catch (Exception ex)
            //{
            //    //MessageBox.Show("订单号码时间格式错误, 设置默认值!");
            //    this.order_out_dateTextBox.Text = DateTime.Now.ToString("yyyy/MM/dd");
            //}
            this.order_out_dateTextBox.Text = DateTime.Now.ToString("yyyy/MM/dd");

            if (Untils.isTimeError(this.order_out_dateTextBox.Text.Trim()))
            {
                this.add.Enabled = false;
            }

            try
            {
                DateTime dt1 = DateTime.Parse(inTime);
                DateTime dt2 = DateTime.Now;

                TimeSpan ts = dt2.Subtract(dt1);
                if (ts.TotalDays < 0)
                {
                    MessageBox.Show("请检测当前机器的时间是否正确!");
                    return;
                }
                this.order_receive_dateTextBox.Text = dt2.ToString("yyyy/MM/dd");
            }
            catch (Exception ex)
            {
                //MessageBox.Show("订单号码时间格式错误, 设置默认值!");
                this.order_receive_dateTextBox.Text = DateTime.Now.ToString("yyyy/MM/dd");
            }

            doQueryAfterSelection();
        }
Exemplo n.º 2
0
        //private string requestId = "";
        // private string requestNumber = "";

        //private string reqeusterStatus = "";

        public FRU_OutSheetForm()
        {
            InitializeComponent();
            inputerTextBox.Text         = LoginForm.currentUser;
            this.input_dateTextBox.Text = DateTime.Now.ToString("yyyy/MM/dd");

            if (Untils.isTimeError(this.input_dateTextBox.Text.Trim()))
            {
                this.add.Enabled = false;
            }

            loadInformation();

            if (User.UserSelfForm.isSuperManager() == false)
            {
                this.modify.Visible = false;
                this.delete.Visible = false;
            }
        }
Exemplo n.º 3
0
        private void dataGridViewToReturn_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.dataGridViewToReturn.CurrentRow == null)
            {
                return;
            }

            try
            {
                this.return_file_noTextBox.Text   = generateFileNo();
                this.ordernoTextBox.Text          = dataGridViewToReturn.SelectedCells[0].Value.ToString();
                this.custommaterialNoTextBox.Text = dataGridViewToReturn.SelectedCells[1].Value.ToString();
                this.return_dateTextBox.Text      = DateTime.Now.ToString("yyyy/MM/dd");

                if (Untils.isTimeError(this.return_dateTextBox.Text.Trim()))
                {
                    this.returnStore.Enabled = false;
                }

                this.tatTextBox.Text = dataGridViewToReturn.SelectedCells[5].Value.ToString();


                //根据输入的客户料号,查询MB物料对照表找到dpk状态与mpn
                try
                {
                    SqlConnection mConn = new SqlConnection(Constlist.ConStr);
                    mConn.Open();

                    SqlCommand cmd = new SqlCommand();
                    cmd.Connection  = mConn;
                    cmd.CommandType = CommandType.Text;

                    cmd.CommandText = "select storehouse from receiveOrder where vendor='" + vendorStr
                                      + "' and product ='" + productStr + "' and _status = 'close'";

                    SqlDataReader querySdr = cmd.ExecuteReader();
                    while (querySdr.Read())
                    {
                        this.storehouseTextBox.Text = querySdr[0].ToString();
                    }
                    querySdr.Close();

                    //列出所有可用的flexid给flexidcomboBox
                    cmd.CommandText = "select flex_id from flexidRecord where custom_order='" + ordernoTextBox.Text
                                      + "' and custommaterialNo ='" + custommaterialNoTextBox.Text + "' and _status = ''";
                    querySdr = cmd.ExecuteReader();
                    flexidcomboBox.Items.Clear();
                    while (querySdr.Read())
                    {
                        flexidcomboBox.Items.Add(querySdr[0].ToString());
                    }
                    querySdr.Close();


                    cmd.CommandText = "select dpk_type, mpn, replace_custom_materialNo from MBMaterialCompare where custommaterialNo = '"
                                      + this.custommaterialNoTextBox.Text.Trim() + "'";

                    querySdr = cmd.ExecuteReader();
                    while (querySdr.Read())
                    {
                        this.dpkpnTextBox.Text  = querySdr[0].ToString();
                        this.bommpnTextBox.Text = querySdr[1].ToString();
                        this.replace_custom_materialNotextBox.Text = querySdr[2].ToString();
                    }
                    querySdr.Close();

                    mConn.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
            catch (Exception ex)
            { MessageBox.Show(ex.ToString()); }
        }
Exemplo n.º 4
0
        private void track_serial_noTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == System.Convert.ToChar(13))
            {
                bool error = false;
                if (this.track_serial_noTextBox.Text.Trim() == "")
                {
                    this.track_serial_noTextBox.Focus();
                    MessageBox.Show("追踪条码的内容为空,请检查!");
                    error = true;
                    return;
                }

                try
                {
                    SqlConnection mConn = new SqlConnection(Constlist.ConStr);
                    mConn.Open();

                    SqlCommand cmd = new SqlCommand();
                    cmd.Connection  = mConn;
                    cmd.CommandType = CommandType.Text;

                    //使用top 1保证选择是维修过来的最新的一个记录
                    cmd.CommandText = "select top 1 vendor, product,source,orderno,receivedate,mb_brief, custom_serial_no,vendor_serail_no,mpn,mb_make_date,customFault,"
                                      + "mbfa1,short_cut,bgatype,BGAPN,BGA_place,bga_brief,repairer,repair_date, countNum, _status "
                                      + "from bga_wait_record_table where track_serial_no='" + this.track_serial_noTextBox.Text.Trim() + "'  order by Id desc";

                    SqlDataReader querySdr = cmd.ExecuteReader();
                    string        status   = "";
                    while (querySdr.Read())
                    {
                        this.vendorTextBox.Text           = querySdr[0].ToString();
                        this.producttextBox.Text          = querySdr[1].ToString();
                        this.sourcetextBox.Text           = querySdr[2].ToString();
                        this.ordernotextBox.Text          = querySdr[3].ToString();
                        this.receivedatetextBox.Text      = DateTime.Parse(querySdr[4].ToString()).ToString("yyyy/MM/dd");
                        this.mb_brieftextBox.Text         = querySdr[5].ToString();
                        this.custom_serial_notextBox.Text = querySdr[6].ToString();
                        this.vendor_serail_notextBox.Text = querySdr[7].ToString();
                        this.mpntextBox.Text          = querySdr[8].ToString();
                        this.mb_make_dateTextBox.Text = DateTime.Parse(querySdr[9].ToString()).ToString("yyyy/MM/dd");
                        this.customFaulttextBox.Text  = querySdr[10].ToString();

                        this.mbfa1label.Text    = querySdr[11].ToString();
                        this.shortcutlabel.Text = querySdr[12].ToString();

                        this.bgatypetextBox.Text = querySdr[13].ToString();

                        this.BGAPNtextBox.Text       = querySdr[14].ToString();
                        this.BGA_placetextBox.Text   = querySdr[15].ToString();
                        this.bga_brieftextBox.Text   = querySdr[16].ToString();
                        this.repairertextBox.Text    = querySdr[17].ToString();
                        this.repair_datetextBox.Text = DateTime.Parse(querySdr[18].ToString()).ToString("yyyy/MM/dd");
                        this.countNumtextBox.Text    = querySdr[19].ToString();

                        status = querySdr[20].ToString();
                    }
                    querySdr.Close();

                    mConn.Close();

                    if (status == "" || status != "BGA不良")
                    {
                        this.track_serial_noTextBox.Focus();
                        this.track_serial_noTextBox.SelectAll();
                        MessageBox.Show("追踪条码的内容不在待维修记录表中或待维修记录的状态不是BGA不良,请检查!");
                        return;
                    }
                }
                catch (Exception ex)
                {
                    this.track_serial_noTextBox.Focus();
                    this.track_serial_noTextBox.SelectAll();
                    //MessageBox.Show("追踪条码的内容不在收货表中,请检查!");
                }

                if (!error)
                {
                    this.bgaRepair_resultcomboBox.Focus();
                    bgarepairertextBox.Text   = LoginForm.currentUser;
                    bgarepairDatetextBox.Text = DateTime.Now.ToString("yyyy/MM/dd");

                    if (Untils.isTimeError(this.repair_datetextBox.Text.Trim()))
                    {
                        this.add.Enabled = false;
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void track_serial_noTextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == System.Convert.ToChar(13))
            {
                bool error = false;
                if (this.track_serial_noTextBox.Text.Trim() == "")
                {
                    this.track_serial_noTextBox.Focus();
                    MessageBox.Show("追踪条码的内容为空,请检查!");
                    error = true;
                    return;
                }
                this.track_serial_noTextBox.Text = this.track_serial_noTextBox.Text.ToUpper();
                try
                {
                    SqlConnection mConn = new SqlConnection(Constlist.ConStr);
                    mConn.Open();

                    SqlCommand cmd = new SqlCommand();
                    cmd.Connection  = mConn;
                    cmd.CommandType = CommandType.Text;


                    cmd.CommandText = "select Id from cidRecord where track_serial_no='" + this.track_serial_noTextBox.Text.Trim() + "'";
                    SqlDataReader querySdr = cmd.ExecuteReader();
                    string        cidExist = "";
                    while (querySdr.Read())
                    {
                        cidExist = querySdr[0].ToString();
                    }
                    querySdr.Close();

                    if (cidExist != "")
                    {
                        MessageBox.Show("此序列号已经在CID中,不能走下面的流程!");
                        mConn.Close();
                        return;
                    }

                    cmd.CommandText = "select custommaterialNo, source_brief,custom_order,order_receive_date,custom_serial_no,vendor_serail_no, mb_make_date,custom_fault from DeliveredTable where track_serial_no='" + this.track_serial_noTextBox.Text.Trim() + "'";

                    querySdr = cmd.ExecuteReader();
                    string customMaterialNo = "";
                    string sourceBrief = "", customOrder = "", order_receive_date = "", custom_serial_no = "", vendor_serial_no = "", mb_make_date = "", custom_fault = "";
                    while (querySdr.Read())
                    {
                        customMaterialNo   = querySdr[0].ToString();
                        sourceBrief        = querySdr[1].ToString();
                        customOrder        = querySdr[2].ToString();
                        order_receive_date = querySdr[3].ToString();
                        custom_serial_no   = querySdr[4].ToString();
                        vendor_serial_no   = querySdr[5].ToString();
                        mb_make_date       = DateTime.Parse(querySdr[6].ToString()).ToString("yyyy/MM/dd");
                        custom_fault       = querySdr[7].ToString();
                    }
                    querySdr.Close();

                    if (customMaterialNo != "")
                    {
                        string vendor = "", product = "", mb_describe = "", mb_brief = "", mpn = "", eco = "";
                        cmd.CommandText = "select vendor,product, mb_descripe, mb_brief,mpn,eco from MBMaterialCompare where custommaterialNo='" + customMaterialNo + "'";

                        querySdr = cmd.ExecuteReader();

                        while (querySdr.Read())
                        {
                            vendor      = querySdr[0].ToString();
                            product     = querySdr[1].ToString();
                            mb_describe = querySdr[2].ToString();
                            mb_brief    = querySdr[3].ToString();
                            mpn         = querySdr[4].ToString();
                            eco         = querySdr[5].ToString();
                        }
                        querySdr.Close();

                        this.vendorTextBox.Text           = vendor;
                        this.producttextBox.Text          = product;
                        this.sourcetextBox.Text           = sourceBrief;
                        this.ordernotextBox.Text          = customOrder;
                        this.receivedatetextBox.Text      = order_receive_date;
                        this.mb_describetextBox.Text      = mb_describe;
                        this.mb_brieftextBox.Text         = mb_brief;
                        this.custom_serial_notextBox.Text = custom_serial_no;
                        this.vendor_serail_notextBox.Text = vendor_serial_no;
                        this.mpntextBox.Text          = mpn;
                        this.mb_make_dateTextBox.Text = mb_make_date;
                        this.customFaulttextBox.Text  = custom_fault;
                        this.ECOtextBox.Text          = eco;


                        this.repair_datetextBox.Text = DateTime.Now.ToString("yyyy/MM/dd");

                        if (Untils.isTimeError(this.repair_datetextBox.Text.Trim()))
                        {
                            this.add.Enabled = false;
                        }
                    }
                    else
                    {
                        this.track_serial_noTextBox.Focus();
                        this.track_serial_noTextBox.SelectAll();
                        MessageBox.Show("追踪条码的内容不在收货表中,请检查!");
                        error = true;
                        mConn.Close();
                        return;
                    }

                    //查询bga的维修记录,如果有bga的维修记录,则取最后一条,判断状态是否是不是“BGA待换”,否则提示报错,然后把相关bga的内容填入相应内容中去
                    cmd.CommandText = "select top 1 bga_repair_result,bgatype,BGAPN,BGA_place,bga_brief,mbfa1 from bga_repair_record_table where track_serial_no='" + this.track_serial_noTextBox.Text.Trim() + "'  order by Id desc";

                    querySdr = cmd.ExecuteReader();
                    string bga_repair_result = "", bgatype = "", BGAPN = "", BGA_place = "", bga_brief = "", mbfa1 = "";
                    while (querySdr.Read())
                    {
                        bga_repair_result = querySdr[0].ToString();
                        bgatype           = querySdr[1].ToString();
                        BGAPN             = querySdr[2].ToString();
                        BGA_place         = querySdr[3].ToString();
                        bga_brief         = querySdr[4].ToString();
                        mbfa1             = querySdr[5].ToString();
                    }
                    querySdr.Close();

                    if (bga_repair_result != "" && bga_repair_result == "BGA待换")
                    {
                        MessageBox.Show("BGA的状态不应该是BGA待换,BGA的维修状态还没有完成!!!");
                        this.vendorTextBox.Text           = "";
                        this.producttextBox.Text          = "";
                        this.sourcetextBox.Text           = "";
                        this.ordernotextBox.Text          = "";
                        this.receivedatetextBox.Text      = "";
                        this.mb_describetextBox.Text      = "";
                        this.mb_brieftextBox.Text         = "";
                        this.custom_serial_notextBox.Text = "";
                        this.vendor_serail_notextBox.Text = "";
                        this.mpntextBox.Text          = "";
                        this.mb_make_dateTextBox.Text = "";
                        this.customFaulttextBox.Text  = "";
                        this.ECOtextBox.Text          = "";
                        mConn.Close();
                        return;
                    }
                    else
                    {
                        this.bga_brieftextBox.Text = bga_brief;
                        this.BGAPNtextBox.Text     = BGAPN;
                        this.BGA_placetextBox.Text = BGA_place;
                        this.mbfa1richTextBox.Text = mbfa1;
                        if (bgatype == "VGA")
                        {
                            this.VGA.Checked = true;
                        }
                        else if (bgatype == "CPU")
                        {
                            this.CPU.Checked = true;
                        }
                        else if (bgatype == "PCH")
                        {
                            this.PCH.Checked = true;
                        }
                    }

                    mConn.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }

                this.repair_datetextBox.Text = DateTime.Now.ToString("yyyy/MM/dd");
                if (!error)
                {
                }
            }
        }