Ejemplo n.º 1
0
        public void Set4Controls()
        {
            //TD
            if (isAction == "Edit")
            {
                txtSoPKN.Text = OBJTD.SoPKN;
            }

            lkeKQKNTemplate.EditValue = OBJTD.KQKNTemplateID;
            //lkeSoPNK.Text = OBJTD.SoPNK;
            //lkeSoloPNK.Text = OBJTD.Solo;
            if (chkRM.CheckState == CheckState.Checked)
            {
                lkeSoPNK.Text   = OBJTD.SoPNK;
                lkeSoloPNK.Text = OBJTD.Solo;
            }
            else if (chkFG.CheckState == CheckState.Checked)
            {
                txtSoMRA.Text  = OBJTD.SoMRA;
                lkeWO.Text     = OBJTD.SoPNK;
                txtSoloWO.Text = OBJTD.Solo;
            }

            txtQCDG.Text = OBJTD.QCDG;
            //txtQCDG.Text = OBJTD.QCDG.Substring(0, OBJTD.QCDG.LastIndexOf(" "));
            cmbUoM1.Text     = OBJTD.UoM1;
            cmbUoM2.Text     = OBJTD.UoM2;
            txtSLNhan.Text   = OBJTD.SLNhan;
            dteNgayNhan.Text = OBJTD.NgayNhan.ToString().Substring(0, 10);
            dteNgaySX.Text   = OBJTD.NgaySX.ToString().Substring(0, 10);
            dteHSD.Text      = OBJTD.HSD.ToString().Substring(0, 10);
            dteNgayPT.Text   = OBJTD.NgayPT.ToString().Substring(0, 10);
            txtTenNL.Text    = OBJTD.TenNL;
            txtLan.Text      = OBJTD.Lan.ToString();

            //KQTT
            gridControl1.DataSource = result_KQKN_Detail_RowTableAdapter.FillBySoPKN(sYNC_NUTRICIELDataSet.Result_KQKN_Detail_Row, OBJTD.SoPKN);

            //KL

            OBJKL      = BUSKL.Result_KQKN_KLBUS_SELECT_SoPKN(OBJTD);
            txtKL.Text = OBJKL.KL;
            if (OBJKL.PassFail == "Failed")
            {
                chkFail.CheckState = CheckState.Checked;
                chkPass.CheckState = CheckState.Unchecked;
            }
            else
            {
                chkFail.CheckState = CheckState.Unchecked;
                chkPass.CheckState = CheckState.Checked;
            }

            ////PNK
            //lkeSoPNK.Properties.DataSource = RCB.F_RECEIPT_List();
            //lkeSoPNK.Properties.SearchMode = DevExpress.XtraEditors.Controls.SearchMode.AutoComplete;
            //lkeSoPNK.Properties.DisplayMember = "ECH_RECEPS";
            //lkeSoPNK.Properties.ValueMember = "ECH_RECEPS";
            //lkeSoPNK.Properties.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
        }
Ejemplo n.º 2
0
        public Result_KQKN_KL Result_KQKN_KLDAO_SELECT_SoPKN(Result_KQKN_TD OBJ)
        {
            Result_KQKN_KL OBJKL = new Result_KQKN_KL();
            DataTable      dt    = Sql.ExecuteDataTable("SAP", "SELECT * FROM [SYNC_NUTRICIEL].[dbo].[tbl_Result_KQKN_KL] " +
                                                        " WHERE [SoPKN]='" + OBJ.SoPKN + "'", CommandType.Text);

            OBJKL.KL       = dt.Rows[0]["KL"].ToString();
            OBJKL.PassFail = dt.Rows[0]["PassFail"].ToString();
            OBJKL.SoPKN    = dt.Rows[0]["SoPKN"].ToString();

            return(OBJKL);
        }
Ejemplo n.º 3
0
 public void Result_KQKN_KLDAO_UPDATE(Result_KQKN_KL OBJ)
 {
     Sql.ExecuteNonQuery("SAP", "UPDATE [SYNC_NUTRICIEL].[dbo].[tbl_Result_KQKN_KL] SET" +
                         "[SoPKN] = N'" + OBJ.SoPKN + "'" +
                         ",[KL] = N'" + OBJ.KL + "'" +
                         ",[CT] = N'" + OBJ.CT + "'" +
                         ",[NguoiKT] = N'" + OBJ.NguoiKT + "'" +
                         //",[NgayKT] = CONVERT(datetime,'" + OBJ.NgayKT + "',103)" +
                         ",[NgayKT] = CONVERT(datetime,'" + DateTime.Now + "',103)" +
                         ",[TPKN] = N'" + OBJ.TPKN + "'" +
                         //",[NgayPD] = CONVERT(datetime,'" + OBJ.NgayPD + "',103)" +
                         ",[NgayPD] = CONVERT(datetime,'" + DateTime.Now + "',103)" +
                         ",[PassFail] = N'" + OBJ.PassFail + "'" +
                         ",[Lan] = " + OBJ.Lan +
                         ",[CreatedDate] = CONVERT(datetime,'" + DateTime.Now + "',103)" +
                         ",[CreatedBy] = N'" + OBJ.CreatedBy + "' " +
                         ",[Note] = N'" + OBJ.Note + "' " +
                         //",[Locked] = '" + OBJ.Locked + "' " +
                         ",[Locked] = 'False' " +
                         " WHERE [SoPKN]='" + OBJ.SoPKN + "'", CommandType.Text);
 }
Ejemplo n.º 4
0
 public void Result_KQKN_KLDAO_INSERT(Result_KQKN_KL OBJ)
 {
     //XtraMessageBox.Show("LOC.Locked : " + LOC.Locked.ToString());
     Sql.ExecuteNonQuery("SAP", "INSERT INTO [SYNC_NUTRICIEL].[dbo].[tbl_Result_KQKN_KL] " +
                         " ([SoPKN] " +
                         " ,[KL] " +
                         " ,[CT] " +
                         " ,[NguoiKT] " +
                         " ,[NgayKT] " +
                         " ,[TPKN] " +
                         " ,[NgayPD] " +
                         " ,[PassFail] " +
                         " ,[Lan] " +
                         " ,[CreatedDate] " +
                         " ,[CreatedBy] " +
                         " ,[Note] " +
                         " ,[Locked]) " +
                         " VALUES " +
                         "(N'" + OBJ.SoPKN +
                         "',N'" + OBJ.KL +
                         "',N'" + OBJ.CT +
                         "',N'" + OBJ.NguoiKT +
                         //"',CONVERT(datetime,'" + OBJ.NgayKT +
                         "',CONVERT(datetime,'" + DateTime.Now +
                         "',103),N'" + OBJ.TPKN +
                         //"',CONVERT(datetime,'" + OBJ.NgayPD +
                         "',CONVERT(datetime,'" + DateTime.Now +
                         "',103),N'" + OBJ.PassFail +
                         "'," + OBJ.Lan +
                         ",CONVERT(datetime,'" + DateTime.Now +
                         "',103),N'" + OBJ.CreatedBy +
                         "',N'" + OBJ.Note +
                         //"','" + OBJ.Locked +
                         "',N'False" +
                         "')", CommandType.Text);
 }