public void PRICELIST_DetailsDAO_DELETE(PRICELIST_Details OBJ)
 {
     // Cap nhat 2019-07-06
     // Khong cho xoa ma chi set Locked = '1'
     // De luu history price list detail
     //Sql.ExecuteNonQuery("SAP", "DELETE FROM [SYNC_NUTRICIEL].[dbo].[tbl_PriceList_Details_LAB] " +
     //" WHERE [ID]=" + OBJ.ID, CommandType.Text);
     Sql.ExecuteNonQuery("SAP", "UPDATE [SYNC_NUTRICIEL].[dbo].[tbl_PriceList_Details_LAB] SET" +
                         "[CreatedDate] = Convert(datetime,'" + DateTime.Now + "',103)" +
                         ",[CreatedBy] = N'" + OBJ.CreatedBy + "' " +
                         ",[Note] = N'" + OBJ.Note + "' " +
                         ",[Locked] = '1' " +
                         " WHERE [ID]=" + OBJ.ID, CommandType.Text);
 }
 public void PRICELIST_DetailsDAO_UPDATE(PRICELIST_Details OBJ)
 {
     Sql.ExecuteNonQuery("SAP", "UPDATE [SYNC_NUTRICIEL].[dbo].[tbl_PriceList_Details_LAB] SET" +
                         "[CTXNID] = N'" + OBJ.CTXNID + "'" +
                         ",[PLID] = " + OBJ.PLID +
                         ",[UoM] = N'" + OBJ.UoM + "'" +
                         ",[SoLuong] = N'" + OBJ.SoLuong + "'" +
                         ",[DonGia] = N'" + OBJ.DonGia + "'" +
                         ",[DonGiaMuaNgoai] = N'" + OBJ.DonGiaMuaNgoai + "'" +
                         ",[DVMuaNgoaiCode] = N'" + OBJ.DVMuaNgoaiCode + "'" +
                         ",[DVMuaNgoaiName] = N'" + OBJ.DVMuaNgoaiName + "'" +
                         ",[Giam] = N'" + OBJ.Giam + "'" +
                         ",[UoMGiam] = N'" + OBJ.UoMGiam + "'" +
                         ",[VAT] = N'" + OBJ.VAT + "'" +
                         ",[CreatedDate] = Convert(datetime,'" + DateTime.Now + "',103)" +
                         ",[CreatedBy] = N'" + OBJ.CreatedBy + "' " +
                         ",[Note] = N'" + OBJ.Note + "' " +
                         ",[Locked] = '" + OBJ.Locked + "' " +
                         ",[MuaNgoai] = '" + OBJ.MuaNgoai + "' " +
                         " WHERE [ID]=" + OBJ.ID, CommandType.Text);
 }
        //public void TC_Insert(TieuChuan tc)
        //{
        //    Sql.ExecuteNonQuery("SAP", "INSERT INTO [SYNC_NUTRICIEL].[dbo].[tbl_TieuChuan] " +
        //                                           "([TC] " +
        //                                           ",[TCDG]) " +
        //                                     "VALUES " +
        //                                           "('" + tc.TC +
        //                                           "','" + tc.TCDG + "'", CommandType.Text);
        //    //return dt;
        //}
        //public void PPT_Update(DataRow dr)
        //{
        //    Sql.ExecuteNonQuery("SAP",  "UPDATE [SYNC_NUTRICIEL].[dbo].[tbl_PhuongPhapThu]" +
        //                                " SET [PPT] ='"+dr["PPT"].ToString() + "'"+
        //                                ",[PPTDG] = '" + dr["PPTDG"].ToString() + "' " +
        //                                "WHERE ID=" + int.Parse(dr["ID"].ToString()), CommandType.Text);
        //    //return dt;
        //}

        public void PRICELIST_DetailsDAO_INSERT(PRICELIST_Details OBJ)
        {
            //XtraMessageBox.Show("LOC.Locked : " + LOC.Locked.ToString());
            Sql.ExecuteNonQuery("SAP", "INSERT INTO [SYNC_NUTRICIEL].[dbo].[tbl_PriceList_Details_LAB] " +
                                " ([CTXNID] " +
                                " ,[PLID] " +
                                " ,[UoM] " +
                                " ,[SoLuong] " +
                                " ,[DonGia] " +
                                " ,[DonGiaMuaNgoai] " +
                                " ,[DVMuaNgoaiCode] " +
                                " ,[DVMuaNgoaiName] " +
                                " ,[Giam] " +
                                " ,[UoMGiam] " +
                                " ,[VAT] " +
                                " ,[CreatedDate] " +
                                " ,[CreatedBy] " +
                                " ,[Note] " +
                                " ,[Locked] " +
                                " ,[MuaNgoai]) " +
                                " VALUES " +
                                "(N'" + OBJ.CTXNID +
                                "'," + OBJ.PLID +
                                ",N'" + OBJ.UoM +
                                "',N'" + OBJ.SoLuong +
                                "',N'" + OBJ.DonGia +
                                "',N'" + OBJ.DonGiaMuaNgoai +
                                "',N'" + OBJ.DVMuaNgoaiCode +
                                "',N'" + OBJ.DVMuaNgoaiName +
                                "',N'" + OBJ.Giam +
                                "',N'" + OBJ.UoMGiam +
                                "',N'" + OBJ.VAT +
                                "',Convert(datetime,'" + DateTime.Now +
                                "',103),N'" + OBJ.CreatedBy +
                                "',N'" + OBJ.Note +
                                "','" + OBJ.Locked +
                                "','" + OBJ.MuaNgoai +
                                "')", CommandType.Text);
        }
Ejemplo n.º 4
0
 public void PRICELIST_DELETE(PRICELIST_Details OBJ)
 {
     DAO.PRICELIST_DetailsDAO_DELETE(OBJ);
 }
Ejemplo n.º 5
0
 public void PRICELIST_UPDATE(PRICELIST_Details OBJ)
 {
     DAO.PRICELIST_DetailsDAO_UPDATE(OBJ);
 }
Ejemplo n.º 6
0
        //public void TC_Insert(TieuChuan tc)
        //{
        //    Sql.ExecuteNonQuery("SAP", "INSERT INTO [SYNC_NUTRICIEL].[dbo].[tbl_TieuChuan] " +
        //                                           "([TC] " +
        //                                           ",[TCDG]) " +
        //                                     "VALUES " +
        //                                           "('" + tc.TC +
        //                                           "','" + tc.TCDG + "'", CommandType.Text);
        //    //return dt;
        //}
        //public void PPT_Update(DataRow dr)
        //{
        //    Sql.ExecuteNonQuery("SAP",  "UPDATE [SYNC_NUTRICIEL].[dbo].[tbl_PhuongPhapThu]" +
        //                                " SET [PPT] ='"+dr["PPT"].ToString() + "'"+
        //                                ",[PPTDG] = '" + dr["PPTDG"].ToString() + "' " +
        //                                "WHERE ID=" + int.Parse(dr["ID"].ToString()), CommandType.Text);
        //    //return dt;
        //}

        public void PRICELIST_INSERT(PRICELIST_Details OBJ)
        {
            //XtraMessageBox.Show("LOC.Locked : " + LOC.Locked.ToString());
            DAO.PRICELIST_DetailsDAO_INSERT(OBJ);
        }