Пример #1
0
        public bool insertData(costingdetail k)
        {
            bool       stat  = false;
            Connection ConnG = new Connection();

            try
            {
                ConnG.Konek();
                strQuery             = new MySql.Data.MySqlClient.MySqlCommand();
                strQuery.Connection  = ConnG.Conn;
                strQuery.CommandType = CommandType.Text;
                strQuery.CommandText = "INSERT INTO tblcostingdetail VALUES(@COSTINGNO,@ID,@COSTID,@DESCRIPTION,@WIDTH,@USAG,@CONSUMPTION,@UOMID," +
                                       "@PRICE,@AMOUNT,@CURRENCY,@KURS,@ALLOWANCE,@APPROVE,@APPROVEDATE,@APPROVEBY)";
                strQuery.Parameters.AddWithValue("@COSTINGNO", k.COSTINGNO);
                strQuery.Parameters.AddWithValue("@ID", k.ID);
                strQuery.Parameters.AddWithValue("@COSTID", k.COSTID);
                strQuery.Parameters.AddWithValue("@DESCRIPTION", k.DESCRIPTION);
                strQuery.Parameters.AddWithValue("@WIDTH", k.WIDTH);
                strQuery.Parameters.AddWithValue("@USAG", k.USAG);
                strQuery.Parameters.AddWithValue("@CONSUMPTION", k.CONSUMPTION);
                strQuery.Parameters.AddWithValue("@UOMID", k.UOMID);
                strQuery.Parameters.AddWithValue("@PRICE", k.PRICE);
                strQuery.Parameters.AddWithValue("@AMOUNT", k.AMOUNT);
                strQuery.Parameters.AddWithValue("@CURRENCY", k.CURRENCY);
                strQuery.Parameters.AddWithValue("@KURS", k.KURS);
                strQuery.Parameters.AddWithValue("@ALLOWANCE", k.ALLOWANCE);
                strQuery.Parameters.AddWithValue("@APPROVE", k.APPROVE);
                strQuery.Parameters.AddWithValue("@APPROVEDATE", k.APPROVEDATE);
                strQuery.Parameters.AddWithValue("@APPROVEBY", k.APPROVEBY);
                strQuery.ExecuteNonQuery();
                stat = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                ConnG.Putus();
            }
            return(stat);
        }
Пример #2
0
        public bool updateData(costingdetail k)
        {
            bool stat = false;

            try
            {
                Connection ConnG = new Connection();
                ConnG.Konek();
                strQuery             = new MySql.Data.MySqlClient.MySqlCommand();
                strQuery.Connection  = ConnG.Conn;
                strQuery.CommandType = CommandType.Text;
                strQuery.CommandText = "UPDATE tblcostingdetail SET COSTID=@COSTID,DESCRIPTION=@DESCRIPTION,WIDTH=@WIDTH,USAG=@USAG,CONSUMPTION=@CONSUMPTION,UOMID=@UOMID," +
                                       "PRICE=@PRICE,AMOUNT=@AMOUNT,CURRENCY=@CURRENCY,KURS=@KURS,ALLOWANCE=@ALLOWANCE,APPROVE=@APPROVE,APPROVEDATE=@APPROVEDATE,APPROVEBY=@APPROVEBY WHERE COSTINGNO=@COSTINGNO AND ID=@ID";
                strQuery.Parameters.AddWithValue("@COSTINGNO", k.COSTINGNO);
                strQuery.Parameters.AddWithValue("@ID", k.ID);
                strQuery.Parameters.AddWithValue("@COSTID", k.COSTID);
                strQuery.Parameters.AddWithValue("@DESCRIPTION", k.DESCRIPTION);
                strQuery.Parameters.AddWithValue("@WIDTH", k.WIDTH);
                strQuery.Parameters.AddWithValue("@USAG", k.USAG);
                strQuery.Parameters.AddWithValue("@CONSUMPTION", k.CONSUMPTION);
                strQuery.Parameters.AddWithValue("@UOMID", k.UOMID);
                strQuery.Parameters.AddWithValue("@PRICE", k.PRICE);
                strQuery.Parameters.AddWithValue("@AMOUNT", k.AMOUNT);
                strQuery.Parameters.AddWithValue("@CURRENCY", k.CURRENCY);
                strQuery.Parameters.AddWithValue("@KURS", k.KURS);
                strQuery.Parameters.AddWithValue("@ALLOWANCE", k.ALLOWANCE);
                strQuery.Parameters.AddWithValue("@APPROVE", k.APPROVE);
                strQuery.Parameters.AddWithValue("@APPROVEDATE", k.APPROVEDATE);
                strQuery.Parameters.AddWithValue("@APPROVEBY", k.APPROVEBY);
                strQuery.ExecuteNonQuery();

                ConnG.Putus();
                stat = true;
            }
            catch
            {
            }
            return(stat);
        }